Question: Can you rewrite this Java code in the Swift programming language? k* 2 Reads temperatures from the user and shows which are above 3 and

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

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

k* 2 Reads temperatures from the user and shows which are above 3 and which are below the average of all the temperatures 4. 5 import java.util.Scanner; 6 public class ArrayOfTemperatures2 8 public static void main (String [] args) Scanner keyboard new Scanner (System.in); System.out println ("How many temperatures do you have?"); int size keyboard.nextInt ; double [] temperaturenew double [size]; // Read temperatures and compute their average: System.out println ("Enter"+ temperature.length + 10 14 15 16 " temperatures: "); double sum0 for (int index = 0 ; index temperature. length ; index++) 18 temperature [index] keyboard.nextDouble (); sum sum + temperature [index] 20 double average sum / temperature.length; System.out println ("The average temperature is "+ 23 24 25 26 average) // Display each temperature and its relation to the average: System.out.println ("The temperatures are"); for (int index = 0 ; index temperature length ; index++) 28 29 it (temperature [index]

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!