Thursday, 20 July 2017

program of CLASS OF hotel

#include<iostream.h>
#include<conio.h>
class hOTEL
{
private:
float rno;
char name[10];
float tariff;
int nod;
float calc()
{
float c;
c=nod*tariff;
if(c<10000)
{
return c;
}
else
{
return (c*1.05);
}
}
public:
void ci();
void co();
};
void h::ci()
{
cout<<"enter room no\n";
cin>>rno;
cout<<"enter your name\n";
cin>>name;
cout<<"enter the tarif\n";
cin>>tariff;
cout<<"enter the no of days\n";
cin>>nod;
}
void h::co()
{
int D;
cout<<"romm no is "<<rno<<"\n";
cout<<" name is "<<name<<"\n";
cout<<" tariif is"<<tariff<<"\n";
cout<<" number of days are "<<nod<<"\n";
D=calc();
cout<<" your total amount is "<<D<<"\n";
}
void main()
{
clrscr();
h h1;
h1.ci();
h1.co();
getch();
}

No comments:

Post a Comment