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:
Addition of Two Numbers
Adding two numbers in programming is essentially the same as adding two numbers in general arithmetic. A significant difference is that in programming, you need to pay attention to the data type of the variable that will hold the sum of two numbers.
C++
C++ is a general-purpose hybrid language, which supports both OOPs and procedural language designed and developed by Bjarne Stroustrup. It began in 1979 as “C with Classes” at Bell Labs and first appeared in the year 1985 as C++. It is the superset of C programming language, because it uses most of the C code syntax. Due to its hybrid functionality, it used to develop embedded systems, operating systems, web browser, GUI and video games.
User Defined Function: Return Value
Create a JAVA
- 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
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](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F1b603dfa-0e96-4781-9e40-dbea153667a5%2Fe8161d58-4027-4f6b-b6cb-ef0457174396%2F0nudn5m_processed.png&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 3 steps with 4 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)