Lab 02 - Classes, Objects, Methods, User Input
Lab 02 - Classes, Objects, Methods, User Input
Lab 02
Classes, Objects, Methods, User Input
Task 1: Write java code to create the GradeBook class that contains a displayMessage method
to displays a message on the screen. You will need to make an object of this class and call its
method to execute display the message.
Now declare a separate class that contains a main method. The GradeBookTest class declaration
will contain the main method that will control your application’s execution.
Expected Output:
Task 2: Write a class Circle, which will model the functionality of a Circle.
1. Attributes
radius
2. Methods
Expected Output:
Task 3: Write a class Rectangle, which will model the functionality of a Rectangle.
1. Attributes
Length
Width
2. Methods
calculateArea(): To compute area
Expected Output: