Question: Write a Java program that will imitate a simple cash register transaction. You should prompt the user to enter the price of the item,

Write a Java program that will imitate a simple cash register transaction. You should prompt the user to 

Write a Java program that will imitate a simple cash register transaction. You should prompt the user to enter the price of the item, next calculate the GST (5%) on that price, calculate the total amount due. Next prompt the user for the amount tendered (how much money the customer has given) and calculate the change due. The format of the sales receipt is shown in the example. To complete this you will need to declare variables for price, gst, total, tendered and change. Also you will need to create three simple assignment expressions (equations) to solve for gst, total and change. Please note that all of the numbers for this program are fractional numbers so you need to use double for all your identifiers. Example Run Sales receipt Enter the price of the item: 14.0 Price 14.00 GST : 0.70 Total: 14.70 Enter the amount tendered: 15.00 Change due: 0.30 Thank you and have a nice day!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Heres a simple Java program that imitates a cash register transaction as described java import ja... View full answer

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 Programming Questions!