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

Create a program that displays the ending balance in a savings account, given th

ID: 3882097 • Letter: C

Question

Create a program that displays the ending balance in a savings account, given the beginning balance, the deposit amounts, and the withdrawal amounts. Use two loops in the program: one to get the deposit amounts, and the other to get the withdrawal amounts.

a. Create an IPO chart for the problem, and then desk-check the algorithm two times, using the data shown in Figure 7-52.

b. List the input, processing, and output items, as well as the algorithm, in a chart similar to the one shown earlier in Figure 7-42. Then code the algorithm into a program.

c. Desk-check the program using the same data used to desk-check the algorithm.

d. If necessary, create a new project named Advanced24 Project, and save it in the Cpp8Chap07 folder. Enter your C++ instructions into a source file named Advanced24.cpp. Also enter appropriate comments and any additional instructions required by the compiler. Display the ending balance with two decimal places.

e. Save and then run the program. Test the program using the same data used to deskcheck the program.

First desk-check Second desk-check Beginning balance:

2456.75 9855.89

Deposits: 200, 56.50, 25.78, 3.50 1200, 75

Withdrawals:  25, 100 900.75

Explanation / Answer

Solution:

Figures are not shared in the question and I am answering your first question.

Create a program that displays the ending balance in a savings account, given the beginning balance, the deposit amounts, and the withdrawal amounts. Use two loops in the program: one to get the deposit amounts, and the other to get the withdrawal amounts.

code:

#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
double startBalance;
cout<<"Enter the starting balance: ";
cin>>startBalance;
cout<<"Enter the amounts deposited(Enter -1 to quit): ";
double deposit = 0.0;
double endBalance= startBalance;
while(deposit != -1)
{
cin>>deposit;
if(deposit == -1)
break;
endBalance+= deposit;
}
cout<<"Enter the withdrawal amounts (Enter -1 to quit): ";
double encashed = 0.0;
while(encashed != -1)
{
cin>>encashed;
if(encashed== -1)
break;
endBalance -= encashed;
}
cout<<"Ending balance in the account after given transactions is: "<<fixed<<setprecision(2)<<endBalance<<endl;
}
}

I hope this helps if you find any problem. Please comment below. Don't forget to give a thumbs up if you liked it. :)

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