using namespace std;
class HOTEL
{
int Rno,NOD;
char Name[30];
double Tariff;
double CALC()
{
float temp=NODTariff;
if(temp>10000)
return(1.05temp);
return temp;
}
public:
void Checkin()
{
cout<<"\nEnter room No. - \n";
cin>>Rno;
printf("\nEnter the Customer Name - \n");
gets(Name);
cout<<"\nEnter the room charges per day - \n";
cin>>Tariff;
cout<<"\nEnter the No. of Days stayed by the customer - \n";
cin>>NOD;
}
void Checkout()
{
cout<<"Room No. - "<<Rno<<endl;
printf("Customer Name - ");
puts(Name);
cout<<"Room Charges per day - "<<Tariff<<endl;
cout<<"No. of Days stayed - "<<NOD<<endl;
cout<<"Total charges of the customer - "<<CALC()<<endl;
}
};
int main()
{
HOTEL H;
H.Checkin();
H.Checkout();
return 0;
}
I’m not able to enter the customer name ,other than that the whole program is running fine. please suggest corrections and reason.