Write a Java program to print the area and perimeter of a rectangle.
public class App {
public static void main(String[] args) throws Exception {
// scanner
Scanner scanner = new Scanner(System.in);
// get the input length
// get the input width
// calculate the area
// calculate the perimeter
scanner.close();
}
}
height: 8.5
width: 5.5
Area is 5.6 * 8.5 = 47.60
Perimeter is 2 * (5.6 + 8.5) = 28.20