Answer to Question #124410 in C++ for emmanuel

Question #124410
Write a program that computes the area of a circular region (the shaded area in the diagram) given the radius of the inner and the outer circles, ri and ro, respectively.









We compute the area of the circular region by subtracting the area of the inner circle from the area of the outer circle.

1. Develop a simple application using functions to calculate the area of the following shapes: Square, Rectangle and Triangle. The user should be able to perform any of the calculation and also press a key to terminate the program.


Write a program that displays the recommended weight in kilograms, given the user’s age and height in centimeters. The formula for calculating the recommended weight is
Recommended = (height – 100 + age %10) *0.90
1
Expert's answer
2020-06-30T08:02:03-0400
#include <iostream>
using namespace std;
int main()
{
float r_in, r_outer,inner_area,outer_area,shaded_area;
/* Calculation of area of the inner circle*/
cout << "Enter the radius of the innter circle: ";
cin >> r_in;
inner_area=3.13*r_in*r_in;
cout << "Area of the innter circle: "<< inner_area << endl;
/* Calculation of area of the outer circle*/
cout << "Enter the radius of the outer circle: ";
cin >> r_outer;
outer_area=3.13*r_outer*r_outer;
cout << "Area of the outer circle: "<< outer_area << endl;
/* calculation of the area of the shaded region */
shaded_area=outer_area-inner_area;
cout << "Area of the shaded region of the circle: "<< shaded_area << endl;
return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS