Question: program must behave in the should know how to define them. The following manner: The program will require the user to enter the needed values


program must behave in the should know how to define them. The following manner: The program will require the user to enter the needed values one after another. If any of the entered values is invalid, t requiring the user to enter a valid value. The program must keep track of the total number of invalid values that the user has entered Using SubTotal and taxlRate, the program should compute Taxl. Using Taxl and tax2Rate, the program should compute Tax2. The program will calculate the SubTotal, Taxl, Tax2 and Total then display the following For this question you are required to write a Cashier Calculator, which will compute the total price of some items including taxes (Taxl & Tax2). The subtotal, taxes, and total price are calculated as follows hen the program will detect that and go into a loop SubTotal = nil P(1) the price of item i where n = number of items bought and P()- Tax 1 = SubTotal tax 1 Rate (e.g., taxi Rate 006 stands for 6%) Tax2 = (SubTotal + Tax 1) tax2Rate (e.g., tax2Rate 0075 stands for 7.5%) Total = SubTotal + Tax 1 + Tax2 o How many times the user has entered invalid values for all the required inputs. If the user did not enter any invalid value, then no message should be displayed. In other words, "You have entered 0 invalid inputs" should NOT be displayed if the user has entered all values correctly Your program will require the user to enter the following 1) The number of items 2) The price of each item 3) The Tax1 rate in percentage 4) The Tax2 rate in percentage o The subtotal o TheTaxl o TheTax2 Thetotal The displayed subtotal, Taxl, Tax2, and total must have 2 decimal places The following constraints are given: The minimum number of items is 1 and the maximum number of items is 10 CODE HAS TO BE IN JAVA LANGUAGE The minimum price of each item is $1 and the maximum price of each item is $1,000. The price may be a decimal number The minimum tax rate for Taxl and Tax2 is 0 and the maximum tax rate is 100. enter 12.345". You will need to divide it by 100 to compute the tax rates. You can assume that the user will not enter the % symbol All of the above minimum and maximum values are constants i.e., they remain unchanged throughout the entire program. You Suppose the tax rate is 12.345%, the user will
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
