Question: Assignment 2 Chapter 3 Scripting Fundamentals Task: The owner of a company is having a party for the employees and wants to let them select
Assignment
Chapter
Scripting Fundamentals
Task:
The owner of a company is having a party for the employees and wants to let them select from a menu
of choices, but also needs to stay within a certain budget. You need to write a menu
driven program for
the owner that gets the budget along with the individual orders while ensuring that employee orders are
within budget.
Details:
Ask the user to enter:
the total budget for the party
number of employees attending the party.
Use appropriately named CONSTANTS to store the prices of
to
items on the menu
apple
hotdog
samosa, water, etc
Make a loop that will ask each person in the group for their order
to be selected from a menu.
Each person can make as many selections as they want from the menu, so you will need to use a loop
that will repeatedly display this menu for the same person until an instruction is given to move onto the
next person. You do not need to keep track of the order details for each person, but you do need to keep
track of the quantity of each item ordered for the company
if
people each order
apple then you
need to be able to display a final report that says
apples were ordered
Use appropriately named
variables to hold quantities. You need to constantly display budget spent
remaining
Menu displays:
current person
just a number, not a name
that is ordering
budget spent & budget remaining
item name
item cost
according to your constants
a number associated with each item on the menu
apple
a menu option to move onto the next person
a menu option to halt all ordering for everyone
When a menu item for food is selected, ask for a quantity.
Every time a quantity is entered, adjust the total quantities ordered, and display the remaining budget.
Always check for invalid input and respond appropriately
As soon as the budget is exceeded, automatically halt all ordering
When ordering is complete
or halted
then display a report to the company owner. The report should
have formatted text to ensure that columns line up appropriately showing:
item price quantity subtotal
for each item
final total
ALL items
budget remaining
Lastly, make sure all code is properly documented with docstring comments!
Marking Scheme
Appropriate comment to introduce the program
Appropriately named constants
Appropriately named variables
Properly obtains initial input
Proper loop to ensure that each employee gets a chance to order
Proper loop to ensure that each employee orders as many items as they want
Proper display of menu options
Proper retrieval of menu selections
Ensure valid input and proper tracking of quantities
Able to halt ordering for an individual, entire company
Automatically halt when budget is exceeded
Proper calculations in final report
Proper alignment of data in the final report
Proper comments explaining key sections of code
This is a python program make it in a simple way
python program beginner level
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
