4. (TCO 3) Write a complete C++ console mode program (#includes, etc., but no prologue) to ask the user to enter the radius (any positive real number) of a circle. Your program should display the area of a circle with that radius, and the volume of a sphere with that radius. (area = PI * radius2 and volume = PI * 4/3 * radius3 ). The result should be displayed with accuracy to 3 decimal digits (ie. 1.234). Make sure you include all the header files needed to support the operations you use.

a. Use appropriate data types.
b. Make the value of PI (3.14159) a constant in your program.
c. Valid input is any positive real number and zero. If the user input is negative, your program should print an error message and not try to compute any results.
d. Be sure to display explanatory text to make the input and output clear to the user.

(TCO 4) What is the output from the following loop?


Want an answer?

No answer yet. Submit this
question to the community.