CSC345_Lab01: “Revenue”

$30.00

Download Details:

  • Name: Lab1-cdslll.zip
  • Type: zip
  • Size: 24.02 KB

Category:

Description

Rate this product

Project : revenue
Write a C program called revenue to calculate the revenue from a sale based on the unit price and quantity of a
product input by the user.
• The discount rate is
o 0% for the quantity purchased between 1 and 49 units.
o 10% for the quantity purchased between 50 and 99 units.
o 15% for the quantity purchased between 100 and 149 units.
o 25% for the quantity purchased greater than or equal150 units.
• Catch any invalid inputs (Negative numbers or Zeroes), output a warning message and end the program.
Case (1) a successful run:
Welcome to “RAMS” store
Enter item price: 10
Enter quantity: 60
The item price is: $10.0
The order is: 60 item(s)
The cost is: $600.0
The discount is: 10.0%
The discount amount is: $60.0
The total is: $540.0
Thank You for using “RAMS” store
Case (2) a failed run:
Welcome to “RAMS” store
Enter item price: -30
This is not a valid item price.
Please run the program again
Thank You for using “RAMS” store
Case (3) a failed run:
Welcome to “RAMS” store
Enter item price: 10
Enter quantity: -90
This is not a valid quantity order.
Please run the program again
Thank You for using “RAMS” store