Question: Write a program that reads from the user the item type (A, B or C) and the quantity bought. The price of each item

Write a program that reads from the user the item type (A, B or C) and the quantity bought. The price of each item is displayed in the below table. Type Price per one Item A 3000 B 4000 5000 If the user has bought more than 5 items of any type, he/she is notified that he/she will be charged double the amount; the user is given the choice to accept or to reduce the quantity bought to 5. The program displays the total amount. Your program should accept lowercase and uppercase alphabets for all character inputs. If the quantity is less than zero, the program should display an error message. Sample Run 1: Enter the type: A Enter the quantity: 3 Thanks, your total in L.L. is: 9000.0 Sample Run 2: Enter the type: A Enter the quantity: 7 You exceeded the limit. You will be charged double the price, Enter y to accept or n to reduce the quantity to 5: y Thanks, your total in L.L. is: 42000.0 Sample Run 3: Enter the type: B Enter the quantity: 6 You exceeded the limit. You will be charged double the price, Enter y to accept or n to reduce the quantity to 5: n Thanks, your total in L.L. is: 20000.0
Step by Step Solution
There are 3 Steps involved in it
import javautil import the util capacities public class Main public static void mainString ar... View full answer
Get step-by-step solutions from verified subject matter experts
