CSCI-1320 Homework 04: MakeChange

Instructor: Todd Dole

Purpose Statement

This assignment will involve simple integer arithmetic. You may find that while the arithmetic is simple, figuring out how to combine the various operators can be a challenge!

Instructions

Create a new program with a class called MakeChange. Your source code file should be named MakeChange.java

Your program should have the user enter an integer value that represents
some number of cents. Your task is to calculate and display the number of
quarters, dimes, nickels, and pennies that need to be given to total the
given number of cents. You should always give the largest coin from the
change that remains. That is, don't cheat and have the program give all
the change in pennies!

HINT: There is more than one way to do this problem. One possible solution involves Integer division and modulus/remainder.
If the user enters 64 cents then you can do 64/25 (which is 2) to determine the number of quarters and then 64%25 (which is 14) to tell you how much is left after taking out all of the quarters.

Example Output:

                 Please enter the amount of change: 64
                 Your change is 2 Quarters, 1 Dimes, 0 Nickels, and 4 Pennies.

P.S. What happens with your program if the user enters `23212' for the change?
(For this program, it's alright if it gives back a huge amount of quarters!)

Upload your solution (your MakeChange.java source code file) to the assignment in Canvas.

Bonus Challenges

1st Extra Challenge: Can you use if statements to change the output to leave out coins that aren't used?
Example Output: Your change is 2 Quarters, 1 Dimes, and 4 Pennies.

2nd Extra Challenge: Can you use if statements to change the output so that if there is only 1 coint of a type, it uses the singular?
Example Output: Your change is 2 Quarters, 1 Dime, and 1 Penny.

Include which challenge(s) you completed in a comment at the start of the file.

Note on Bonus Challenges: These are good practice and you may submit them for feedback, but your grade will not be negatively affected if you do not do these.