Answered step by step
Verified Expert Solution
Question
1 Approved Answer
n this assignment, students will show mastery of decision statements - - IF Statements. You are a developer at Mile High Comics - - the
n this assignment, students will show mastery of decision statements IF Statements.
You are a developer at Mile High Comics the mecca of comic book collecting. Chuck has been selling comics for over years. One of Chuck's best strategies is to provide a discount as consumers purchase more comics.
You have been asked to develop a small prototype program to determine the discount, the discount amount, and the new total for their online shopping cart application.
The following discount strategy is to be used:
items: No discount.
items: discount
items: discount
or more items: discount
Shopping Carts over $ will get a discount
Only one discount can be used it should always be the highest discount.
Your program should do the following:
Prompt for the number of items assume good data.
Prompt for the cart total assume good data.
Calculate the discount and new total as necessary.
Display the appropriate output.
Below are two sample runs of the program to assist with input and output.
Run
What is the cart total:
What is the number of items in the cart:
Your cart total is $ with a total of items.
You are not eligible for a discount.
Run
What is the cart total:
What is the number of items in the cart:
Your cart total is $ with a total of items.
You are eligible for a discount of based on the number of items purchased precisely $
Your new total is $
Rules of Engagement
Violating the rules of engagement will lead to a grade of zero.
The first three lines of the program should be comments that show: student name, course, and assignment.
There should be three sections with a comment label: Input, Processing, and Output the code should be beneath the comment.
Input code that gathers information from the user.
Processing code that uses the input to support the output
Output code that displays the results.
A single IF statement is allowed in processing. A single IF statement can have as many ELIF statements as necessary.
A single IF statement is allowed in the output. A single IF statement can have as many ELIF statements as necessary.
The following data types are allowed: string, integer, float, and boolean.
Only print statements are allowed in the Output section each print statement is permitted a single string literal with variables. The variables may be inline or in a format list. Print statements with expressions are not allowed.
You should have a single print statement that corresponds to each line in the output see sample runs. In other words, you should have three print statements.
You should not attempt to build output strings as variables in processing.
You are allowed to hardcode the values from the discount strategy in processing.
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