I have to create a small bank program here are the instructions any help is appreciated

Write a program that allows users to enter a dollar amount for their bank account balance at the beginner of the month. Then ask the user to enter dollar amount for any number of checks written in a month, up to 50. Store the amount in an array and count the entries as the user makes them. Finally, ask the user to enter a monthly interest rate if the account is interest bearing or a 0 if it is not.

If the user enters 0 for the interest rate, then call a function named balanceAccount() that accepts the beginning balance, number of checks, and the array of checks amounts as arguments; the function prints a report that shows a running total of the bank account balance as each check is subtracted. (Similar tot a month end bank statement). It also prints the final balance after all the checks have been subtracted from the beginning balance.

If the use enters a number other than 0 for the interest rate, then call an overloaded function named balanceAccount() that accepts the beginning balance, number of checks, the array of checks amount, and the interest rate as arguments. This function prints the exact same report as example number 1 and then computes a final month end balance by applying the interest that the bank account has accrued.

Recommended Answers

All 3 Replies

Please post your solution...

What you have done so far? Don't expect someone to do all work for you? First try yourself and if you face any problem, just post here.

This iswhat I have so far

#include <iostream>
#include <string>
#include <vector>
using namespace std;


void cutChecks();
void test(vector<double> y);
vector<double> totalCheck;
void manageAccount();

struct CheckingAccount
{
    string name;
    int acctNumber;
    double begBalance;
    vector <double> totalCheck;


};
CheckingAccount familyAccount[2];
    void manageAccount()
{
    familyAccount[0].name = " John";
    familyAccount[0].acctNumber = 1234;
    familyAccount[0].begBalance = 2000.00;
    familyAccount[0].totalCheck = totalCheck;

    familyAccount[1].name = " Carlos";
    familyAccount[1].acctNumber = 12345;
    familyAccount[1].begBalance = 200.00;
    familyAccount[1].totalCheck = totalCheck;


    cout<<" 1 Name"<<familyAccount[0].name<<endl;
    cout<<" 1 acct number"<<familyAccount[0].acctNumber<<endl;
    //cout<<" 1 beg Balance"<<familyAccount[0].begBalance<<endl;
    //cout<<" 1 total Check"<<familyAccount[0].totalCheck<<endl;

    cout<<" 2 Name"<<familyAccount[1].name<<endl;
    cout<<" 2 acct number"<<familyAccount[1].acctNumber<<endl;
    //cout<<" 2 beg Balance"<<familyAccount[1].begBalance<<endl;
    //cout<<" 2 total Check"<<familyAccount[1].totalCheck<<endl;


}




void test(vector<double> y) {


    for (int i=0; i<y.size(); i++)
    {
        cout<<y[i]<<endl;

    }
}

void cutChecks()
{
    bool cont = true;
    double payCheck = 0.0;
    char ans;

    while(cont)
    {
        cout<<"do you want to add Check ... Y/N"<<endl;
        cin>>ans;
        if (ans == 'N')
            cont = false;
        else
        {
            cout<<"Enter amount ";
            cin>>payCheck;
            totalCheck.push_back(payCheck);
        }
    }
}
int main()
{


    manageAccount();
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.