Write a complete C++ program that meets the following criteria: a. Use a do-whil
ID: 3627655 • Letter: W
Question
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
#include #include #include void main() { char ans; int deposit, rate; int interest,p; do { clrscr(); coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.