Question: JAVA PROGRAMMING QUESTION 1. The ABC Nasi Ayam Restaurant wants you to write a program that simulates a simple cash register. The program should ask

 JAVA PROGRAMMING QUESTION 1. The ABC Nasi Ayam Restaurant wants you

to write a program that simulates a simple cash register. The program

JAVA PROGRAMMING QUESTION 1. The ABC Nasi Ayam Restaurant wants you to write a program that simulates a simple cash register. The program should ask the user to enter the price of the meal. Then, the program should calculate the sales tax (3% of the meal price) and add it to the meal price to obtain the total price. A discount will be given based on this total price: Discount Rate Total Amount Less than 10 10 - 19.99 20 - 39.99 40 and above 0.0 2% 4% 8% . User needs to enter the number of time that the meal need to be key-in. For each meal, the system will calculate the sales tax, total price, discount, and net price. At the end of the process, the system will list all the information. You are required to use the element of Meaningful of identifier names (class name, variable names) Input and output (formatting data using printf() method) Calculation Selection structure (if statements) Repetition structure (for loop statements) Array . . . All of these elements must be included in the main() method. You are not allowed to use the other methods than main() method. . The number of spaces for the displayed data (using printf() method) as follows: price (6 spaces), tax (6 spaces), total price (15 spaces), discount (10 spaces), and net price (10 spaces) use two decimal point for the floating point number The sample format of input and output is as follows (The bold texts indicates the data that you need to input from keyboard): Scenario 1: Enter the number of time the meal will be key-in = 4 Please enter meal price 1 = RM 9 Please enter meal price 2 = RM 10 Please enter meal price 3 = RM 20 Please enter meal price 4 = RM 40 Price 9.00 Tax 0.27 Total Price 9.27 Discount 0.00 Net Price 9.27 10.00 20.00 40.00 0.30 0.60 1.20 10.30 20.60 41.20 0.21 0.82 3.30 10.09 19.78 37.90 Scenario 2: Enter the number of time the meal will be key-in = 2 Please enter meal price 1 = RM 10 Please enter meal price 2 = RM 40 Price 10.00 40.00 Tax 0.30 1.20 Total Price 10.30 41.20 Discount 0.21 3.30 Net Price 10.09 37.90

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!