Answered step by step
Verified Expert Solution
Link Copied!

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,

image text in transcribed

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 units

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle 10g Database Administrator Implementation And Administration

Authors: Gavin Powell, Carol McCullough Dieter

2nd Edition

1418836656, 9781418836658

More Books

Students also viewed these Databases questions

Question

A chipped cracked sheet of glass is useless to us.

Answered: 1 week ago

Question

Youll receive our usual cheerful prompt service.

Answered: 1 week ago