Question: Java programming(Please use dialog boxes for input and output. JOptionPane) Your company is selling product items at $100 each. The cost to customers then is

Java programming(Please use dialog boxes for input and output. JOptionPane)

Your company is selling product items at $100 each. The cost to customers then is simply the product of the number of items they purchase multiplied by this unit cost.

However, users can receive a volume discount using the following rules:

if the customer purchases... then their discount is

10-19 items $100

20-49 items $300

50-100 items $500

over 100 items $1000

Write a Java program that receives the numbe of items a user wishes to purchase and returns their totl cost( including the base cost minus the discount).

Include error-checking in the form of a while loop to validate that the number of items read in is in range of 0...200. Otherwise, "trap" the user in the loop until they produce an input vslue in the correct range.

Utilize dialog bix input and output exclusively for the user interface

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!