Advertisement
Guest User

Untitled

a guest
Jun 14th, 2018
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.00 KB | None | 0 0
  1. // Example login  program v1 :3
  2. #include <iostream>
  3. #include <string>
  4. using namespace std;
  5. int main(  )
  6. {
  7.   int balance;
  8.   int input_option;
  9.   int input_option_2;
  10.   int withdraw;
  11.   int logout;
  12.   string username;
  13.   string password;
  14.   string input_user;
  15.   string input_pass;
  16.   cout << "enter your balance \n";
  17.   cin >> balance;
  18.   cout << "enter your new username \n";
  19.   cin >> username;
  20.   cout << "enter your new password \n";
  21.   cin >> password;
  22.   // now for the login :3
  23.   cout << "please login \n";
  24.   cin >> input_user;
  25.   if ( input_user == username )
  26.   {
  27.       cout << "enter your password \n";
  28.       cin >> input_pass;
  29.   }  
  30.      if ( input_pass == password )
  31.       {
  32.           cout << "welcome to your account" << endl;
  33.           cout << "would you like to see your balance?" << endl;
  34.           cout << "1 for yes, 0 for no" << endl;
  35.           cin >> input_option;
  36.           if ( input_option > 1 )
  37.           {
  38.               cout << balance << endl;
  39.               cout << "would you like to withdraw? 1 for yes, 0 for no" << endl;
  40.               cin >> input_option_2;
  41.               if ( input_option_2 > 1 )
  42.               {
  43.                   cout << "How much would you like to withdraw?";
  44.                   cin >> withdraw;
  45.                   cout << "your new balance is now", withdraw - balance << endl;
  46.                 if ( withdraw - balance < 0 )
  47.                 {
  48.                     cout << "you are now in debt you owe us", withdraw - balance << endl;
  49.                 }
  50.                 else
  51.                 {
  52.                     cout << "you are not in balace have a nice day" << endl;
  53.                 }
  54.               else
  55.               {
  56.                   cout << "have a nice day" << endl;
  57.                   return 0;
  58.               }          
  59.           else
  60.           {
  61.               cout << "have a nice day" << endl;
  62.               return 0;
  63.           }
  64.               }
  65.       else
  66.       {
  67.           cout << "sorry your login details are wrong";
  68.       }
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement