Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

4. (TCO 3) Write a complete C++ console mode program (#includes, etc., but no pr

ID: 1925404 • Letter: 4

Question

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.

5. (TCO 4) Create a C++ program that uses a while-loop to displaythe odd numbers between 15 and 30 including 15. The numbers should be displayed one per line.


6. (TCO 4) Write a complete C++ program that meets the following criteria:

a. Use a do-while loop. Explicitly ask the user if they have more data to enter. Use their answer to decide when the loop is done.
b. The purpose of the loop is to calculate and display the amount of interest for one year given an initial deposit and an interest rate. (interest = deposit * rate)
c. The output from the loop should explain what values are being displayed and display the interest with 2 digits after the decimal point.
d. The loop must ask the user to input the values for the initial deposit and the interest rate. Both values should be treated as real numbers.
e. If either input value is negative, your program should output a message indicating that the input values must be positive numbers. The interest amount should not be displayed in this case.
f. Declare all needed variables using appropriate data types. Initialize as needed.


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.

5. (TCO 4) Create a C++ program that uses a while-loop to displaythe odd numbers between 15 and 30 including 15. The numbers should be displayed one per line.


6. (TCO 4) Write a complete C++ program that meets the following criteria:

a. Use a do-while loop. Explicitly ask the user if they have more data to enter. Use their answer to decide when the loop is done.
b. The purpose of the loop is to calculate and display the amount of interest for one year given an initial deposit and an interest rate. (interest = deposit * rate)
c. The output from the loop should explain what values are being displayed and display the interest with 2 digits after the decimal point.
d. The loop must ask the user to input the values for the initial deposit and the interest rate. Both values should be treated as real numbers.
e. If either input value is negative, your program should output a message indicating that the input values must be positive numbers. The interest amount should not be displayed in this case.
f. Declare all needed variables using appropriate data types. Initialize as needed.

Explanation / Answer

4. #include using namespace std; //constant PI value #define PI 3.14159 //main function int main() { double radius; //radius coutradius; while(radius < 0) { system("cls"); cout
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote