Question: Write a Java program that plays the role of a cash register. The program is to work as follows: 1 . Define Five constants, DOLLAR,

Write a Java program that plays the role of a cash register. The program is to work as follows:
1. Define Five constants, DOLLAR, QUARTER, DIME, NICKEL, PENNY. [5 points]
2. Next define two variables, the amount of sale and assign any amount, and the amount
tendered and assign any amount (should be bigger or equal to the amount of sale).[5 points]
3. a. Compute the total change in pennies, (the difference between the amount tendered and the
amount of sale, multiplied by 100).[10 points]
b. Compute the number of dollar bills, (by taking the remainder of the change and the
DOLLAR), then use the remainder change to computer the quarters, and so on for the dimes,
nickels and cents. [10 points]
c. Display the total change, and its denominations Dollars, quarters, dimes, nickels, and
cents.

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!