+ 1
need help in writing this please help
A program contains a class HOTEL with the following members: Private members: Rno //data member to store Room No Name //Data member to store customer name Tariff //Data member to store per dat charge NOD // Data membe to store Number of days CALC //a function to calculate and return smount as NOD*Tariff and if the value of NOD*Tariff is more thaan 10000 then as 1.05*NOD*Tariff Public members: Checkin()//a function to enter the content Rno,Name,Tariff and NOD Checkout()//a function to display RNO,Name,Tariff,NOD and Amount (Amount to be displayed by calling function CALC() Write a program in C++ that would be used to declare the class.
3 Antworten
+ 4
Do one thing , create a basic structure by yourself and then , post here , we will rectify the problems, creating direct a full program is time consuming and annoying, just creat basics program and then come back
+ 2
class HOTEL
{
int Rno;
char Name[50];
float Tariff; be home
int NOD;
float CALC(float a,int b)
{
if((a*b)<10000)
return a*b;
else
return 1.05*a*b;
}
public:
void Checkin()
{
cin>>Rno;
gets(Name);
cin>>Tariff>>NOD;
}
void Checkout()
{
cout<<Rno;
puts(Name);
cout<<Tariff<<NOD;
CALC(Tariff, NOD);
}
};
## INSTRUCTIONS:: Date specifiers may be change according to the requirements of the code and character can be converted to string(like i did)......
Hope you understand this and if you have any doubt please let me know......✌️
0
Thanks i had written the code but I see now where the problem is through your code. I now understand the code.