Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Could you please convert the following java code to swift import java.util.Scanner; public class ArrayOfTemperatures 2 { public static void main (String [] args) {
Could you please convert the following java code to swift
import java.util.Scanner; public class ArrayOfTemperatures 2 { 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 [] temperature = new double [size]; = // Read temperatures and compute their average: System.out.println("Enter + temperature. length + temperatures:"); double sum = 0; for (int index = 0; index average) System.out.println (temperature [index] + above average."); else //temperature[index] == average System.out.println (temperature [index] + the average."); } System.out.println ("Have a nice week."); } } import java.util.Scanner; public class ArrayOfTemperatures 2 { 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 [] temperature = new double [size]; = // Read temperatures and compute their average: System.out.println("Enter + temperature. length + temperatures:"); double sum = 0; for (int index = 0; index average) System.out.println (temperature [index] + above average."); else //temperature[index] == average System.out.println (temperature [index] + the average."); } System.out.println ("Have a nice week."); } }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