Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PYTHON Problem 1 A Chinese restaurant has two types of dinner combos for customers to choose. A regular dinner combo includes main dish and soup.

PYTHON

Problem 1

A Chinese restaurant has two types of dinner combos for customers to choose. A regular dinner combo includes main dish and soup. A deluxe dinner combo includes main dish, soup and appetizer. There are three main dish choices: sweet and sour pork ($7), sesame chicken ($8) or shrimp fried rice ($9). There are two soup choices: egg drop soup ($1.25) or wanton soup ($1.50). There are two appetizer choices: spring roll ($1.25) or chicken wing ($1.50). They need a program to place orders. You Python project needs to follow these requirements:

(a) Create a Dinner_combo class for regular dinner combos. This class has three protected instance variables: main_dish, soup and total. Define a choose_dish method to choose a main dish, a choose_soup method to choose a soup, and a displayOrder method to display items ordered and total amount due.

(b) Create a Deluxe_dinner_combo class for deluxe dinner combos. This class is a derived class of the dinner_combo class. It has one additional protected instance variables: appetizer. Define a choose_appetizer method to choose an appetizer, and a displayOrder method to display items ordered and total amount due.

(c) In the main module, ask user to choose either regular or deluxe dinner combo. Create an object and call its methods to input food items and display information of the order.

The following shows a sample test run. This customer chooses regular dinner combo.

Enter 1 for dinner combo or 2 for deluxe dinner combo: 1

Enter 1 for egg drop soup [$1.25] or 2 for wanton soup [$1.50]: 1

Enter 1 for sweet and sour pork [$7], 2 for sesame chicken [$8] or 3 for shrimp fired rice [$9]: 2

Items ordered: egg drop soup , sesame chicken

Please pay this amount: 9.25

The following shows a sample test run. This customer chooses deluxe dinner combo.

Enter 1 for dinner combo or 2 for deluxe dinner combo: 2

Enter 1 for spring roll [$1.25] or 2 for chicken wing [$1.50]: 1

Enter 1 for egg drop soup [$1.25] or 2 for wanton soup [$1.50]: 2

Enter 1 for sweet and sour pork [$7], 2 for sesame chicken [$8] or 3 for shrimp fired rice [$9]: 3

Items ordered: spring roll , wanton soup , shrimp fried rice

Please pay this amount: 11.75

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_2

Step: 3

blur-text-image_3

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

Concepts of Database Management

Authors: Philip J. Pratt, Mary Z. Last

8th edition

1285427106, 978-1285427102

More Books

Students also viewed these Databases questions