MY CODE >> ATM Machine
// Tommy Martin
// ATM Martin.cpp
// This program simulates an ATM
// The program allows the user to veiw their account balance, make a deposit, or withdraw money
// The user is not allowed to make more than two transactions at a time
// If the user's account balance goes above $4500 then a 3% bonus is added to the account

#include<iostream>
#include<iomanip>

using namespace std;

// Function Prototype
void pinPrompt (int &, int, int);
void menu ();
void menuPrompt (int &);
void checkBalance (int, double, double);
void withdraw (int, double &, double &);
void deposit (int, double & , double & );
void calcDeposit (int, double &, double &, double);
double calcDeposit (double &);
void closingTime (double, double, int, int);

int main()
{

    // Delclare user accounts, balances, and and other variables
    const int ACC_1_PIN = 4433;
    const int ACC_2_PIN = 2849;

    double acc1Balance = 3742.55;
    double acc2Balance = 19.36;

    int accountSession = 0;
    int promptChoice = 0;
    int countSession = 0;

    bool pinCount = true;

    // while loop incorporated to to keep the program going until the user is finished
    while (pinCount) {

        countSession = 0;

        pinPrompt (accountSession, ACC_1_PIN, ACC_2_PIN);

        while (countSession < 2 && (accountSession == 999 || accountSession == 1 || accountSession == 2)) {
            if (accountSession == 1 || accountSession == 2) {

                menu ();
                menuPrompt (promptChoice);

                if (promptChoice == 1)
                    checkBalance (accountSession, acc1Balance, acc2Balance);
                else if (promptChoice == 2)
                    withdraw (accountSession, acc1Balance, acc2Balance);
                else if (promptChoice == 3)
                    deposit (accountSession, acc1Balance, acc2Balance);
                else if (promptChoice == 4)
                    countSession = 2;

            countSession++;

            if (countSession > 1 && !(promptChoice == 4))
                cout << "No more than two transactions may be done at a time,\nsession ended...\n\n";

            }

            else if (accountSession == 999) {

                closingTime (acc1Balance, acc2Balance, ACC_1_PIN, ACC_2_PIN);

                pinCount = false;
                accountSession = 0;

            }

        }
    }

    return 0;

}

//  This function is used to prompt and verify the user's PIN
void pinPrompt (int & accountSession, int ACC_1_PIN, int ACC_2_PIN) {

    // declaring variable to be used in the function
    bool checkPin = true;
    int enterPin = 0;
    int count = 1;

    // This loop will ask for the user's PIN up to three times
    while (checkPin) {

        // ask for the user's PIN
        cout << "Please enter PIN: "; cin >> enterPin; cout << endl;

        // ifs used to verify which user's PIN is being accessed
        if (enterPin == ACC_1_PIN) {

            checkPin = false;
            accountSession = 1;

        }

        else if (enterPin == ACC_2_PIN) {

            checkPin = false;
            accountSession = 2;

        }

        else if (enterPin == 999) {

            checkPin = false;
            accountSession = 999;

        }

        else if(count == 3) {

            cout << "You have failed to enter your PIN three times.\n\n";
            accountSession = 0;
            count = 0;

        }

        // Verify that the user does not get more than three tries
        count++;

    }

}

// this function displays on option menu to the user
void menu () {

    cout << "--------------Menu Options--------------\n\n"
         << "Enter 1 to check balance.\n"
         << "Enter 2 to withdraw from your account. \n"
         << "Enter 3 to deposit into your account. \n"
         << "Enter 4 to end transaction.\n\n";

}

// this function prompts the users for a menu choice
void menuPrompt (int & promptChoice) {

    cout << "Please select a menu option: "; cin >> promptChoice; cout << endl;

    while (promptChoice < 1 || promptChoice > 4) {

        cout << "Please select a valid menu option: "; cin >> promptChoice; cout << endl;

    }

}

// This function displays the users balance
void checkBalance (int accountSession, double acc1Balance, double acc2Balance) {

    if (accountSession == 1)
        cout << "Your account balance is: " << fixed << setprecision(2) <> wAmount; cout << endl;

    if (accountSession == 1) {

        if (wAmount > acc1Balance)
            cout << "You can not withdraw more money than you have available in your account.\n\n";

        else if (wAmount < acc1Balance) {

            cout << "You have withdrawn $" << fixed << setprecision(2) << wAmount << " from your account.\n\n";
            acc1Balance -= wAmount;

        }

    }

    else if (accountSession == 2) {

       if (wAmount > acc2Balance)
            cout << "You can not withdraw more money than you have available in your account.\n\n";

        else if (wAmount < acc2Balance) {

            cout << "You have withdrawn $" << fixed << setprecision(2) << wAmount << " from your account.\n\n";
            acc2Balance -= wAmount;

        }

    }

    else
        cout << "Error processing transaction.\n\n";

    checkBalance (accountSession, acc1Balance, acc2Balance);

}

//  This function is used to handle deposits into the user's account
void deposit (int accountSession, double & acc1Balance, double & acc2Balance) {

    double depAmount;
    cout << "Please enter the amount of the deposit: "; cin >> depAmount; cout << endl;

    calcDeposit (accountSession, acc1Balance, acc2Balance, depAmount);

    if (accountSession == 1 && acc1Balance > 4500)
       calcDeposit(acc1Balance);

    else if (accountSession == 2 && acc2Balance > 4500)
        calcDeposit(acc2Balance);

    checkBalance (accountSession, acc1Balance, acc2Balance);

}

//  This function adds the deposit amount to the current balance
void calcDeposit (int accountSession, double & acc1Balance, double & acc2Balance, double depAmount) {

    if (accountSession == 1)
       acc1Balance += depAmount;

    else if (accountSession == 2)
        acc2Balance += depAmount;

}

// this function adds an extra 3% to the suer's account if their balance goes over $4500
double calcDeposit (double & balance) {

    balance *= 1.03;

    return balance;

}

// this function displays the "closing time" information
void closingTime (double acc1Balance, double acc2Balance, int ACC_1_PIN, int ACC_2_PIN) {

    cout << "Closing time...\n"
         << "Final balances.\n\n"
         << "PIN: " << ACC_1_PIN << "\tBalance: " << fixed << setprecision(2) << acc1Balance << endl
         << "PIN: " << ACC_2_PIN << "\tBalance: " << fixed << setprecision(2) << acc2Balance << "\n\n";

}