Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Your local store is having a sale on individual cans of soda, allowing you to mix and match different flavors. There is a maximum of

Your local store is having a sale on individual cans of soda, allowing you to mix and match different flavors. There is a maximum of 10 cans for the sale. Write a program where the user provides the number of cans they purchased and the total amount is calculated. Capture the number of cans as an integer and the total cost as a double. Utilize nested if statements to determine the total cost.
If the user enters 1 or 2 cans, the total cost is $1.00 times the number of cans entered.
If the user enters 3 or 4 cans, the total cost is $0.90 times the number of cans entered.
If the user enters 5 or 6 cans, the total cost is $0.84 times the number of cans entered.
If the user enters 7 or 8 cans, the total cost is $0.80 times the number of cans entered.
If the user enters 9 or 10 cans, the total cost is $0.78 times the number of cans entered.
If the user enters 0 or a number greater than 10, then inform the user that the number is entered is outside the valid range.
Once you have written your program, enter various numbers to verify your calculations and that you can receive each of the possible messages you have created.
3. Grading Criteria (Point Value):
Documentation Requirements
(2) Your last name and Lab 5 are contained in the program name. Include the 3 Opening Comments. Program is documented with comments.
(2) Flowchart outlining the program is included
(*) Coding Techniques not covered in class are documented.
Program Requirements
(2) Utilizes if-elif-else decision statements to determine the total cost.
(2) All 6 categories are reviewed
(2) Calculates the correct result
(2) Receives input from the User.
Display Requirements (must compile to earn these points)
(4) Your program compiles and runs with no errors
(4) Instructions to the user are clear and understandable by someone not familiar with the assignment. Displays correct message based on the data provided. Data output is clearly labeled with spacing.

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_2

Step: 3

blur-text-image_3

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

Distributed Relational Database Architecture Connectivity Guide

Authors: Teresa Hopper

4th Edition

0133983064, 978-0133983067

More Books

Students also viewed these Databases questions