Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Q3 40 pts) In this question you will create a simplified cash register. Use the runit function to generate a float (i.e. with or without
Q3 40 pts) In this question you will create a simplified cash register. Use the runit function to generate a float (i.e. with or without the decimal) random number between 1 and 90 (let's call this amount). A customer owes this amount, show the amount to the user. Take the input from the keyboard for the customer to pay this amount. Customer will hand you (input) some money in an integer denomination greater than the amount. For example, if the amount is $44.37, the customer hands you 50 or 60 or 70 greater (up to 100). If the amount given is the exact amount, then you should tell them that no change is owed. Otherwise, you should calculate the number of each denomination to give them back in their change. The denominations available are dollars (1.00), quarters (0.25), dimes (0.10), and nickels (0.05). A penny should be rounded up to the nearest nickel. Once you have calculated the change you should tell the customer how much change you have given them. In order to keep your customer happy, you should always give them the fewest coins possible, do not simply give them back all their change in nickels. You are expected to use meaningful variable names and comment any code you feel requires explanation. Example case: Random Amount - $44.39 User Gives (keyboard input) - $60 Change = 60 - 44.37 = $15.61 Fewest denomination change is: 15 Dollars, 2 Quarters, 1 Dime , 1 Nickel (the 1 cent is rounded up to a nickel) What to Submit . One file. File Name: Exam 1_537_LastName_FirstName.docx or .pdf (no .zip) . In the file, post screenshots and the R-CODE for each part in sequence. If you cannot do a part, state that! e.g., Q1 1. Show screenshot R-CODE
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