Question

In: Computer Science

Write a complete C++ program that prompts the user for the price of the prix fixe...

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.)

Solutions

Expert Solution

#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


Related Solutions

Write a complete C++ program that prompts the user for and takes as input, numbers until...
Write a complete C++ program that prompts the user for and takes as input, numbers until the user types in a negative number. the program should add all of the numbers together. Then if the result is less than 20 the program should multiply the result by 3, otherwise subtract 2 from the result. Finally, the program should printout the result.
write this program in C++ Write a program that prompts a user for three characters. The...
write this program in C++ Write a program that prompts a user for three characters. The program must make sure that the input is a number 10 - 100 inclusive. The program must re prompt the user until a correct input is entered. Finally output the largest and the lowest value. Example 1: Input : 10 Input : 20 Input : 30 The largest is 30. The lowest is 10. Example 2: Input : 100 Input : 50 Input :...
Please Write C++ PROGRAM : That will write a program that initially prompts the user for...
Please Write C++ PROGRAM : That will write a program that initially prompts the user for a file name. If the file is not found, an error message is output, and the program terminates. Otherwise, the program prints each token in the file, and the number of times it appeared, in a well formatted manner. To accomplish all this, do the following: - Open the file - the user must be prompted and a file name input. DO NOT hardcode...
Write a C++ Program Write a program that prompts the user to input a string. The...
Write a C++ Program Write a program that prompts the user to input a string. The program then uses the function substr to remove all the vowels from the string. For example, if str=”There”, then after removing all the vowels, str=”Thr”. After removing all the vowels, output the string. Your program must contain a function to remove all the vowels and a function to determine whether a character is a vowel. You must insert the following comments at the beginning...
Write a C++ program that prompts the user for the radius of a circle and then...
Write a C++ program that prompts the user for the radius of a circle and then calls inline function circleArea to calculate the area of that circle. It should do it repeatedly until the user enters -1. Use the constant value 3.14159 for π Sample: Enter the radius of your circle (-1 to end): 1 Area of circle with radius 1 is 3.14159 Enter the radius of your circle (-1 to end): 2 Area of circle with radius 2 is...
Write a program in C that prompts the user for a number of seconds and then...
Write a program in C that prompts the user for a number of seconds and then converts it to h:m:s format. Example: 5000 seconds should display as 1:23:20 (1 hour, 23 minutes, 20 seconds.) Test with several values between about 100 seconds and 10,000 seconds. use unint and remainders for this and keep it as simple as possible.
C++ Question: write a program that prompts the user for the length and width of a...
C++ Question: write a program that prompts the user for the length and width of a rectangle in inches.  The program then uses functions to compute the perimeter and area of the rectangle and to convert those to meters and square meters respectively. Sample output from one instance of the program is shown below: ```html Welcome to the Foot-To-Meter Rectangle Calculator ================================================= Enter the rectangle length in feet: 2 Enter the rectangle width in feet: 3 The rectangle dimensions are: 0.61...
IN C++ Write a program that prompts the user to enter the number of students and...
IN C++ Write a program that prompts the user to enter the number of students and each student’s name and score, and finally displays the student with the highest score (display the student’s name and score). Also calculate the average score and indicate by how much the highest score differs from the average. Use a while loop. Sample Output Please enter the number of students: 4 Enter the student name: Ben Simmons Enter the score: 70 Enter the student name:...
(C++) Write a program that prompts the user for the length of one side of a...
(C++) Write a program that prompts the user for the length of one side of a triangle and the sizes of the two adjacent angles in degrees and then displays the length of the two other sides and the size of the third angle.
Write a program in C that reads prompts the user for a positive integer and then...
Write a program in C that reads prompts the user for a positive integer and then prints out that number in base 16, base 8 and base 2.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT