Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int pin[4]; //pin
- int ver_pin[4];
- int x;
- int menu(){ // this function will call all other function to be executed in main function
- cout <<"\n---------+HONEY BANK+--------"<< endl;
- cout <<" [1] New User" << endl;
- cout <<" [2] Old User" << endl;
- cout <<"-----------------------------"<< endl;
- cout << "Select User type: ";
- cin >> x;
- if(x==1){
- new_User(); // calling function new_User
- }
- if(x==2){
- old_User(); // calling function old_User
- }
- }
- int new_User(){
- system("cls");
- cout <<"***New User Registered***" << endl;
- cout << "\nEnter PIN: ";
- for(int i = 0; i < 1; i++){
- cin >> pin[i]; // save inputed value on pin array memory location 0
- }
- cout << "\nVerify your Pin"<< endl;
- cout << "\nEnter new PIN again: ";
- for( int i = 0; i < 1; i++){
- cin >> ver_pin[i]; // also will save inputed value on ver_pin array memory location 0
- }
- if(pin[0] == ver_pin[0]){
- cout << "You're now validated!" << endl;
- }
- else{
- cout << "Opsss! Error\nReturning to Menu" << endl;
- return menu(); // returning on function menu :: in short program will restart if [false]
- }
- }
- int old_User(){
- system("cls");
- cout <<"***Log in User***" << endl;
- cout <<"Enter PIN: " << endl;
- for(int i = 0; i = < 2; i++){
- cin >> pin[i];
- }
- if(pin[1] == pin[0] && pin[1] == ver_pin[0]){
- cout << "Account Aunthecation Successful!" << endl;
- }
- }
- int main(){
- menu();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement