Question: 1 ) Please follow the Java program examples discussed in class on Circle and Rectangle, write Square.java to correctly define a class on Square. 2

1) Please follow the Java program examples discussed in class on Circle and Rectangle, write Square.java to correctly define a class on Square.
2) Write SquareDemo.java to demonstrate the Square class is properly defined and works correctly. SquareDemo.java must do the following: a. Create 5 squares with different sizes and store them in an array. b. Output the size of squares.
c. Increase the sides of the 5 squares by 10%.
d. Output the size, area, and perimeter of the 5 squares after size changing.
e. In all the above steps, please use loop if possible, to save your code. 3) The output of area and perimeter must have two decimal places (you may use System.out.printf to help format the output).

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!