Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This programming problem studies the IF statement. The Caswell Catering Company has asked you to write a program to produce a customer bill. Call this

This programming problem studies the IF statement. The Caswell Catering Company has asked you to write a program to produce a customer bill. Call this program Lab5B.py or Catering.py. Here are the details:

o The caterer provides two meals: a beef meal for $15.95 and a vegan meal for $10.95. The user is requested to enter the number of beef and vegan meals

o An 18% gratuity is added to the food cost COS 120 Introduction to Programming

o Caswell offers 3 banquet halls:

Room 1 seats 200 and has a rental fee of $250

Room 2 seats 100 and costs $150

Room 3 seats 50 and has a rental fee of $75

o A state tax of 6.5% is added to the room cost

o Input: The number of beef meals and vegan meals should be read from the user. If the user does not want a particular meal type, the user should be able to just press without having to enter a number. Hint - You will need to check if the input contains an empty string before converting its entry to a number with the int() or eval() functions.

o Processing: Determine the smallest size room that will accommodate the party and compute room cost and tax. Compute the cost of each type of meal, food gratuity, and total bill.

o Output: All output should be written to the screen. Produce an attractive bill that lists the total number in the party, cost of the room, room tax, number of beef meals and their total cost, number of vegan meals and their total, gratuity, and the grand total.

Hint: use the string.format() function with format slots to produce neat columns. You can set up one format string and pass in empty string () for the columns not desired

Money amounts should use the currency format. Hint: use a separate format string to do this.

o The program output should look as follows. Upload the source code to your program (.py file) and a screen shot of its output as either a .JPG or Word document (.docx).

image text in transcribed

COS-120 [C:\Users\michaPycharmProjectsCOS-120] . CaswellCatering.py [COS-1201-P...- File Edit View Navig Code Refactor Run Iools VS Window Help -cos-120) CaswellCatering.py) CaswellCatering C:\Users\michalvenvicos-120\script s\python.exe Run: | C:/Users/micha / PycharmP Enter number of Beef Meals: 80 Enter number of Vegan Meals: 15 Number in Party Room Cost Room Tax Beef Meals Vegan Meals Gratuity Grand Total 95 S 150.00 $9.75 Beef Cost $1276.00 Vegan Cost 164.25 S 259.25 $1859.24 80 15 Process finished with exit code 0 4: Run " Terminal Python Console Event Log : TODO COS-120 [C\Usersimicha PycharmProjects)COS-120]- CaswellCatering.py [COS-120)-PyCharm File Edit View Navigate Code Refactor Run Iools VCS Window Help COS-120 CaswelCatering.py CaswellCatering Q Run: CaswellCatering C:Usezs Imichalvenvlcos-1201scripts Ipython.exe c:/Users/mi cha/PycharmProject | | Enter number of Beef Meals: Enter number of Vegan Meals: 32 Number in Part;y 32 Room Cost Room Tax Beef Meals Vegan Meals Gratuity Grand Total $75.00 $4.88 Beef Cost S 0.00 Vegan Cost 350.40 63.07 493.35 32 Process finished with exit code 0 4: Run &: TODO Event Lo9 Terminal Python Console 15:1 CRLF: UTF-8

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

Datacasting How To Stream Databases Over The Internet

Authors: Jessica Keyes

1st Edition

007034678X, 978-0070346789

More Books

Students also viewed these Databases questions