Question: 2 . 4 2 LAB * : Program: Pizza party weekend Program Specifications. Write a program to calculate the cost of hosting three pizza parties

2.42 LAB*: Program: Pizza party weekend
Program Specifications. Write a program to calculate the cost of hosting three pizza parties on Friday, Saturday and Sunday. Read from input the number of people attending, the average number of slices per person and the cost of one pizza. Dollar values are output with two decimals. For example, printf("Cost: $%.2f", cost);
Note: this program is designed for incremental development. Complete each step and submit for grading before starting the next step. Only a portion of tests pass after each step but confirm progress.
Step 1(2 pts). Read from input the number of people (int), average slices per person (double) and cost of one pizza (double). Calculate the number of whole pizzas needed (8 slices per pizza). There will likely be leftovers for breakfast. Hint: Use the ceil() function found in the math library to round up to the nearest whole number and convert to an integer. Calculate and output the cost for all pizzas. Submit for grading to confirm 1 test passes.
Ex: If the input is:
10,2.6,10.50
The output is:
Friday Night Party
4 Pizzas: $42.00
Step 2(2 pts). Calculate and output the sales tax (7%). Calculate and output the delivery charge (20% of cost including tax). Submit for grading to confirm 2 tests pass.
Ex: If the input is:
10,2.6,10.50
2 . 4 2 LAB * : Program: Pizza party weekend

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!