Question
Write a program to calculate the total price based on items bought by the customer. This program asks the customer to enter the number of
Write a program to calculate the total price based on items bought by the customer. This program asks the customer to enter the number of items bought and then display the total price after the discount.
This program displays the total price(round off to two decimals) after the discount. The customer is asked to enter the number of items again if he enters a value less than 0.
Define a functiontotalPrice() that takes the number of items as an argument and calculates the total price after discount. The unit price of an item is 10.768$.
Discount is based on the number of items bought.
- No discount if the number of items bought is 20 or less
- 10% discount when the number of items bought is between 21 and 50
- 20% discount when the number of items bought is between 51 and 100
- 25% discount when the number of items bought more than 100
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 StartedRecommended Textbook for
Income Tax Fundamentals 2013
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
31st Edition
1111972516, 978-1285586618, 1285586611, 978-1285613109, 978-1111972516
Students also viewed these Programming questions
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
View Answer in SolutionInn App