Question: QUESTION 5 ( 2 0 Mark: Create a constructor class Area that has public integer variables length and width. Include a default constructor and a

QUESTION 5
(20 Mark:
Create a constructor class Area that has public integer variables length and width. Include a default constructor and a void method Rectangle that accepts the two integer parameters, calculates and outputs the area of the rectangle (area) using a System.out statement.
In your main class called Calc_Area include a main method that prompts the user to enter 2 integer values and creates a reference called a1 for the constructor Area. Output the values entered by the user and the result from the Rectangle method in the command line window.
Example:
Input =2,3
Output example:
QUESTION 5 ( 2 0 Mark: Create a constructor class

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!