divider

Objective

Your task is to write a program that helps novice cashiers give back the correct change efficiently. The program should start with the largest coin denomination and work its way down until the exact change is given.

Skills to Practice

  • icon Prompting a user for input
  • icon Saving user input to variables
  • icon Converting input to the correct data type (if necessary)
  • icon Performing arithmetic calculations
  • icon Formatting custom output using variables
divider

Tasks

  • icon Create a new project named 1-5-change-calculator
  • icon Complete the following tasks:
    • icon Prompt the user to input the amount of change needed. For simplicity, assume the value will range from 1 to 99 cents.
    • icon alculate the change starting with the largest denomination (quarters) and work down to the smallest (pennies).
    • icon Display the result in a clear and concise format.
divider

Sample Output

Sample Output
Enter the amount of change needed (in cents): 68 [Enter]
You will need:
2 quarters
1 dime
1 nickel
3 pennies

Begin Challenge