Question
In US currency, a quarter is worth 25 cents, a nickel is worth 5 cents, and a penny is worth 1 cent. Write a Java
In US currency, a quarter is worth 25 cents, a nickel is worth 5 cents, and a penny is worth 1 cent. Write a Java program that prompts the user to enter an integer representing a dollar amount that consists of all pennies. You may assume the user input value is greater than zero. The program is to distribute that amount into quarters, nickels and pennies, using as few coins as possible. Note: you may not use any currency values other than quarters, nickels, and pennies. Your coded solution must include a step-by-step algorithm. Here are sample runs:
Enter an integer 67 Enter an integer 184 To make 67 cents, you need: To make 84 cents, you need: 2 quarters 3 nickels 2 pennies 7 quarters 1 nickels 4 pennies public static void main(String[] args) ...)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