Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int pin, new_p, x, y, npin, upin, userin, val, a, b, c, d;
- int pin4all[100];
- int new_User();
- int choice();
- int old_User();
- int return_Menu();
- int refresh_Time(){
- }
- int choice(){
- cout << "PIYUTEK BANK\n" << endl;
- cout << " [1] New User\n [2] Registered User" << endl;
- cout << "\n----------------------------------" << endl;
- cout << "Select user type: ";
- cin >> userin;
- if(userin == 1){
- new_User();
- }
- else{
- old_User();
- }
- }
- int new_User(){
- cout << "\n-------REGISTERING NEW USER-------" << endl;
- cout << "Register your pin: ";
- cin >> pin;
- cout << "\n** You're now registered! **\n" << endl;
- cout << "----------------------------------" << endl;
- cout << "Enter now your pin: ";
- cin >> npin;
- if(pin == npin){
- system("cls");
- cout << "PIN NUMBER: " << npin << endl;
- if(pin==npin){
- cout << "\nPin verification: YES" << endl;
- }
- else{
- cout << "\nPin verification: NO" << endl;
- }
- cout << "\nSELECT PROCESS:\n" << endl;
- cout << " [1] Withdraw"<< endl;
- cout << " [2] Balance Inquiry"<< endl;
- cout << " [3] Change Pin" << endl;
- cout << " [4] Validate" << endl;
- cout << "\n----------------------------------" << endl;
- cout << "Choose process number you wish to perform: ";
- cin >> x;
- }
- else{
- cout << "Error! your pin doesn't match." << endl;
- }
- if (x==1){
- system("cls");
- cout <<" Wala pang Function!" << endl;
- }
- if (x==2){
- system("cls");
- cout << " Wala pang Function! " << endl;
- }
- if (x==3){
- system("cls");
- cout << "-------Changing Pin-------\n" << endl;
- cout << "You're now changing your pin: ";
- cin >> upin;
- upin == npin;
- system("cls");
- cout << "---------PIN CHANGED--------" << endl;
- cout << "\nSuccess! your new pin now is " << upin << endl;
- cout << "\n----------------------------\nChoose process you wish to proceed." << endl;
- cout << "1. Return to Main Menu" << endl;
- cout << "2. Back" << endl;
- cout << "3. Exit" << endl;
- cin >> y;
- if (y==1){
- system("cls");
- return choice();
- }
- if (y==2){
- system("cls");
- cout << "You're now exiting this program.";
- return 0;
- }
- }
- if (x==4){
- system("cls");
- cout << "You are now going to validate your pin." << endl;
- cout << "Validate pin." << endl;
- cout << "\n----------------------------------" << endl;
- cout << "[1] Yes" << endl;
- cout << "[2] No" << endl;
- cout << "----------------------------------" << endl;
- cout << "\n----------PIN VALIDATING----------" << endl;
- cin >> val;
- if(pin==npin && val==1){
- system("cls");
- cout << "Success! your pin is now Validated." << endl;
- }
- if(pin!=npin || val==2){
- system("cls");
- cout << "Error! your pin don't match." << endl;
- }
- cout << "------------------------------\nChoose process you wish to proceed." << endl;
- cout << "1. Return to Main Menu" << endl;
- cout << "2. Back" << endl;
- cout << "3. Exit" << endl;
- cin >> y;
- if (y==1){
- system("cls");
- return choice();
- }
- if (y==2){
- system("cls");
- cout << "You're now exiting this program.";
- return 0;
- }
- return choice();
- }
- }
- int return_Menu(){
- }
- int old_User(){
- cout <<"Welcome back my dear customer!" << endl;
- cout << "Enter your pin: ";
- cin >> npin;
- system("cls");
- cout << "## SELECT PROCESS ##" << endl;
- cout << "[1] Withdraw"<< endl;
- cout << "[2] Balance Inquiry"<< endl;
- cout << "[3] Change Pin" << endl;
- cout << "[4] Validate" << endl;
- cout << "Choose process number: ";
- cin >> x;
- if (x==1){
- system("cls");
- cout<<" Wala pang Function!" << endl;
- cout<<" ";
- }
- if (x==2){
- system("cls");
- cout << " Wala pang Function! " << endl;
- cout << " ";
- }
- if (x==3){
- system("cls");
- cout << "Changing Pin" << endl;
- cout << "You're now changing pin: ";
- cin >> upin;
- upin == npin;
- cout << "Your new pin now is " << upin << endl;
- cout << "****************************" << endl;
- cout << "----------------------------\nChoose process you wish to proceed." << endl;
- cout << "1. Return" << endl;
- cout << "2. Exit" << endl;
- cin >> y;
- if (y==1){
- system("cls");
- return choice();
- }
- if (y==2){
- system("cls");
- cout << "You're now exiting this program.";
- return 0;
- }
- }
- if(x==4){
- system("cls");
- if(pin==npin)
- {
- system("cls");
- cout << "Congratulations! You're now Validated." << endl;
- }
- else{
- system("cls");
- cout << "Error! your pin don't match!" << endl;
- }
- cout << "------------------------------\nChoose process you wish to proceed." << endl;
- cout << "1. Return" << endl;
- cout << "2. Exit" << endl;
- cin >> y;
- if (y==1){
- system("cls");
- return main();
- }
- if (y==2){
- system("cls");
- cout << "You're now exiting this program.";
- return 0;
- }
- }
- }
- int main(){
- choice();
- bool(true){
- return return_Menu();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement