Question: 2 )Trace and write the output of the following JAVA programs ll you entered 89 Oport java.util Scanner; ublic class ChangeMaker public static void main

2 )Trace and write the output of the following JAVA programs ll you entered 89 Oport java.util Scanner; ublic class ChangeMaker public static void main (String [] args) int amount, originalAmount, quarters, dimes, nickels, pennies; System out.println ("Enter a whole number from 1 to 99."); System out.println ("I will find a combination of coins"); System.out.println ("that equals that amount of change."); Scanner keyboard = new Scanner (System.in); amount keyboard.nextInt 0; originalAmount = amount; quartersamount / 25; amountamount % 25; dimes amount / 10; amountamount % 10; nickels # amount /5; amountamount % 5; pennies amount; System.out.println (originalAmount + cents in coins can be given as:"); System.out.println (quarters + " quarters"); System out.println (dimes + " dimes"); System.out.println (nickels + " nickels and"); System it.printin (pennies + " pennies"); rogrant %3D Enter a uole number from 1 to
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
