Answered step by step
Verified Expert Solution
Link Copied!

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:
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David M. Kroenke, David J. Auer

7th edition

133544621, 133544626, 0-13-354462-1, 978-0133544626

More Books

Students also viewed these Databases questions