Question & Answer: Imagine you are ordering from a fast food restaurant with 5 sandwich options, 5 snack options, and 5 drink options, shown below. Each ite…..

Imagine you are ordering from a fast food restaurant with 5 sandwich options, 5 snack options, and 5 drink options, shown below. Each item has a different price, and if you order a combo (1 of each item), you get a 25% discount off of each item in the combo. Write a pseudocode statement where you can input the items you want to order, and the statement calculates the total price of the order Sandwiches A1 - $2.50 A2- $3.50 A3 - $4.50 A4 - $5.00 A5 - $6.50 Snacks B1- $1.00 B2 - $1.50 B3 $2.00 B4 - $2.50 B5 $3.00 Drinks C1 - $0.50 C2 $0.75 C3 $1.00 C4 $1.25 C5 $1.50 Question A (10 points). Draw a flowchart for this problem. You may draw flow chart(s) on paper and take a picture that you can email yourself and insert below, OR draw the flow chart(s) in Word below. IF YOU ARE DRAWING YOUR FLOWCHART BY HAND, MAKE SURE TEXT IN YOUR FLOWCHART IS UPPERCASE * - Question B (10 points). Write the Pseudocode for this problem. (Yes, this is what you just did in the midterm Exam 2 - feel free to use it as is or change it) - Question C (25 points). Write the Python code for this problem below - Question D (15 points). Test your code in Python (using your local installation, or the online Waterloo portal). Take a screenshot of the running code and result and paste below

Imagine you are ordering from a fast food restaurant with 5 sandwich options, 5 snack options, and 5 drink options, shown below. Each item has a different price, and if you order a combo (1 of each item), you get a 25% discount off of each item in the combo. Write a pseudocode statement where you can input the items you want to order, and the statement calculates the total price of the order. Draw a flowchart for this problem. You may draw flow chart(s) on paper and take a picture that you can email yourself and insert below, OR draw the flow chart(s) in Word below. IF YOU ARE DRAWING YOUR FLOWCHART BY HAND, MAKE SURE TEXT IN YOUR FLOWCHART IS UPPERCASE. Write the Pseudocode for this problem. (Yes, this is what you just did in the midterm Exam 2 – feel free to use it as is or change it) Write the Python code for this problem below. Test your code in Python (using your local installation, or the online Waterloo portal). Take a screenshot of the running code and result and paste below.

Expert Answer

 

Answer for given Question:

See the below python code as per given problem statement. It may helpful to your given code

from collections import namedtuple

MenuEntry = namedtuple('MenuEntry', ['index','description','price'])
_menu = []
_menu.append(MenuEntry(1, 'Hawaiian', '$7.50'))
_menu.append(MenuEntry(2, 'Champagne Ham & Cheese', '$7.50'))
_menu.append(MenuEntry(3, 'Beef & Onion', '$7.50'))
_menu.append(MenuEntry(40, 'Pepperoni', '$10.50'))
_menu.append(MenuEntry(100, 'Simply Cheese', '$17.50'))

for entry in _menu:
    index = str(getattr(entry,'index')).ljust(5)
    descr = getattr(entry,'description').ljust(25)
    price = getattr(entry,'price').ljust(7)
    print '{0}{1}{2}'.format(index,descr,price)

""" Output: """

1    Hawaiian                 $7.50  
2    Champagne Ham & Cheese   $7.50  
3    Beef & Onion             $7.50  
40   Pepperoni                $10.50 
100  Simply Cheese            $17.50
Still stressed from student homework?
Get quality assistance from academic writers!