Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program for calculating the bill charged for a Chinese dim sum lunch. It accepts the following user's inputs (in order): (1) number of

image text in transcribedimage text in transcribed

Write a program for calculating the bill charged for a Chinese "dim sum" lunch. It accepts the following user's inputs (in order): (1) number of persons, (2) membership rank (' G ', ' S ', ' B ', 'N'), (3) number of "small" dish, (4) number of "medium" dish, and (5) number of "large" dish. It calculates and prints the final bill according to the charging rules below. Input on number of persons is always positive, while inputs on number of dishes are always non-negative. The membership rank is a character input, where ' G ' stands for "Gold", ' S ' stands for "Silver", 'B' stands for "Bronze", and 'N' stands for "None". Determine the odd or even version of this question using the 6th digit of your student ID number. Price of a dish (in dollars) Cover charge per person Extra discount based on membership rank and number of persons Note that the final bill is subject to a 10% service charge. It is calculated based on the original price, which is the sum of the price of all dishes and the discounted, if applicable, cover charge. Format the output to two decimal places. Sample display IMPORTANT NOTE: You need to follow all text and order as shown in the sample display. There should be NO prompt messages and additional blank lines in the output. DO NOT add extra text in the output which will be considered as incorrect in marking. Write a program for calculating the bill charged for a Chinese "dim sum" lunch. It accepts the following user's inputs (in order): (1) number of persons, (2) membership rank (' G ', ' S ', ' B ', 'N'), (3) number of "small" dish, (4) number of "medium" dish, and (5) number of "large" dish. It calculates and prints the final bill according to the charging rules below. Input on number of persons is always positive, while inputs on number of dishes are always non-negative. The membership rank is a character input, where ' G ' stands for "Gold", ' S ' stands for "Silver", 'B' stands for "Bronze", and 'N' stands for "None". Determine the odd or even version of this question using the 6th digit of your student ID number. Price of a dish (in dollars) Cover charge per person Extra discount based on membership rank and number of persons Note that the final bill is subject to a 10% service charge. It is calculated based on the original price, which is the sum of the price of all dishes and the discounted, if applicable, cover charge. Format the output to two decimal places. Sample display IMPORTANT NOTE: You need to follow all text and order as shown in the sample display. There should be NO prompt messages and additional blank lines in the output. DO NOT add extra text in the output which will be considered as incorrect in marking

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Instant Reference

Authors: Gruber, Martin Gruber

2nd Edition

0782125395, 9780782125399

More Books

Students also viewed these Databases questions