Question: Java 1) Create a rectangle r1 with height 18, width 6, and color blue. 2) Change the r1's colour to green. 3) Create a rectangle
Java
1) Create a rectangle r1 with height 18, width 6, and color "blue".
2) Change the r1's colour to "green".
3) Create a rectangle r2 with width 6, height 12 and color "red".
4) Change rectangle r2's width to 4
5) Output the sum of the two rectangles' perimeters
6) Output the absolute value of the difference of the two rectangles' areas
7) Change r2's height to 24
8) Output the square root of r2's area, formatted to only show 2 digits after the decimal
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
