Answered step by step
Verified Expert Solution
Question
1 Approved Answer
You must help one of your new franchise clients write a program for taking orders for their new startup ingredient delivery service. Your client needs
You must help one of your new franchise clients write a program for taking orders for their new startup ingredient delivery service. Your client needs help figuring out the total quantities of each ingredient that need to be delivered for the chosen recipe
Enter the following three comment lines at the top:
Name and ID
Course Name and Term
Python Programming Exam Part A
Leave a blank line between the first three comment lines and the label for the
variable code block.
Enter a comment line for the variable code block
Enter variable definitions
HINT: all variable names should conform to
lowerCamelCase naming convention!
with input functions and good prompts
for:
customer name
HINT: this can be one variable, but the prompt should
make it clear that the customer's full name should be entered, not just a
first name or a last name.
customer street address
HINT: this should be text as street addresses
usually contain a combination of numbers and words or letters.
customer city
customer state
customer zip code
HINT: this should be input as a text variable so it can
have leading zeros and a dash if
digit zip code were entered
customer phone
HINT: the phone number should be input as a text
variable like zip code so it can include parentheses and dashes like we
sometimes write phone numbers.
meal order, with prompt specifying exactly what must be entered to
select one of the three options
HINT: SEE LESSON #
for example of how
you did this with the doThis variable in the calculator program.
number of servings wanted
HINT: must be read by the computer as a
number! Checking for valid input is optional, not required.
Leave a blank line
HINT: test your code to make sure you don't have any syntax
errors in your variables code block.
Enter a comment line for the calculations code block
Enter an if
statement to test for the first meal option
HINT: SEE LESSON #
for
example of if
statements
Enter indented ingredient quantity variables for the first recipe with variable
names that include the ingredient and the unit of measure, and hardwired
values.
HINT: SEE LESSON #
for examples of how to do this.
Enter indented variable and value for the first meal option that establishes the
number of servings made with the ingredient quantities given.
Enter the indented ingredient quantity calculations for the first meal option
HINT:
SEE LESSON #
for example of the necessary calculations
Enter the indented format statement for each ingredient quantity that will format
the output with
decimal places
HINT: You learned how to do this in LESSON
#
Create one or more indented output variables for the first meal option using
concatenation to include the meal name, number of servings requested, and list
of ingredient quantities.
HINT: In LESSON #
you created one output variable for
each operation. Here you could create separate output variables for the
number of servings and the meal name, and for each ingredient, OR
create
one output variable and use the
line feed code in your variable to get
each ingredient to print out on a separate line! Whether you use one or several
output variables, use the same output variable names in each if
statement block
like you did in LESSON #
Remember that you don't have to use the str
function for the ingredient variables in your concatenated output variables
because they were converted to text already by the format statements. You will
however still have to use the str
function for your number served and number of
servings wanted variables since they are not being formatted with format
statements.
Enter a blank line
HINT: test your code at this point with print statements before
continuing.
Enter an if
statement to test for the second meal option.
Repeat all the steps for the second meal that you did for the first meal option
steps
Leave a blank line.
HINT: test your code again at this point before continuing.
Enter an if
statement to test for the third meal option.
Repeat all the steps for the third meal that you did for the first meal option
steps
Enter a blank line.
HINT: test your code again at this point before continuing.
Enter a comment line for the output code block
Enter the print function
s
with the output variable
s
you created in the
calculations code block.
HINT: you should only need one set of print functions
for the chosen meal option if you used the same output variable names under
each meal option.
Enter the print function to output the customer phone number with required
spacing.
Enter the print function
s
for the customer name, street address, city, state, and
zip code, as required for the mailing
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started