iPad < edhesive AP Computer Science Announcements Course Forum Progress Assignment 2 - Change Machine Write...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
iPad < edhesive AP Computer Science Announcements Course Forum Progress Assignment 2 - Change Machine Write a program that will simulate a change machine found at cash registers. Input the amount paid and amount due from the keyboard. Tell the user how much change is owed and number of pennies, nickels, dimes, and quarters in change a customer would receive. 08:46 course.edhesive.com Please Enter the Amount Paid: 5.00 Please Enter the Cost of the Item: 4.57 + Change Owed: 0.43 Pennies: 3 Nickels: 1 Dimes: 1 Quarters: 1 100% Pay special attention to roundoff error. Your program should use division and modular division. No if's or loops may be used. You may assume all change will be a positive number with no more than two decimal places. If more than $1.00 is owed, the full value should be included in the number of quarters returned. For example, $2.50 should be returned as 10 quarters. 18hli@hra.org | Logout Hint: Modular division is a great way to find the remainder of a division. Think about how you can use this to calculate the change that is left over after some coins are given. Sample Run: NOTE: You MUST use the class name "Main" for this assignment. REMEMBER: you must SUBMIT your answer. Your assignment doesn't count as complete unless it has been submitted. iPad < edhesive AP Computer Science Announcements Course Forum Progress Assignment 2 - Change Machine Write a program that will simulate a change machine found at cash registers. Input the amount paid and amount due from the keyboard. Tell the user how much change is owed and number of pennies, nickels, dimes, and quarters in change a customer would receive. 08:46 course.edhesive.com Please Enter the Amount Paid: 5.00 Please Enter the Cost of the Item: 4.57 + Change Owed: 0.43 Pennies: 3 Nickels: 1 Dimes: 1 Quarters: 1 100% Pay special attention to roundoff error. Your program should use division and modular division. No if's or loops may be used. You may assume all change will be a positive number with no more than two decimal places. If more than $1.00 is owed, the full value should be included in the number of quarters returned. For example, $2.50 should be returned as 10 quarters. 18hli@hra.org | Logout Hint: Modular division is a great way to find the remainder of a division. Think about how you can use this to calculate the change that is left over after some coins are given. Sample Run: NOTE: You MUST use the class name "Main" for this assignment. REMEMBER: you must SUBMIT your answer. Your assignment doesn't count as complete unless it has been submitted.
Expert Answer:
Answer rating: 100% (QA)
import javautil public class Main public static void mainSt... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Java Company earned net income of $85,000 during the year ended December 31, 2018. On December 15, Java declared the annual cash dividend on its 4% preferred stock (par value, $120,000) and a $0.25...
-
Java Hut leased a specialty expresso machine for a 10-year non-cancelable term. At the end of the 10-year term, Java Hut has four consecutive one-year renewal options. A replacement machine can be...
-
Java is a high-level, class-based, object-oriented programming language designed to have as few implementation dependencies as possible. Design: James Gosling First appearance: May 23, 1995; 26 years...
-
On January 18, 2021, Marigold Co. paid $450,000 for a three-year insurance policy that covers February 1, 2021 through January 31, 2024. Marigold's year end is June 30, 2021. Assuming she records the...
-
One type of bread-making machine can make six loaves of bread in five hours. A new model of the machine can make four loaves in two hours. Which model is more productive?
-
The following list of balance sheet items are in random order for Wilson Farms, Inc., at September 30, 2011: Instructions a. Prepare a balance sheet by using these items and computing the amount for...
-
What is the expectations gap?
-
Error Corrections you have been assigned to examine the financial statements of Zarle Company for the year ended December 31, 2010. You discover the following situations. 1. Depreciation of $3,200...
-
What are some ways to determine which database management system will work best for a given project? What are some best practices or industry-accepted criteria for matching a given database...
-
Par Corporation acquired all the stock of Sad Corporation on January 1, 2011, for $280,000 cash, when the book values and fair values of Sad's assets and liabilities were as follows (in thousands):...
-
Medical denial management is a critical aspect of healthcare revenue cycle management. What strategies and best practices can healthcare organizations employ to minimize claim denials and improve the...
-
Cheryl Wilcox is planning for her retirement, so she is setting up a payout annuity with her bank. She wishes to receive a payout of$1,500per month for twenty years. How much money must she deposit...
-
Graham Grepzer has come to you in connection with two offers of employment as a salesperson from two rival dry-goods manufacturing companies. Neither company has an office in Graham's present...
-
A power plant burns 5.45 tonne of coal per hours and discharges the combustion products through a stack that has an effective height of 75 m. The coal has a sulfur content of 4.2 percent, and the...
-
You are a senior accountant in a tier 2 accounting firm based in Australia. One of the firm s clients, Avocado Ltd , has prepared a draft set of financial statements for the year ended 3 1 December 2...
-
Given that the width of an energy band is 10 eV, calculate the following, in cm and ev-1 unit. Consider temperature as 420 K. I) The density of states at 8 kT above the bottom of the band. II) The...
-
Suppose you have a riskless security at 3% and a market portfolio with a return of 10% and a standard deviation of 18%. How should you go about investing your money so that your investment will have...
-
(a) What is the focal length of a magnifying glass that gives an angular magnification of 8.0 when the image is at infinity? (b) How far must the object be from the lens?
-
According to special relativity, a rod of length L moving at velocity v will shorten by an amount 8, given by: = L(1 - 1 v2/c2 where c is the speed of light (about 300 x 106 m/s). Consider a rod of...
-
The number of bacteria NB measured at different times t is given in the following table. Determine an exponential function in the form NB = Neat that best fits the data. Use the equation to estimate...
-
The radius, r, of a sphere can be calculated from its surface area, s, by: r = s/x/2 The volume, V, is given by: V = 4r3/3 Determine the volume of spheres with surface area of 50, 100, 150, 200, 250,...
-
The magical elevator. There is a man who lives on the top floor of a very tall building. Every day he gets the elevator down to the ground floor to leave the building to go to work. Upon returning...
-
There are 5 different color houses, occupied by people of 5 different nationalities, who smoke 5 different cigar brands, drink 5 different types of alcohol, and have 5 different pets. The houses are...
-
Five pieces of coal, a carrot, and a scarf are lying on the lawn. Nobody put them on the lawn, but there is a perfectly logical reason they should be there. What happened? How do you explain this?
Study smarter with the SolutionInn App