Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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.
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started