1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Pani-rosa [81]
4 years ago
14

Write a program that calculates the balance of a savings account at the end of a period of time. It should ask the user for the

annual interest rate, the starting balance, and the number of months that have passed since the account was established. A loop should then iterate once for every month, performing the following: A) Ask the user for the amount deposited into the account during the month. (Do not accept negative numbers.) This amount should be added to the balance. B) Ask the user for the amount withdrawn from the account during the month. (Do not accept negative numbers.) This amount should be subtracted from the balance. C) Calculate the monthly interest. The monthly interest rate is the annual interest rate divided by twelve. Multiply the monthly interest rate by the balance, and add the result to the balance. After the last iteration, the program should display the ending balance, the total amount of deposits, the total amount of withdrawals, and the total interest earned.

Computers and Technology
1 answer:
Elden [556K]4 years ago
4 0

Answer:

Check the explanation

Explanation:

# include <iostream>

#include<iomanip>

using namespace std;

int main ()

{double start,balance,rate,deposit=0,withdraw=0,amt,sum,totInterest=0,interest;

int i;

cout<<setprecision(2)<<fixed;

cout<<"Enter starting balance: ";

cin>>balance;

start=balance;

cout<<"Enter annual interest rate: ";

cin>>rate;

rate/=12.;

for(i=1;i<=3;i++)

  {cout<<"For month "<<i<<endl;

  sum=balance;

   cout<<"Enter total amount deposit: ";

   cin>>amt;

   while(amt<0)

       {cout<<"Must not be negative-retry\n";

       cout<<"Enter total amount deposit: ";

       cin>>amt;

       }

   deposit+=amt;

   balance+=amt;

   cout<<"Enter total amount withdrawn: ";

   cin>>amt;

   while(amt<0||amt>balance)

       {cout<<"Must not be negative, or greater than balance ($"<<balance<<")-retry\n";

       cout<<"Enter total amount withdrawn: ";

       cin>>amt;

       }

   withdraw+=amt;

   balance-=amt;

   interest=(sum+balance)/2.*rate;

   totInterest+=interest;

   balance+=interest;

}

cout<<"Starting balance at the beginning of the three month period: $"<<start<<endl;

cout<<"total deposits made during the three months: $"<<deposit<<endl;

cout<<"total withdrawals made during the three months: $"<<withdraw<<endl;

cout<<"total interest posted to the account during the three months $"<<totInterest<<endl;

cout<<"final balance: $"<<balance<<endl;

system("pause");

return 0;

}

Kindly check the output in the attached image below.

You might be interested in
Yazmin is reading a book that has 74 pages. She has read 38 pages. How many more pages does she need to read to finish the book​
Brut [27]

Answer:

36 book

im sure it is correct

4 0
3 years ago
Can someone tell me how to hit on a link on Brainly to see the answer
3241004551 [841]
No, please do not hit on links. they're viruses i'm pretty sure.
7 0
3 years ago
Read 2 more answers
What are the importance of computer in today's generation​
MariettaO [177]

Answer:

We use it everyday for all sorts of stuff

Explanation:

8 0
3 years ago
The ____ category of apps makes the computer easier for blind people to use.
Schach [20]

The accessibility category of apps makes the computer easier for blind people to use. In general the accessibility apps are apps that help people with disabilities use a particular piece of hardware. For example there is an app designed to help blind people use their devices by paring them with a voluntary non-blind people trough audio-video connections.





4 0
3 years ago
Imported data that maintains a refreshable link to its external source is called ____ data.
olga2289 [7]
<span>Imported data that maintains a refreshable link to its external source is called Linked data.</span>
3 0
3 years ago
Other questions:
  • Up to 10 people is a good guideline for the size of your study group.
    15·1 answer
  • WILL THUMBS UP!!!!!ALL COMMENTS!!!!!!
    11·1 answer
  • Answer the following questions using the five different kinds of parallelism techniques: A - Instruction Level Parallelism B - D
    15·1 answer
  • Se Statements
    6·1 answer
  • What are the tasks of a doc file
    15·1 answer
  • Which part of the computer stores and processes data?
    14·1 answer
  • Reverse Word Order: Write a program that reverses the order of the words in a given sentence. This program requires reversing th
    15·1 answer
  • Networks, partnerships, and joint ventures are an example of
    7·1 answer
  • Whenever I rate an answer to a question, it says so and so finds it helpful. It's always the same people that they say find it h
    10·1 answer
  • Create a defined name for range b6:e6 using walkup as the range name
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!