Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a Rectangle class which has data members, height and width. The class shou

ID: 3560750 • Letter: W

Question

Write a Rectangle class which has data members, height and width. The class should have methods getHeight, getWidth and getArea. Two rectangles are equal if their areas are the same. Write the class using equals() method.

Write a main function, which creates two instances of rectangle and checks if the two rectangles are equal.

For e.g

Rectangle r1 = new Rectangle(3,5)

Rectangle r2 = new Rectangle(3,5)

System.out.println(r1.equals(r2));

Your program should not throw error for the below usage:

Rectangle r1 = new Rectangle(3,5);

String s =

Explanation / Answer

/* This application will calculate the input numbers prompted from a user for Rectangle and square sides to its

002 * area, and perimeters that will be printed out together with the with the length and width.
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote