(Solved) : Write Java Application Prompts User Pairs Inputs Product Number 1 5 Integer Quantity Units Q43940687 . . .
Write a Java application that prompts the user for pairs ofinputs of a product number (1-5), and then an integer quantity ofunits sold (this is two separate prompts for input values). Youmust use a switch statement and a sentinel-controlled loop (i.e. aloop that stops execution when an out of range value, such as -1,is input). All 15 items below are for a single purchase. There arefive sets of inputs as follows:
Product 1 1unit (cost is $2.98 per unit)
Product 2 2units (cost is $4.50 per unit)
Product 3 3units (cost is $9.98 per unit)
Product 4 4units (cost is $4.49 per unit)
Product 5 5units (cost is $6.87 per unit)
Your application must show the user’s input of each pair ofproduct number and quantity, the calculated line cost for thatproduct, and the cumulative order cost so far. Then, after thesentinel value is input your program must display the total retailcost for the full order.
You must show all 11 user inputs (5 product number and quantitypairs and the sentinel value) and all the corresponding programoutputs, not just a subset of the inputs and outputs.
Expert Answer
Answer to Write a Java application that prompts the user for pairs of inputs of a product number (1-5), and then an integer quanti…
OR