Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C++ 2. Write a program that prompts the user to input a radius in centimeters and calculates and then prints the area of a circle,
C++
2. Write a program that prompts the user to input a radius in centimeters and calculates and then prints the area of a circle, volume of a sphere, and surface area of a sphere with that radius. Define PI as a defined constant using a preprocessor command with a value of 3.14159265 or declare pi as a constant variable. Use data type double for all variables. Using a complete sentence, print the circle area as a decimal with 2 digits following the decimal point. Include units. Using a complete sentence, print the volume of the sphere in exponential format with 4 digits following the decimal point when written in exponential notation. 41 r (Use the formula V Beware of truncating 3.0 the fraction 4/3.) Include units. Again using a complete sentence, output the surface area of the sphere in g format with 5 significant digits. Include unitsStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started