| Paste number 52356: | code |
| Pasted by: | Mac5 |
| 8 months, 3 weeks ago | |
| #dylan | Context in IRC logs | |
| Paste contents: |
| /*Final Exam Hands-On Bank program by: Eduardo Cuevas 12/10/1987 */ #include <iostream> #include <fstream> #include <conio.h> #include <iomanip> #include <string> #include <cstdlib> using namespace std; void statement(); int main() { char option; do { system("cls"); //to clear screen cout << " *****************************" << endl; cout << " ********** MAIN MENU ********" << endl; cout << " *****************************" << endl; cout << endl; cout << endl; cout << " a.) Display Statement " << endl; cout << " b.) Write Check " << endl; cout << " c.) Make Deposit " << endl; cout << " x.) Exit " << endl; cout << " Please make your selection >> "; cin >> option; switch (toupper(option)) { case 'A': statement(); break; case 'B': cout << " Writing check...." << endl; case 'C': cout << "Making deposit..." << endl; default: if (toupper (option) !='X') { cout << " Invalid Option, try again! " << endl; getch(); } } } while (toupper (option) !='X'); return 0; } { system("cls"); int num, deposit; char type; float amount; string date; ifstream abd; abd.open("bank.dat"); if (abd.fail()) { cout << "File not found...." << endl; } else { const string STAND = "ABC Bank"; int pad; pad = STAND.lenght(); pad = (80-pad) / 2; cout << setw(pad) <<""; cout << STAND << endl << endl; cout << setw(20) << ""; cout << setw(20) << left << "date"; cout << setw(20) << ""; cout << setfill('-'); cout << setw(40) << ""; cout << setfill(' '); cout << endl; while ( ! abd.eof()) { abd >> date; abd >> num; abd >> amount; abd >> deposit; abd >> balance; getline(abd,date); balance = deposit - amount cout << endl; } getch(); } abd.close(); } |
This paste has no annotations.