Facebook
From Sexy Dove, 4 Years ago, written in C++.
Embed
Download Paste or View Raw
Hits: 128
  1. #include<iostream>
  2. #include<cstring>
  3. using namespace std;
  4.  
  5. main(){
  6.         char fixedPwd[]="zxc";
  7.         char username[50]={0};
  8.         char pass[50]={0};
  9.         char name[50]={0};
  10.         char position[50]={0};
  11.         char s1[100]={0};
  12.         char s2[100]={0};
  13.         char choice;
  14.         char retry;
  15.         int matchpass;
  16.        
  17.         cout<<"SAVVY TECH COMPANY"<<endl;
  18.         cout<<"==============================="<<endl;
  19.        
  20.         cout<<"Enter your user name: ";
  21.         gets(username);
  22.         cout<<"Enter you password: ";
  23.         gets(pass);
  24.        
  25.         matchpass=strcmp(fixedPwd,pass);
  26.        
  27.         if(matchpass==0){
  28.         cout<<"Successfully Login!!!"<<endl;
  29.         cout<<"=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-="<<endl;
  30.         cout<<"MAIN MENU"<<endl;
  31.         cout<<"=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-="<<endl;
  32.         cout<<"A- Registrationof employee's record"<<endl;
  33.         cout<<"B- Not yet implemented"<<endl;
  34.         cout<<"Choice: ";
  35.         cin>>choice;   
  36.        
  37.         switch(choice){
  38.                 case'A':case'a':
  39.                     while(1){
  40.                         if(retry=='Y' || retry=='y'){
  41.                                 cout<<"--------------------------------"<<endl;
  42.                                 cout<<"Registrationof employee's record"<<endl;
  43.                             cout<<"==Employee's Record=="<<endl;
  44.                             cout<<"Enter name: ";
  45.                             gets(name);
  46.                             cin.getline(name,50);
  47.                             cout<<"Enter a position: ";
  48.                             gets(position);
  49.                             cout<<"Do you want to add more record?: ";
  50.                             cin>>retry;
  51.                             strcat(s1," ");
  52.                             strcat(s1,name);
  53.                             cout<<s1<<" "<<endl;
  54.                                 }else if(retry=='N' || retry=='n'){
  55.                                     cout<<"--------------------------------"<<endl;
  56.                                     cout<<"==Employee's Record=="<<endl;
  57.                                     strcat(s2,s1);
  58.                                     cout<<"Summary list of employees name is: "<<strlen(s1)<<endl;
  59.                                     break;
  60.                                 }else{
  61.                                         cout<<"Incorrect Input!"<<endl;
  62.                                         cout<<"Do you want to add more record?";
  63.                                         cin>>retry;
  64.                                 }
  65.                 }
  66.                 break;
  67.                 default:cout<<"Not yet implemented!"<<endl;
  68.                 break;
  69.        }
  70.     }else{
  71.         cout<<"Incorrrect Password. You are not allowed to access this program!"<<endl;
  72.         cout<<"Program Terminated........."<<endl;
  73.         }
  74. }
  75.