t.ill T-Mobile 10:45 PM 95%-iii), + Done Casewell-Pointers.cp #include #include using namespace std; int main() //Symbolic Meanings //ad = Adult Non-Desserts //dess = Dessert Cost //rm Room Fee //taxa Tax and Tip Sum //afd = Adult Food //alSum of Child and Adult meals //cd = Children Non-Dessert //ta = Total Adult Food Cost //tc = Total Children Food Cost //td = Total Dessert Cost //t = Total without deposit //ptt = Tax and tip Rate (%) /dpt = Deposit /bal Balance int adult, child float ad, dess, rm, cd, ta, taxa, tc, td, t, ptt, all, dpt, bal; cout
Expert Answer
#include<iostream>//input output streaam header file
#include<iomanip>//input output mainpulation file like setw
using namespace std;
class Dessert
{
int adult,child;
float ad,dess,rm,cd,ta,taxa,tc,td,t,ptt,all,dpt,bal;
/*ad Adult non desserts
dess = desert cost
rm room rent
taxa tax and tip sum
afd adult food
all sum of child and adult meals
ta total adult food
tc total child food
td total dessert food
t total without deposit
ptt tax and tip rate %
dpt deposit ammount
bal balance amount
*/
public:
void input(); //taking inputs through memeber function
void calc(); //calucate all the items
void output(); //display the bill
};
void Dessert::input()
//defination of input function
{
cout<<“for every number input press[enter]”;
cout<<endl<<“how many adults are attending”;
cin>>adult;
cout<<endl<<“How many childrens are attending”;
cin>>child;
cout<<endl<<“what is the cost of an adult with out dessert”;
cin>>ad;
cout<<endl<<“what is the cost per desset”;
cin>>dess;
cout<<“what is the room free”;
cin>>rm;
cout<<endl<<“what is the tip and tax rate(with decimal)”;
cin>>ptt;
cout<<endl<<“how much did you deposit”;
cin>>dpt;
}
void Dessert::calc()
{
//all caluclations
cd=0.6*ad;
ta=adult*ad;
tc=cd*child;
td=dess*(adult+child);
all=ta+tc+td;
taxa=all*ptt;
t=rm+taxa+all;
bal=t-dpt;
}
void Dessert::output()
{
//display menu
//setw is set width position
cout.setf(ios::showpoint);
cout<<fixed<<setprecision(2);
cout<<endl<<setw(15)<<“Caswell Catering and convention Service”<<endl;
cout<<endl<<setw(21)<<“FINAL BILL”<<endl;
cout<<setw(31)<<“Number of Adults”<<setw(12)<<adult<<endl;
cout<<setw(31)<<“Number of childrens”<<setw(12)<<child<<endl;
cout<<“Cost per adult with out desert”<<setw(8)<<ad<<endl;
cout<<“Cost per chaild with out dessert”<<setw(8)<<cd<<endl;
cout<<setw(31)<<“Cost per dessert”<<setw(5)<<“$”<<setw(8)<<dess<<endl;
cout<<setw(31)<<“Room fee”<<setw(5)<<“$”<<setw(8)<<rm<<endl;
cout<<setw(31)<<“Tip and tax rate”<<setw(5)<<“%”<<setw(8)<<ptt<<endl;
cout<<setw(31)<<“Total cost for Adult Meals”<<setw(5)<<setw(8)<<ta<<endl;
cout<<setw(31)<<“Total cost for Child Meals”<<setw(5)<<setw(8)<<td<<endl;
cout<<setw(31)<<“Total food cost”<<setw(5)<<setw(8)<<all<<endl;
cout<<setw(31)<<“Plus Tip and Tax”<<setw(5)<<setw(8)<<taxa<<endl;
cout<<setw(31)<<“Plus Room Fee”<<setw(5)<<setw(8)<<rm<<endl;
cout<<setw(36)<<“$”<<setw(8)<<t<<endl;
cout<<setw(44)<<“————-“<<endl;
cout<<setw(36)<<“$”<<setw(8)<<t<<endl;
cout<<setw(31)<<“Less Deposit”<<setw(5)<<“$”<<setw(8)<<dpt<<endl;
cout<<setw(44)<<“————-“<<endl;
cout<<setw(31)<<“Balance Due”<<setw(5)<<“$”<<setw(8)<<bal<<endl;
}
int main()//main program
{
Dessert d; //create dessert object
d.input();//call input member function
d.calc();//call calc member function
d.output();//call output member function
}