Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Example login program v1 :3
- #include <iostream>
- #include <string>
- using namespace std;
- int main( )
- {
- int balance;
- int input_option;
- int input_option_2;
- int withdraw;
- int logout;
- string username;
- string password;
- string input_user;
- string input_pass;
- cout << "enter your balance \n";
- cin >> balance;
- cout << "enter your new username \n";
- cin >> username;
- cout << "enter your new password \n";
- cin >> password;
- // now for the login :3
- cout << "please login \n";
- cin >> input_user;
- if ( input_user == username )
- {
- cout << "enter your password \n";
- cin >> input_pass;
- }
- if ( input_pass == password )
- {
- cout << "welcome to your account" << endl;
- cout << "would you like to see your balance?" << endl;
- cout << "1 for yes, 0 for no" << endl;
- cin >> input_option;
- if ( input_option > 1 )
- {
- cout << balance << endl;
- cout << "would you like to withdraw? 1 for yes, 0 for no" << endl;
- cin >> input_option_2;
- if ( input_option_2 > 1 )
- {
- cout << "How much would you like to withdraw?";
- cin >> withdraw;
- cout << "your new balance is now", withdraw - balance << endl;
- if ( withdraw - balance < 0 )
- {
- cout << "you are now in debt you owe us", withdraw - balance << endl;
- }
- else
- {
- cout << "you are not in balace have a nice day" << endl;
- }
- else
- {
- cout << "have a nice day" << endl;
- return 0;
- }
- else
- {
- cout << "have a nice day" << endl;
- return 0;
- }
- }
- else
- {
- cout << "sorry your login details are wrong";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement