28.9k views
0 votes
IN JAVA Write a program with total change amount as an integer input that outputs the change using the fewest coins, one coin type per line. The coin types are dollars, quarters, dimes, nickels, and pennies. Use singular and plural coin names as appropriate, like 1 penny vs. 2 pennies.Ex: If the input is:0or less, output:no changeEx: If the input is:45the output is:1 quarter2 dimes Your program must define and call the following method. Positions 0-4 of coinVals should contain the number of dollars, quarters, dimes, nickels, and pennies, respectively.public static void exactChange(int userTotal, int[] coinVals)Note: This is a lab from a previous chapter that now requires the use of a method.USE THIS SKELETONimport java.util.Scanner;public class LabProgram {/* Define your method here */public static void main(String[] args) {/* Type your code here. */}}IN JAVA

1 Answer

2 votes

Answer:

..

Step-by-step explanation:

I dont know how to code in java yet, I'm sorry. btw do you code in python?

User Ipor Sircer
by
3.6k points