viewing paste Cpp Hotel | Text

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105
#include <iostream>
#include <conio.h>
#include <time.h>
using namespace std;
 
main()
{
char name[25],address[50];
int inmonth,inday,room,outmonth,outday,contactno;
string user,pass;
 
for(int atmp=0;atmp >-3;atmp--){
        cout<<"Attempt(s): "<<atmp+3<<endl<<endl;
        cout<<"Username: ";
        cin>>user;
        cout<<"Password: ";
        cin>>pass;
        
        if((user == "group2")||(pass=="adminpass")){
        
        break;
        }
        else{
             cout<<"Wrong Password"<<endl<<endl;
             }
             if(atmp == -2){
                     cout<<"Exiting Program.... To many attempts";
                     getch();
                     return 0;
                     }
}
 
system("cls");    
cout<<"\t\tLogin Approved!!!!"<<endl<<endl;
             
cout<<"         Hotel Reservation        \n\n";
cout<<"Please Enter Costumer Name: ";
cin.getline(name,sizeof(name));
cin.getline(name,sizeof(name));
cout<<"Full Address; ";
cin.getline(address,sizeof(address));
cout<<"Contact no.; ";
cin>>contactno;
system("cls");
cout<<"\n1 = January \t| 2 = February \t| 3 = March \t| 4 = April\n";
cout<<"5 = May \t| 6 = June \t| 7 = July \t| 8 = August\n";
cout<<"9 = September \t| 10 = October \t| 11 = November\t| 12 = December\n";
cout<<"Enter The (no.)Month of Reservation: ";
cin>>month;
if ((month>=13)||(month<=0)){
cout<<"\n\n\t\t\tInvalid Input";
getch();
return 0;
}
system("cls");
if ((month == 1)||(month == 3)||(month == 5)||(month == 7)||(month == 8)||(month == 10)||(month == 11)){
    
    cout<<"Enter Day (1-31): ";
cin>>day;
if ((day<=0)||(day>=32)){
    cout<<"Invalid Input";
    getch();
return 0;
        }
}
else if (month == 2){
    cout<<"Enter Day (1-28/29): ";
cin>>day;
if ((day<=0)||(day>=30)){
    cout<<"Invalid Input";
getch();
return 0;
}
}
else
{
cout<<"Enter Day (1-30): ";
cin>>day;
if ((day<=0)||(day>=31)){
    cout<<"Invalid Input";
getch();
return 0;       
}
}
 
system("cls");
cout<<"1 = Class S \t| 2 = Class A \t| 3 = Class B\t|"; 
cout<<"\nRoom Class[no]: ";
cin>>room;
 
//if (room==1){
     
     system("cls");
     cout<<"Cos
             
             
             
 
 
 
getch();
return 0;
 
}
 
Viewed 736 times, submitted by Guest.