Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ coding please 2.4 S21 Assn 2 Problem 1 Write a program that helps a cashier make change. The program gets a dollar amount from

C++ coding please

image text in transcribed

2.4 S21 Assn 2 Problem 1 Write a program that helps a cashier make change. The program gets a dollar amount from the user and calculates and displays how to make the change amount entered using the smallest number of bills and coins possible. (The change should be made by first giving the maximum number of dollars, followed by the maximum number of quarters, then dimes, nickels, and finally pennies. i.e. Your answer should never have more than 3 quarters, 2 dimes, 1 nickel, or 4 pennies.) You may assume that only amounts greater than $o will be entered Hint Convert the amount entered by the user to pennies rounding up to the nearest integer, using the round function from cmath. You do not need and cannot use decisions in your solution. For example, if the user enters 19.39 the output of your program should be as shown below. Note, there is one tab before each of the quantities of dollars, quarters, etc. Change Due: 19 dollars 1 quarters 1 dimes 0 nickels 4 pennies Make sure you include a clear and explicit prompt asking the user to enter the amount of the change to be made in dollars. Clearly label each output including the units. In your IDE, not for submission, investigate what happens if you don't use the round function when the input is 4.14. Think about what causes this Additional Requirements To complete this assignment you are ONLY allowed to use what is discussed in Chapters 1 - 3 of the text and lectures. If you already know how to program, refrain from using more advanced constructs or library routines. The problem can and should be solved using only what we have learned in the course. You must follow the style guidelines described in the document named (Programming Style Guidelines) provided in eLearning. Be sure you have reviewed the style guidelines carefully. Important Notes: . The file submitted must be named ChangeMaker.cpp You should be testing and debugging your code in your IDE. You are limited to submitting for grading in Zylabs to 10 times. Grading Criteria (15 points) Grader Inspection of submission to determine if: . Instructions were followed Style guidelines were followed Appropriate comments are included in the source file including an introductory comment written in your own words and comments in the body of main explaining the processing. (35 points) Program passes all tests

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

Oracle Database Foundations Technology Fundamentals For IT Success

Authors: Bob Bryla

1st Edition

0782143725, 9780782143720

More Books

Students also viewed these Databases questions