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
2
Chapter
3
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
3
to
5
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
5
people each order
1
apple, then you
need to be able to display a final report that says
5
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
(
1
=
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
2
Appropriate comment to introduce the program
2
Appropriately named constants
2
Appropriately named variables
2
Properly obtains initial input
5
Proper loop to ensure that each employee gets a chance to order
5
Proper loop to ensure that each employee orders as many items as they want
2
Proper display of menu options
2
Proper retrieval of menu selections
5
Ensure valid input and proper tracking of quantities
2
Able to halt ordering for an individual, entire company
2
Automatically halt when budget is exceeded
5
Proper calculations in final report
2
Proper alignment of data in the final report
2
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 blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!