Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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?
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
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