Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Databases Object Oriented Deductive Hypermedia Technologies

Authors: Kamran Parsaye, Mark Chignell, Setrag Khoshafian, Harry Wong

1st Edition

0471503452, 978-0471503453

More Books

Students also viewed these Databases questions

Question

What would you do?

Answered: 1 week ago