Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

COSC 1 1 1 , Machine Problem # 1 5 0 points Due Date: 1 / 2 2 / 2 0 2 4 midnight Write

COSC 111, Machine Problem #150 points Due Date: 1/22/2024 midnight 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. [10 points] YOUR OUTPUT MUST LOOK LIKE THE SAMPLE BELOW. _______________________________________________________________ THE AMOUNT OF SALE: $ 8.28 THE AMOUNT TENDERED BY CUSTOMER: $ 10.00 TOTAL CHANGE = $ 1.72 DOLLARS =1 QUARTERS =2 DIMES =2 NICKELS =0 CENTS =2 THANK YOU FOR USING (your name) CASH REGISTER PROGRAM _____________________________________________________________________ Run your program several times, each time with a new pair of data from below: Amount of Sale Amount Tendered 8.2810.00162.01175.0092.0095.005.685.69201.56201.56 Please turn in the following together but not zipped, upload them separately to canvas: 1. The source code. 2. Screen shots of all the five outputs. General Rubric for programming assignments - Comments/proper identification/indentation o Add name(s) of all authors, class, assignment #, and purpose to the program (2 points) o Use additional comments explaining your steps at least once every five lines. (2 points) o Use proper indentation (6 points) o Compilation/execution (40 pts distributed above) o You will get 0% score if it does not have output. You will get 50% if the output is wrong.

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

Handbook Of Relational Database Design

Authors: Candace C. Fleming, Barbara Von Halle

1st Edition

0201114348, 978-0201114348

More Books

Students also viewed these Databases questions