/************************************************************************* ACTION 3-2 (ACT03-02.CPP) THIS PROGRAM REPRESENTS THE FLAT SOLUTION TO THE BANKING PROBLEM **************************************************************************/ //PREPROCESSOR DIRECTIVE #include //FOR cin AND cout //DEFINE GLOBAL INTEREST CONSTANT const double INTEREST = 0.01; //CURRENT MONTHLY INTEREST RATE //IN DECIMAL FORM //MAIN FUNCTION int main() { double balance = 0.0; //ACCOUNT BALANCE double deposits = 0.0; //MONTHLY DEPOSITS double withdrawals = 0.0; //MONTHLY WITHDRAWALS cout << "This program will generate a banking account report based" << "on information entered by the user" << endl << endl; //readData(): GET THE MONTHLY ACCOUNT INFORMATION FROM THE USER cout << "Enter the account balance: $"; cin >> balance; cout << "Enter the deposits this month: $"; cin >> deposits; cout << "Enter the withdrawals this month: $"; cin >> withdrawals; //addDeposits(): ADD THE MONTHLY DEPOSITS TO THE ACCOUNT BALANCE balance = balance + deposits; //subtractWithdrawals(): SUBTRACT THE MONTHLY WITHDRAWALS balance = balance - withdrawals; //addInterest(): ADD MONTHLY INTEREST balance = balance + (balance * INTEREST); //FORMAT OUTPUT IN DOLLARS AND CENTS cout.setf(ios::fixed); cout.setf(ios::showpoint); cout.precision(2); //generateReport(): DISPLAY THE MONTHLY ACCOUNT REPORT cout << "The account balance is currently: $" << balance << endl; cout << "Deposits were $" << deposits << endl; cout << "Withdrawals were $" << withdrawals << endl; //RETURN return 0; } //END main()