Answered step by step
Verified Expert Solution
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 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 or cans, the total cost is $ times the number of cans entered.
If the user enters or cans, the total cost is $ times the number of cans entered.
If the user enters or cans, the total cost is $ times the number of cans entered.
If the user enters or cans, the total cost is $ times the number of cans entered.
If the user enters or cans, the total cost is $ times the number of cans entered.
If the user enters or a number greater than 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.
Grading Criteria Point Value:
Documentation Requirements
Your last name and Lab are contained in the program name. Include the Opening Comments. Program is documented with comments.
Flowchart outlining the program is included
Coding Techniques not covered in class are documented.
Program Requirements
Utilizes ifelifelse decision statements to determine the total cost.
All categories are reviewed
Calculates the correct result
Receives input from the User.
Display Requirements must compile to earn these points
Your program compiles and runs with no errors
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
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