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:
Define Five constants, DOLLAR, QUARTER, DIME, NICKEL, PENNY. points
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 points
a Compute the total change in pennies, the difference between the amount tendered and the
amount of sale, multiplied by 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. 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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
