1. For special event bookings, a buffet restaurant charges a fixed price of $21.59 per person...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
1. For special event bookings, a buffet restaurant charges a fixed price of $21.59 per person but offers a discount for large groups. The amount of the discount depends on the size of the group. Develop an algorithm and write the C code for a program that will compute the total bill including the discount based on the number of people in indicated at the time of booking. 2. User is prompted to enter the number of people (an integer value). The program must then calculate the total bill as #people * 21.59 - discount where the discount is based on the number of people as indicated below. Use appropriate variable types. 3. Program will compute the discount amount subtracted from the bill based on the following: Number of People Discount 1-2 3-4 5-8 Greater than 8 $0 $30 $50 $80 4. E.g., for 8 people, the bill amount before the discount is 8 * 21.59 ($172.72). The discount amount is $50. The final bill amount (with the discount) is $172.72 - $50 = $122.72. Be mindful of data type. 5. The program should display number of people, the bill amount before the discount, the discount amount, and the final bill amount (the bill amount minus the discount amount) as shown below. Note the right-alignment of the amounts. All dollar amounts displayed should be in dollars and cents (float point numbers with two decimal places shown). If the discount is $0, the discount and bill amount lines should not be displayed. In this case, only # People Served and Final Bill Amount. # People Served: 8 Bill Amount: $ 172.72 Discount Amount: $ 50.00 Final Bill Amount: $ 122.72 1. For special event bookings, a buffet restaurant charges a fixed price of $21.59 per person but offers a discount for large groups. The amount of the discount depends on the size of the group. Develop an algorithm and write the C code for a program that will compute the total bill including the discount based on the number of people in indicated at the time of booking. 2. User is prompted to enter the number of people (an integer value). The program must then calculate the total bill as #people * 21.59 - discount where the discount is based on the number of people as indicated below. Use appropriate variable types. 3. Program will compute the discount amount subtracted from the bill based on the following: Number of People Discount 1-2 3-4 5-8 Greater than 8 $0 $30 $50 $80 4. E.g., for 8 people, the bill amount before the discount is 8 * 21.59 ($172.72). The discount amount is $50. The final bill amount (with the discount) is $172.72 - $50 = $122.72. Be mindful of data type. 5. The program should display number of people, the bill amount before the discount, the discount amount, and the final bill amount (the bill amount minus the discount amount) as shown below. Note the right-alignment of the amounts. All dollar amounts displayed should be in dollars and cents (float point numbers with two decimal places shown). If the discount is $0, the discount and bill amount lines should not be displayed. In this case, only # People Served and Final Bill Amount. # People Served: 8 Bill Amount: $ 172.72 Discount Amount: $ 50.00 Final Bill Amount: $ 122.72
Expert Answer:
Related Book For
Financial Accounting
ISBN: 978-0078025549
3rd edition
Authors: J. David Spiceland, Wayne Thomas, Don Herrmann
Posted Date:
Students also viewed these programming questions
-
can someone solve this Modern workstations typically have memory systems that incorporate two or three levels of caching. Explain why they are designed like this. [4 marks] In order to investigate...
-
Complete task A and task B by reading MyBank Retail Customer Services Functional Specification Document MyBank Retail Customer Services Functional Specification Introduction MyBank has grown to...
-
Listing 8.4 checks whether a solution is valid by checking whether every number is valid in the board. Rewrite the program by checking whether every row, every column, and every small box has the...
-
Hillary sells cosmetics from her part-time home-based business. She receives a straight commission of 21% from her supplier. At the year-end, she also receives a 7% bonus on sales exceeding her...
-
The May 31 bank statement of Family Services Association (FSA) has just arrived from Scotia bank. To prepare the FSA bank reconciliation, you gather the following data: a. FSA's Cash account shows a...
-
Is the use of AI technology for work automation ethical? Why or why not?
-
Silven Company has identified the following overhead activities, costs, and activity drivers for the coming year: Silven produces two models of cell phones with the following expected activity...
-
11. Explain how each parameter in the equation below affects the graph of the parent function. Include which parameters affect the domain and/or range. f(x)=a-bx-h) + k
-
You work for a large health food marketer, and you are responsible for the cereal line. One of your products is Raisin Bran which comes in a 20-ounce box and currently sells at the retail level for...
-
Discuss the consumer analysis that identify the target market and how the company will meet the needs of the consumers in a competitively superior way.
-
The perspectives of a production manager and a mailroom clerk regarding the meaningfulness of their work. The production manager's role necessitates a diverse and highly valued set of skills and...
-
how the job characteristics interact with each other in this model. If someone's job is completely lacking in autonomy (or feedback), regardless of levels of variety, identity, and significance, the...
-
A call center technical specialist spends varying amount of time in each call to resolve the concern. The time spent in each call is modeled using the following distribution: X~ Exp (0.2). Find the...
-
Compare the payment system between U.S. and Japan Please explain and use valid points paragraph format use examples
-
What seven important functions does Congress perform?
-
Fill in each blank so that the resulting statement is true. 83 + 103 = ______ .
-
Correlation between height and weight for players on the 2014 Brazil World Cup Team, using data from all 23 players on the roster. State whether the quantity described is a parameter or a statistic...
-
In Example 4.1, \(X\) is the current measured in milliamperes. What is the expected value of power when the resistance is 100 ohms?
-
Data 2.7 on page 95 introduces the dataset HollywoodMovies, which contains information on more than 900 movies that came out of Hollywood between 2007 and 2013. One of the variables is the budget (in...
Study smarter with the SolutionInn App