In: Computer Science
Write a complete C++ program that prompts the user for the price of the prix fixe menu choice. The program should then prompt the user for the number of guests in the party. The program should then calculate the bill including tax and tip then print the results to the console in the form of a receipt
For C++ Programming (I need it for C++ without using importing from java.)
#include <iostream>
#include <iomanip>
using namespace std;
int main ()
{
//Declaring variables
int no_of_guests;
double
taxrate,totalBill_incl_tip,tax,tipAmount,billAmtExclTax;
//Displaying the menu
cout<<"\t______________________________________________"<<endl;
cout<<"\n\t\t\tPrix Fixe Menu"<<endl;
cout<<"\t______________________________________________"<<endl;
cout<<endl<<"\t\t\t30$"<<endl;
cout<<"\t\t3 Course meal"<<endl;
cout<<endl;
cout<<"\t\t\tAPPETIZER"<<endl;
cout<<setw(5)<<"\n\tgarden salad with choice
dressing"<<endl;
cout<<"\t\tHoney Mustard , ranch"<<endl;
cout<<setw(5)<<"\tChicken cream soup with baked
bread"<<endl;
cout<<"\t\tSourdough or Wheat"<<endl;
cout<<endl;
cout<<"\t\t\tMAIN"<<endl;
cout<<"\n\t\tBoz Prime rb"<<endl;
cout<<setw(5)<<"\tserved with loaded baked
potato"<<endl;
cout<<"\t\tpecan chicken"<<endl;
cout<<setw(5)<<"\tlapped with sugared - Decans seasonal
Vegitables"<<endl;
cout<<endl;
cout<<"\t\t\tDESSERT"<<endl;
cout<<"\n\t\t\tChocolate Cake"<<endl;
cout<<"\t\t\tNut cake "<<endl;
cout<<"\tSeasonal fruit cake with a side of fresh
fruit"<<endl;
cout<<"\t______________________________________________"<<endl;
//getting the inputs entered by the user
cout<<"\n\nEnter the no of guests in the party :";
cin>>no_of_guests;
cout<<"Enter the rate of tax :%";
cin>>taxrate;
cout<<"Enter tip amount :$";
cin>>tipAmount;
//calculating the bill excluding tax
billAmtExclTax=no_of_guests*30;
//Calculating the tax amount
tax=billAmtExclTax*(taxrate/100);
//Calculating the total bill
totalBill_incl_tip=billAmtExclTax+tax+tipAmount;
//Sertting the precision
std::cout << std::setprecision(2) << std::fixed;
//Displaying the bill
cout<<"\n\n\t_____________________________________________"<<endl;
cout<<endl<<endl<<setw(30)<<"Bill"<<endl;
cout<<"\t_____________________________________________"<<endl;
cout<<"\tAmount for "<<no_of_guests<<" people is
"<<setw(14)<<billAmtExclTax<<"
$"<<endl;
cout<<"\tTax Rate @
"<<taxrate<<"%"<<setw(21)<<tax<<"
$"<<endl;
cout<<"\tTip Amount
"<<setw(24)<<tipAmount<<" $"<<endl;
cout<<"\t_____________________________________________"<<endl;
cout<<"\n\tTotal
Amount"<<setw(26)<<totalBill_incl_tip<<"
$"<<endl;
cout<<"\t_____________________________________________"<<endl;
return 0;
}
______________________
output:

_____________Thank You