I need help with the flow chart and comments for the code. (request repunzal: th
ID: 3622511 • Letter: I
Question
I need help with the flow chart and comments for the code. (request repunzal: this is for final project) Thanks
Note: Code included after assignment details)
Exercise 18.7 page 669 C how to program 6th ed. By Deitel
(SavingsAccount Class) Create a SavingsAccount class. Use a static data member annualInterestRate to store the annual interest rate for each of the savers. Each member of the class contains a private data member savingsBalance indicating the amount the saver currently has on deposit. Provide member function calculateMonthlyInterest that calculates the monthly interest by multiplying the balance by annualInterestRate divided by 12; this interest should be added to savingsBalance. Provide a static member function modifyInterestRate that sets the static annualInterestRate to a new value. Write a driver program to test class SavingsAccount. Instantiate two different objects of class SavingsAccount, saver1 and saver2, with balances of 2000.00 and 3000.00, respectively. Set the annualInterestRate to 3 percent. Then calculate the monthly interest and print the new balance for each of the savers. Then set the annualInterestRate to 4 percent, calculate the next month’s interest and print the balances for each of the savers.
#include
#include
using namespace std;
class SavingsAccount
{public:
SavingsAccount( double bal )
{savingsBalance=bal;
}
void calculateMonthlyInterest();
static void modifyInterestRate(double);
void printBalance()const;
private:
double savingsBalance;
static double annualInterestRate;
};
double SavingsAccount::annualInterestRate =0;
void SavingsAccount::calculateMonthlyInterest()
{savingsBalance += savingsBalance*annualInterestRate/12.;
}
void SavingsAccount::modifyInterestRate(double interest )
{annualInterestRate=interest/100.;
}
void SavingsAccount::printBalance() const
{cout<}
int main()
{SavingsAccount a(2000.00);
SavingsAccount b(3000.00);
SavingsAccount::modifyInterestRate(3);
cout<<"Starting balance account a: ";
a.printBalance();
cout<<"Starting balance account b: ";
b.printBalance();
a.calculateMonthlyInterest();
b.calculateMonthlyInterest();
cout<<" monthly interest at 3%: account a ";
a.printBalance();
cout<<" account b ";
b.printBalance();
SavingsAccount::modifyInterestRate(4);
a.calculateMonthlyInterest();
b.calculateMonthlyInterest();
cout<<" monthly interest at 4%: account a ";
a.printBalance();
cout<<" account b ";
b.printBalance();
cout<system("pause");
return 0;
}