Question: In Java: Program 1 Write a Java program to calculate the revenue of a sales order. The user inputs the unit price and total number

In Java:
Program 1 Write a Java program to calculate the revenue of a sales order. The user inputs the unit price and total number of units. The discount details are as follows: - Discount rate is 0% if number of units is less than 100 - Discount rate is 10% if number of units is between 100 and 250 - Discount rate is 15% if number of units is between 251 and 500 - Discount rate is 20% if number of units is greater than 500 Use JOptionPane or Scanner and System.out.println() for input and output. Ensure 2 decimal points for currency values. Use iflelse statements when checking discount level. Check for invalid input (invalid price or number of units). Provide error message and exit program using System.exit(0). Sample input: What is the unit price of the product sold? $20 Total number of units sold? 120 Sample output: Unit price: $20.00 Total number of units: 120 Total price before discount: $2400.00 Discount applied: 10% Total price after discount: $2160.00
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
