viewing paste Unknown #21490 | 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
#include <iostream>
#include <conio.h>
#include <time.h>
using namespace std;
 
int main()
{
char name[25];
int month,day,year,leap,room;
 
cout<<"         Hotel Reservation        \n\n";
cout<<"Please Enter Your Name: ";
cin.getline(name,sizeof(name));
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<<"Enter Year: ";
cin>>year;
 
if ((year % 4 == 0)){
    leap = 1;
}
 
if ((month == 1) && (day == 1) && (year == 1)){
cout<<"This date is already past";
getch();
return 0;
}
 
if ((month == 2) && (leap == 0) && (day == 29)){
    cout<<"\n\n\t\tInvalid Input Theres no 29 of Feb. In This Year";
    getch();
return 0;
}
 
system("cls");
cout<<"1 = Room Deluxe\t| 2 = Garage Room \t| 3 = Taxi Room\t|"; 
cout<<"\nRoom Class[no]: ";
cin>>room;
 
 
getch();
return 0;
 
}
Viewed 736 times, submitted by Guest.