Please Help me make an output like this Scroll down to botto

Please Help me make an output like this!!! Scroll down to bottom to see my header files and implementation files. I just need help with the test program. Someone please Help Me!!

1: Enter 1 for checking account.

2: Enter 2 for savings account.

9: Enter 9 to exit the program.

1

***********************************

Interest Checking ACCT#:        1100    Balance: $1000.00

1: Enter 1 to make a deposit.

2: Enter 2 to set interest rate.

3: Enter 3 to set minimum balance.

4: Enter 4 to set service charge.

5: Enter 5 to withdraw.

6: Enter 6 to write a check.

7: Enter 7 to post interest.

8: Enter 8 to check balance.

9: Enter 9 to exit.

2

Please input the interest rate: 0.01

1: Enter 1 to make a deposit.

2: Enter 2 to set interest rate.

3: Enter 3 to set minimum balance.

4: Enter 4 to set service charge.

5: Enter 5 to withdraw.

6: Enter 6 to write a check.

7: Enter 7 to post interest.

8: Enter 8 to check balance.

9: Enter 9 to exit.

3

Please set minimum balance:800

1: Enter 1 to make a deposit.

2: Enter 2 to set interest rate.

3: Enter 3 to set minimum balance.

4: Enter 4 to set service charge.

5: Enter 5 to withdraw.

6: Enter 6 to write a check.

7: Enter 7 to post interest.

8: Enter 8 to check balance.

9: Enter 9 to exit.

4

Please set service charge:30

1: Enter 1 to make a deposit.

2: Enter 2 to set interest rate.

3: Enter 3 to set minimum balance.

4: Enter 4 to set service charge.

5: Enter 5 to withdraw.

6: Enter 6 to write a check.

7: Enter 7 to post interest.

8: Enter 8 to check balance.

9: Enter 9 to exit.

5

Please enter amount to be withdrawn:300

After this transaction, the balance will be below the minimum balance.

Service charges will apply.

1: Enter 1 to make a deposit.

2: Enter 2 to set interest rate.

3: Enter 3 to set minimum balance.

4: Enter 4 to set service charge.

5: Enter 5 to withdraw.

6: Enter 6 to write a check.

7: Enter 7 to post interest.

8: Enter 8 to check balance.

9: Enter 9 to exit.

8

Interest Checking ACCT#:        1100    Balance: $670.00

1: Enter 1 to make a deposit.

2: Enter 2 to set interest rate.

3: Enter 3 to set minimum balance.

4: Enter 4 to set service charge.

5: Enter 5 to withdraw.

6: Enter 6 to write a check.

7: Enter 7 to post interest.

8: Enter 8 to check balance.

9: Enter 9 to exit.

7

1: Enter 1 to make a deposit.

2: Enter 2 to set interest rate.

3: Enter 3 to set minimum balance.

4: Enter 4 to set service charge.

5: Enter 5 to withdraw.

6: Enter 6 to write a check.

7: Enter 7 to post interest.

8: Enter 8 to check balance.

9: Enter 9 to exit.

8

Interest Checking ACCT#:        1100    Balance: $676.70

1: Enter 1 to make a deposit.

2: Enter 2 to set interest rate.

3: Enter 3 to set minimum balance.

4: Enter 4 to set service charge.

5: Enter 5 to withdraw.

6: Enter 6 to write a check.

7: Enter 7 to post interest.

8: Enter 8 to check balance.

9: Enter 9 to exit.

1

Enter amount to be deposited: 523.3

1: Enter 1 to make a deposit.

2: Enter 2 to set interest rate.

3: Enter 3 to set minimum balance.

4: Enter 4 to set service charge.

5: Enter 5 to withdraw.

6: Enter 6 to write a check.

7: Enter 7 to post interest.

8: Enter 8 to check balance.

9: Enter 9 to exit.

8

Interest Checking ACCT#:        1100    Balance: $1200.00

1: Enter 1 to make a deposit.

2: Enter 2 to set interest rate.

3: Enter 3 to set minimum balance.

4: Enter 4 to set service charge.

5: Enter 5 to withdraw.

6: Enter 6 to write a check.

7: Enter 7 to post interest.

8: Enter 8 to check balance.

9: Enter 9 to exit.

6

Please enter amount to be written on the check:400

1: Enter 1 to make a deposit.

2: Enter 2 to set interest rate.

3: Enter 3 to set minimum balance.

4: Enter 4 to set service charge.

5: Enter 5 to withdraw.

6: Enter 6 to write a check.

7: Enter 7 to post interest.

8: Enter 8 to check balance.

9: Enter 9 to exit.

8

Interest Checking ACCT#:        1100    Balance: $800.00

1: Enter 1 to make a deposit.

2: Enter 2 to set interest rate.

3: Enter 3 to set minimum balance.

4: Enter 4 to set service charge.

5: Enter 5 to withdraw.

6: Enter 6 to write a check.

7: Enter 7 to post interest.

8: Enter 8 to check balance.

9: Enter 9 to exit.

9

1: Enter 1 for checking account.

2: Enter 2 for savings account.

9: Enter 9 to exit the program.

2

***********************************

Savings ACCT#:                  1101    Balance: $1500.00

1: Enter 1 to make a deposit.

2: Enter 2 to set interest rate.

3: Enter 3 to withdraw.

4: Enter 4 to post interest.

5: Enter 5 to check balance.

9: Enter 9 to exit.

2

Please input the interest rate: 0.1

1: Enter 1 to make a deposit.

2: Enter 2 to set interest rate.

3: Enter 3 to withdraw.

4: Enter 4 to post interest.

5: Enter 5 to check balance.

9: Enter 9 to exit.

1

Enter amount to be deposited: 300

1: Enter 1 to make a deposit.

2: Enter 2 to set interest rate.

3: Enter 3 to withdraw.

4: Enter 4 to post interest.

5: Enter 5 to check balance.

9: Enter 9 to exit.

5

Savings ACCT#:                  1101    Balance: $1800.00

1: Enter 1 to make a deposit.

2: Enter 2 to set interest rate.

3: Enter 3 to withdraw.

4: Enter 4 to post interest.

5: Enter 5 to check balance.

9: Enter 9 to exit.

4

1: Enter 1 to make a deposit.

2: Enter 2 to set interest rate.

3: Enter 3 to withdraw.

4: Enter 4 to post interest.

5: Enter 5 to check balance.

9: Enter 9 to exit.

5

Savings ACCT#:                  1101    Balance: $1980.00

1: Enter 1 to make a deposit.

2: Enter 2 to set interest rate.

3: Enter 3 to withdraw.

4: Enter 4 to post interest.

5: Enter 5 to check balance.

9: Enter 9 to exit.

3

Please enter amount to be withdrawn:100

1: Enter 1 to make a deposit.

2: Enter 2 to set interest rate.

3: Enter 3 to withdraw.

4: Enter 4 to post interest.

5: Enter 5 to check balance.

9: Enter 9 to exit.

5

Savings ACCT#:                  1101    Balance: $1880.00

1: Enter 1 to make a deposit.

2: Enter 2 to set interest rate.

3: Enter 3 to withdraw.

4: Enter 4 to post interest.

5: Enter 5 to check balance.

9: Enter 9 to exit.

9

1: Enter 1 for checking account.

2: Enter 2 for savings account.

9: Enter 9 to exit the program.

9

//bank account header file

#ifndef BANKACCOUNT_H
#define BANKACCOUNT_H
using namespace std;
class bankAccount
{
public:
   bankAccount(int, double);
   bankAccount();
   void setAccNum(int);
   int getAccNum();
   double getBalance();
   void withdraw(double);
   void deposit(double);
   void print();
protected:
   int accNum;
   double balance;
};
#endif BANKACCOUNT_H

//bank account implementation file

#include
#include \"bankAccount.h\"

using namespace std;


bankAccount::bankAccount(int n, double b)
{
   accNum = n;
   balance = b;
}

bankAccount::bankAccount()
{
   accNum = 0;
   balance = 0;
}

void bankAccount::setAccNum(int a)
{
   accNum = a;
}
int bankAccount::getAccNum()
{
   return accNum;
}
double bankAccount::getBalance()
{
   return balance;
}
void bankAccount::withdraw(double a)
{
   balance -= a;
}
void bankAccount::deposit(double a)
{
   balance += a;
}
void bankAccount::print()
{
   cout << accNum << \"Balance: $\" << setprecision(2) << fixed << balance << endl;
}

//checking account header file

#include
#include \"bankAccount.h\"
using namespace std;
#ifndef CHECKINGACCOUNT_H
#define CHECKINGACCOUNT_H

class checkingAccount : public bankAccount
{
public:
   checkingAccount(int accNum, double bal);
   double getMinBal();
   double getRate();
   double getFee();
   void setMinBal(double);
   void setRate(double);
   void setFee(double);
   void postInterest();
   bool checkMinBal(double);
   void checkingAccount::writeCheck(double);
   void withdraw(double);
   void print();
protected:
   double rate;
   double minBal;
   double fee;
};
#endif CHECKINGACCOUNT_H

//checking account implementation file

#include
#include \"checkingAccount.h\"

using namespace std;


checkingAccount::checkingAccount(int n, double b) :bankAccount(n, b)
{
   setRate(.04);
   setMinBal(500);
   setFee(20);
}
double checkingAccount::getMinBal()
{
   return minBal;
}
double checkingAccount::getRate()
{
   return rate;
}
double checkingAccount::getFee()
{
   return fee;
}
void checkingAccount::setMinBal(double m)
{
   minBal = m;
}
void checkingAccount::setRate(double r)
{
   rate = r;
}
void checkingAccount::setFee(double f)
{
   fee = f;
}
void checkingAccount::postInterest()
{
   balance += (balance*rate);
}
bool checkingAccount::checkMinBal(double a)
{
   if (balance - a >= minBal)
       return true;
   else
       return false;
}
void checkingAccount::writeCheck(double a)
{
   withdraw(a);
}
void checkingAccount::withdraw(double a)
{
   if (balance - a<0)
       cout << \"insufficient funds for $\" << a << \" withdrawal\ \";
   else if (balance - a        if (balance - a - fee            cout << \"insufficient funds for withdrawal + fees, since balance will be below minimum\ \";
       else
       {
           cout << \"balance below minimum. $\" << fee << \" fee charged\ \";
           balance -= (a + fee);
       }
   else
       balance -= a;
}
void checkingAccount::print()
{
   cout << \"Interest Checking ACCT#:\\t\" << getAccNum()
       << \"\\tBalance: $\" << setprecision(2) << fixed << getBalance() << endl;
}

//savings account header file

#include
#include \"bankAccount.h\"

using namespace std;

#ifndef SAVINGSACCOUNT_H
#define SAVINGSACCOUNT_H


class savingsAccount : public bankAccount
{
public:
   savingsAccount(int, double);
   void setRate(double);
   double getRate();
   void withdraw(double);
   void postInterest();
   void savingsAccount::print();
protected:
   double rate;
};
#endif SAVINGSACCOUNT_H

//savings account implementation file

#include
#include \"savingsAccount.h\"

using namespace std;

savingsAccount::savingsAccount(int n, double b) :bankAccount(n, b)
{
   setRate(.06);
}
double savingsAccount::getRate()
{
   return rate;
}
void savingsAccount::setRate(double r)
{
   rate = r;
}
void savingsAccount::withdraw(double a)
{
   if (balance - a<0)
       cout << \"insufficient funds for $\" << setprecision(2) << fixed << \" withdrawal\ \";
   else
       balance -= a;
}
void savingsAccount::postInterest()
{
   balance += (balance*rate);
}
void savingsAccount::print()
{
   cout << \"Savings ACCT#:\\t\\t\\t\" << getAccNum()
       << \"\\tBalance: $\" << setprecision(2) << fixed << getBalance() << endl;
}

Solution

Answer:

The driver program is,

#include<iostream>

#include \"savingsAccount.h\"

#include \"checkingAccount.h\"

#include \"bankAccount.h\"

#include<string>

#include<cstdlib>

#include<iomanip>

using namespace std;

int main()

{

     int cc1,cc2;

     checkingAccount cant(1100, 1000);

     savingsAccount sant(1101,1500);

     while(1)

     {

          menu1();

          cin>>cc1;

          cout<<\"***************************\"<<endl;

          if(cc1==9)

              break;

          if(cc1==1)

          {

              while(1)

              {

                   menu2();

                   cin>>cc2;

                   if(cc2==9)

                        break;

                   cant.print();

                   switch(cc2)

                   {

                   case 1:

                        double amt;

                        cout<<\" Enter amount to be deposited\";

                        cant.deposit(amt);

                        break;

                   case 2:

                        double rate;

cout<<\"Please input the interest rate:\";

                        cin>>rate;

                        cant.setRate(rate);

                        break;

                   case 3:

                        double minBal;

cout<<\"Please set the minimum balance:\";

                        cin>>minBal;

                        cant.setMinBal(minBal);

                        break;

                   case 4:

                        double ser;

                        cout<<\"Please set setvice charge:\";

                        cin>>ser;

                        cant.setFee(ser);

                        break;

                   case 5:

                       

cout<<\"Please enter amount to be withdrawn\";

                        cin>>amt;

                        cant.withdraw(amt);

                        break;

                   case 6:

                       

cout<<\"\ Please enter amount to be written on the check:\";

                        cin>>amt;

                        cant.writeCheck(amt);

                        break;

                   case 7:

                        cant.postInterest();

                        break;

                   case 8:

                        cant.print() ;

                        break;

                   default:

                        cout<<\"INVALID\"<<endl;

                        break;

                   }

              }

          }

          else if(cc1==2)

          {

              while(1)

              {

                   menu3();

                   cin>>cc2;

                   if(cc2==9)

                        break;

                   sant.print();

                   switch(cc2)

                   {

                   case 1:

                        double amt;

                        cout<<\" Enter amount to be deposited\";

                        sant.deposit(amt);

                        break;                      

                   case 2:

                        double rate;

cout<<\"Please input the interest rate:\";

                        cin>>rate;

                        sant.setRate(rate);

                        break;

                   case 3:           

cout<<\"Please enter amount to be withdrawn\";

                        cin>>amt;

                        cant.withdraw(amt);

                        break;

                   case 4:

                        sant.postInterest();

                        break;

                   case 5:

                        sant.print();

                        break;

                   default:

                   break;

                   }

              }

          }

     }

     return 0;

}

Sample output:

sh-4.3$ g++ -o main *.cpp                                                                                                          

sh-4.3$ main                                                                                                                        

1: Enter 1 for checking account.                                                                                                   

2: Enter 2 for savings account.                                                                                                     

9: Enter 9 to exit the program.                                                                                                    

1                                                                                                                                   

***************************                                                                                                        

1: Enter 1 to make a deposit.                                                                                                      

2: Enter 2 to set interest rate.                                                                                                    

3: Enter 3 to set minimum balance.                                                                                                 

4: Enter 4 to set service charge.                                                                                                   

5: Enter 5 to withdraw.                                                                                                            

6: Enter 6 to write a check.                                                                                                        

7: Enter 7 to post interest.                                                                                                       

8: Enter 8 to check balance.                                                                                                        

9: Enter 9 to exit.                                                                                                                

2                                                                                                                                   

Interest Checking ACCT#:        1100    Balance: $1000.00                                                                          

Please input the interest rate:0.05                                                                                                 

1: Enter 1 to make a deposit.                                                                                                      

2: Enter 2 to set interest rate.                                                                                                    

3: Enter 3 to set minimum balance.                                                                                                 

4: Enter 4 to set service charge.                                                                                                   

5: Enter 5 to withdraw.                                                                                                            

6: Enter 6 to write a check.                                                                                                        

7: Enter 7 to post interest.                                                                                                       

8: Enter 8 to check balance.                                                                                                        

9: Enter 9 to exit.

9

1: Enter 1 for checking account.                                                                                                   

2: Enter 2 for savings account.                                                                                                    

9: Enter 9 to exit the program.   

2                                                                                                                                   

***************************                                                                                                        

1: Enter 1 to make a deposit.                                                                                                       

2: Enter 2 to set interest rate.                                                                                                   

3: Enter 3 to withdraw.                                                                                                            

4: Enter 4 to post interest.                                                                                                        

5: Enter 5 to check balance.                                                                                                       

9: Enter 9 to exit.                                                                                                                 

3                                                                                                                                  

Savings ACCT#:                  1101    Balance: $1500.00                                                                           

Please enter amount to be withdrawn100                                                                                             

balance below minimum. $20.00 fee charged                                                                                           

1: Enter 1 to make a deposit.                                                                                                      

2: Enter 2 to set interest rate.                                                                                                    

3: Enter 3 to withdraw.                                                                                                            

4: Enter 4 to post interest.                                                                                                        

5: Enter 5 to check balance.                                                                                                       

9: Enter 9 to exit.                                                                                                                 

5                                                                                                                                  

Savings ACCT#:                  1101    Balance: $1500.00  

1: Enter 1 to make a deposit.                                                                                                      

2: Enter 2 to set interest rate.                                                                                                    

3: Enter 3 to withdraw.                                                                                                            

4: Enter 4 to post interest.                                                                                                        

5: Enter 5 to check balance.                                                                                                       

9: Enter 9 to exit.    

9

1: Enter 1 for checking account.                                                                                                    

2: Enter 2 for savings account.                                                                                                    

9: Enter 9 to exit the program.  

9

                       

                  

Please Help me make an output like this!!! Scroll down to bottom to see my header files and implementation files. I just need help with the test program. Someon
Please Help me make an output like this!!! Scroll down to bottom to see my header files and implementation files. I just need help with the test program. Someon
Please Help me make an output like this!!! Scroll down to bottom to see my header files and implementation files. I just need help with the test program. Someon
Please Help me make an output like this!!! Scroll down to bottom to see my header files and implementation files. I just need help with the test program. Someon
Please Help me make an output like this!!! Scroll down to bottom to see my header files and implementation files. I just need help with the test program. Someon
Please Help me make an output like this!!! Scroll down to bottom to see my header files and implementation files. I just need help with the test program. Someon
Please Help me make an output like this!!! Scroll down to bottom to see my header files and implementation files. I just need help with the test program. Someon
Please Help me make an output like this!!! Scroll down to bottom to see my header files and implementation files. I just need help with the test program. Someon
Please Help me make an output like this!!! Scroll down to bottom to see my header files and implementation files. I just need help with the test program. Someon
Please Help me make an output like this!!! Scroll down to bottom to see my header files and implementation files. I just need help with the test program. Someon
Please Help me make an output like this!!! Scroll down to bottom to see my header files and implementation files. I just need help with the test program. Someon
Please Help me make an output like this!!! Scroll down to bottom to see my header files and implementation files. I just need help with the test program. Someon
Please Help me make an output like this!!! Scroll down to bottom to see my header files and implementation files. I just need help with the test program. Someon
Please Help me make an output like this!!! Scroll down to bottom to see my header files and implementation files. I just need help with the test program. Someon
Please Help me make an output like this!!! Scroll down to bottom to see my header files and implementation files. I just need help with the test program. Someon
Please Help me make an output like this!!! Scroll down to bottom to see my header files and implementation files. I just need help with the test program. Someon

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site