Answered step by step
Verified Expert Solution
Question
1 Approved Answer
You've been asked to write a pricing app for a friend who opened a new eating establishment. At this place customers are charged by the
You've been asked to write a pricing app for a friend who opened a new eating establishment. At this place customers are charged by the weight of the food eaten. Your program needs to determine the price based on the weight of the food eaten, using the following pricing model:
If the customer eats less than pounds of food the price is $; if the customer eats up to and including pounds of food the price will be $ If the customer eats up to and including pounds of food the price will be $ If the customer eats more than that the price will be $
Your general logic should be something like this: Prompt the user for customer name and pounds of food eaten by that customer. Calculate the subtotal based on that weight, then add sales tax, then output the customer name, pounds eaten, subtotal, tax, and total amount due.
Example output:
Customer name:
Pounds eaten:
Subtotal:
Tax:
Total amount due:
Ms Creosote
$
$
$
Use only NAMED CONSTANTS for ALL constants in the program! see Remember that the weights, prices, and sales tax rate are all constants in this program.
Your decision logic should use Multiple Alternatives see
Pay close attention to which weight cutoffs are associated with which charges look for words like up to and including" versus words like "less than" and use the appropriate relational operators see
Test your program with several representative values to verify that the logic works, then submit it showing output for the following two amounts of food eaten: pounds and pounds.
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