MENU MENU 11) - Area of squore 12) Area of rectangle 13) 14) - Area of circle 15) - exit 1) - Area of sauare 12) - Area of rectangle 13) - Area of triangle 14! - Area of circle Enter your choice: 1...



User Defined Function: Return Value



Create a JAVA program compute the area of the following polygons and circle.



  • Area of square given the side.

  • Area of rectangle given the length and width.

  • Area of triangle given the base and height.

  • Area of circle given the radius.


EXPECTED OUTPUT:


MENU<br>MENU<br>11) - Area of squore<br>12)<br>Area of rectangle<br>13)<br>14) - Area of circle<br>15) - exit<br>1) - Area of sauare<br>12) - Area of rectangle<br>13) - Area of triangle<br>14! - Area of circle<br>Enter your choice: 1<br>AREA OF SQUARE<br>Enter your choice: 2<br>AREA OF RECIANGLE<br>Enter the length and width of the rectangle: 20 18<br>Enter the side of the square: 10<br>The area is 100 sa. units<br>The area is 200 sa, units<br>MENU<br>MENU<br>111 - Area of square<br>121 - Area of rectangle<br>131 - Area of triangle<br>(1) - frea of sQuare<br>12) - Area of rectangle<br>13) - Area of triangle<br>14) - fArea of circle<br>15) - exit<br>141 - Area of circle<br>exit<br>151<br>Enter your choice: 3<br>AREA OF TRIANGLE<br>Enter the base and width of the height: 8 4<br>Enter your choice: 4<br>NREA OF CIRCLE<br>Enter the radius: 20<br>The area is 16 sa. units<br>The area is 125.6 sq. uni ts<br>

Extracted text: MENU MENU 11) - Area of squore 12) Area of rectangle 13) 14) - Area of circle 15) - exit 1) - Area of sauare 12) - Area of rectangle 13) - Area of triangle 14! - Area of circle Enter your choice: 1 AREA OF SQUARE Enter your choice: 2 AREA OF RECIANGLE Enter the length and width of the rectangle: 20 18 Enter the side of the square: 10 The area is 100 sa. units The area is 200 sa, units MENU MENU 111 - Area of square 121 - Area of rectangle 131 - Area of triangle (1) - frea of sQuare 12) - Area of rectangle 13) - Area of triangle 14) - fArea of circle 15) - exit 141 - Area of circle exit 151 Enter your choice: 3 AREA OF TRIANGLE Enter the base and width of the height: 8 4 Enter your choice: 4 NREA OF CIRCLE Enter the radius: 20 The area is 16 sa. units The area is 125.6 sq. uni ts

Jun 03, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions ยป

Submit New Assignment

Copy and Paste Your Assignment Here