Question: Can you rewrite this Java code in the Swift programming language? 1 import java.util.Scanner; 2 public class ChangeMaker 4. public static void main (String []

Can you rewrite this Java code in the Swift programming language?

Can you rewrite this Java code in the Swift programming language? 1

1 import java.util.Scanner; 2 public class ChangeMaker 4. public static void main (String [] args) 6 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 (); originalAmountamount; quartersamount /25 amount amount % 25 dimes amount 10 amount amount % 10 nickelsamount/5 amount amount % 5 pennies amount System.out.println (originalAmount + 8 10 14 15 16 18 19 20 " cents in coins can be given as:"); System.out.println (quarters "quarters"); System.out.println (dimes "dimes"; System.out.println (nickels " nickels and); System.out.println (pennies " pennies"); 23 25 26 27 28

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!