Advertisement
Guest User

Untitled

a guest
Mar 30th, 2015
267
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.83 KB | None | 0 0
  1.     #include <iostream>
  2.     using namespace std;
  3.     //Functions
  4.     void mainMenu();
  5.     char mainMenuChoiceF();
  6.     float login();
  7.     void loginMenu();
  8.     int depositAmount();
  9.     int withdrawAmount();
  10.     void displayAmount();
  11.     int createAccount();
  12.  
  13.     //Global Variables
  14.     char mainMenuChoice;
  15.     int username;
  16.     int password;
  17.  
  18.     int main()
  19.     {
  20.         mainMenu();
  21.         cin >> mainMenuChoice ;
  22.         mainMenuChoiceF();
  23.  
  24.     }
  25.  
  26.     void mainMenu()
  27.     {
  28.         cout << "Hi! Welcome to Future Computer Programmer ATM MAchine" << endl;
  29.         cout << "Please selsect an option from the menu below: " << endl;
  30.         cout << "l -> Login" << endl;
  31.         cout << "c -> Create New Account" << endl;
  32.         cout << "q -> Quit " << endl;
  33.         cout << "Enter your choice: " << endl;
  34.     }
  35.     char mainMenuChoiceF()
  36.     {
  37.         switch (mainMenuChoice)
  38.         {
  39.         case 'l':
  40.         case 'L':
  41.             login();
  42.             break;
  43.         case 'c':
  44.         case 'C':
  45.             createAccount();
  46.             break;
  47.         case 'q':
  48.         case 'Q':
  49.             cout << "Thanks for stopping by!";
  50.             return 0;
  51.             break;
  52.         default:
  53.             cout << "Invalid Menu Input" << endl;
  54.             return 0;
  55.         }
  56.     }
  57.  
  58.     float login()
  59.     {
  60.         cout << "Please enter your user name: " << endl;
  61.         cin >> username;
  62.         cout << "Please enter your password: " << endl;
  63.         cin >> password;
  64.  
  65.     }
  66.  
  67.     int createAccount()
  68.     {
  69.         cout << "Please enter your user name: " << endl;
  70.         cin >> username;
  71.         cout << "Please enter your password: " << endl;
  72.         cin >> password;
  73.         cout << "The username you entered was " << username <<  "and the password was " << password << endl;
  74.         main();
  75.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement