Question: Write a class called rectangle that creates and processes rectangular objects. Plz use simple Java language(BLUEJ is preferred) thank you! 6. [after 7.10-easy] Rectangles :

Write a class called rectangle that creates and processes rectangular objects. Plz use simple Java language(BLUEJ is preferred) thank you!  Write a class called rectangle that creates and processes rectangular objects.

6. [after 7.10-easy] Rectangles : Write a class called Rectangle that creates and processes rectangular objects. Include a class variable that holds the total number of rectangles and instance variables for height and width. a constructor that creates a new rectangle with a given height and width. Provide methods that return the total number of rectangles, increase the height of a calling rectangle, increase the calling rectangle, and print the area of a calling rectangle. Include this main method rovide width of a public static void main(String args) Rectangle r1 = new Rectangle(); r1.printArea () Rectangle r2 new Rectangle (2, 4) r2.printArea) r2.addHeight (3) addWidth (3) r2.printArea) System.out.println( Total number of rectanglesRectangle.getNumofRectangles)) ) I/ end main With this main method your program should generate the following output: Sample session Rectangle's area = 0 Rectangle's area = 8 Rectangle's area 35 Total number of rectangles = 2

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 Databases Questions!