Java Code import java.util.Scanner; /** * * File name
Write a Java program for calculating the area of triangles and rectangles. The user is asked whether a triangle or rectangle is required, then prompted for the relevant dimensions, and the answer is displayed. Use Note that the area of a rectangle is width * height, and the area of a triangle is ½ base width * height. Ensure your program works correctly for different user inputs.
Added on 2023-04-08
Java Code import java.util.Scanner; /** * * File name
Write a Java program for calculating the area of triangles and rectangles. The user is asked whether a triangle or rectangle is required, then prompted for the relevant dimensions, and the answer is displayed. Use Note that the area of a rectangle is width * height, and the area of a triangle is ½ base width * height. Ensure your program works correctly for different user inputs.
Added on 2023-04-08
End of preview
Want to access all the pages? Upload your documents or become a member.