Question: Write a C + + code to calculate the surface area of a cone. This program reads input ( radius and height ) from the
Write a code to calculate the surface area of a cone. This program reads input radius
and height from the keyboard and prints the area of the cone on the screen.
The surface area of the cone is represented as:
where
is the radius, is the height, and is
a Declare a constant variable named PI and assign to the constant variable.
b Using cout and cin, Prompt for and read in the value of radius from the keyboard.
c Using cout and cin, Prompt for and read in the value of vertical height from the keyboard.
d Compute the surface area of the cone using the equation mentioned above.
More Hints:
You should use pow function to calculate and A sqrt function is used
to compute the square root. To enable these functions, you need to include appropriate
math library.
Use floating point datatype for radius, height, and area.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
