Lab 5 (2%)
Due Date
Part 1 (Methods)
- Create four methods with the following names Add, Subtraction, Multiplication, Division
- Define two arguments or parameters inside each method
- Perform a calculation based on method name
- Invoke (call) all four methods from the main method and pass the global variables for the methods.
- Print the results from all four methods
Part 2 (Methods Overloading)
Hint (https://github.com/shivasharma/IS147/blob/master/src/Week7/Person.java)
https://github.com/shivasharma/IS147/blob/master/src/Week7/Main.java
- Create a print method with a void return type that prints your name at the beginning of the program.
- Create a class named Book. Create a new file to add the book-related info.
- Define the following private variables with appropriate datatype (author, title, page number, price,
etc) with some
default values
- Define overload methods with the following method return data types (int, String, boolean, double)
inside a Book class
- All methods must be declared as a public method
- All methods must return the appropriate return type
- Invoke all the methods from your main class
- Print the message from each methods
How to submit the lab?
-
Please write your full name, and email on top of your file using the comment tag.
-
Compile and run your program, and enter all the inputs as required.
-
Take a screenshot of your result.
-
Zip your project with a screenshot, and source code and upload it on Blackboard
-
Submit assignments on Blackboard. Any assignments submitted through email are not accepted..