Answered step by step
Verified Expert Solution
Link Copied!

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 50 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 proto-type 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:
1-5 items: No discount.
6-20 items: 5% discount
21-35 items: 10% discount
36 or more items: 15% discount
Shopping Carts over $ 200 will get a 20% 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 1
What is the cart total: 25.70
What is the number of items in the cart: 4
Your cart total is $25.70, with a total of 4 items.
You are not eligible for a discount.
Run 2
What is the cart total: 30
What is the number of items in the cart: 13
Your cart total is $ 30.00, with a total of 13 items.
You are eligible for a discount of 5% based on the number of items purchased -- precisely $ 1.50.
Your new total is $ 28.50.
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 in-line 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Spatial And Temporal Databases 10th International Symposium Sstd 2007 Boston Ma Usa July 2007 Proceedings Lncs 4605

Authors: Dimitris Papadias ,Donghui Zhang ,George Kollios

2007th Edition

3540735399, 978-3540735397

More Books

Students also viewed these Databases questions

Question

5. Understand how cultural values influence conflict behavior.

Answered: 1 week ago

Question

8. Explain the relationship between communication and context.

Answered: 1 week ago