ATM program help
My atm program doesn't display the output where I ask for the user's name...
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
|
#include <iostream>
using namespace std;
int main()
{
cout << " /// /// //////// /// //////// //////// /// /// ////////\n";
cout << " /// /// /// /// /// /// /// ////////// ///\n";
cout << " /// // /// /////// /// /// /// /// /// // /// ////////\n";
cout << " ////////// /// /// /// /// /// /// /// ///\n";
cout << " /// /// //////// /////// //////// //////// /// /// ////////\n";
cout << " //////// ////////\n";
cout << " /// /// ///\n";
cout << " /// /// ///\n";
cout << " /// /// ///\n";
cout << " /// ////////\n";
cout << " ////////\n";
cout << " /// /// ///\n";
cout << " /// //////// ////////\n";
cout << " /// /// ///\n";
cout << " ////////\n";
cout << " /////// /// /// /// /// ///\n";
cout << " /// /// /// /// ///// /// /// ///\n";
cout << " //////// //////// /// ///// /////\n";
cout << " /// /// /// /// /// /// /// ///\n";
cout << " /////// /// /// /// /// /// ///\n";
double balance, withdraw, deposit;
balance = 0;
int choice;
string name;
cout << "\n\t\t\t\t Menu";
cout << "\n\n";
cout << "\t\t\t*************************\n";
cout << "\t\t\t* 1. Balance *\n";
cout << "\t\t\t* 2. Deposit *\n";
cout << "\t\t\t* 3. Withdraw *\n";
cout << "\t\t\t* 4. Exit *\n";
cout << "\t\t\t*************************\n\n";
cout << "\t\t\tWhat is your name: ";
cin >> name;
cout << "\t\t\tWhat would you like to do " << name << "?: ";
cin >> choice;
cout << "\n";
while (choice !=4)
{
switch(choice)
{
case 1 : cout << "The current balance in your account is " << balance << endl;
break;
case 2 : cout << "Enter the amount you would like to add to your account: ";
cin >> deposit;
balance = balance + deposit;
cout << "You have entered in " << deposit << endl;
break;
case 3 : cout << "Enter an amount you would like to withdraw: ";
cin >> withdraw;
balance = balance - withdraw;
cout << "You have withdrawn " << withdraw << "from your account.\n";
break;
default: cout << "You have entered a wrong input.\n";
}
cout << "\n What would you like to do next " << name << "?:";
cin >> choice;
}
}
|
Topic archived. No new replies allowed.