Question: 2. Write a complete C++ program that has three functions named as follows: - int square (int) : calculate an area of square (length*length). -

2. Write a complete C++ program that has three functions named as follows: - int square (int) : calculate an area of square (length*length). - double triangle(double, double) : calculate an area of triangle ( 0.5 height*base). - double circle(double) : calculate an area of circle (3.14159 * (radius * radius)). Your program will continuously run until the user selects ' n '. The following is a sample run: Calculate an area of: 1. Square 2. Triangle 3. Circle Please give your choice [1/2/3]: 2 Enter height and base : 510 The area of the triangle is 25.0 Continue [y]:y Calculate an area of: 1. Square 2. Triangle 3. Circle Please give your choice [1/2/3] : 1 Enter side length: 10 The area of the square is 100.0 Continue [y] : n Thank you! Hint: Use do while loop and switch statement
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
