Write a program to calculate the total price based on items bought by the customer. This program
Fantastic news! We've Found the answer you've been seeking!
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 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
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date: