Question

as a proctored test, using Lockdown Browser, and must be taken on campus in the locat tructor. Its closed-book, closed-notes
pe unice/hling-the-blank questions and Strutora selam implicitly refer to the Swift programming language his test is to be ad

write your code in swift
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Code:

import Foundation
import Glibc

//Declaring and initialising Array
var Temperatures :[Double] = [20 ,30 ,10 , 50 ,-20 ,5 ,362,2,43];

//Declaring and initialising threshold
var threshold : Double = 10;

//Declaring and initialising Count
var count: Int = 0;

for temp in Temperatures
{
if temp>threshold
{
// Incrementing count
count=count+1;
}
}

print(count);

Code Screenshot:

import Foundation 2 import Glibc 4 //Declaring and initialising Array var Temperatures :[Double] = [20 ,30 ,10 , 50 ,-20 ,5 ,

Output:

Llh Result Śswift main. swift

Add a comment
Know the answer?
Add Answer to:
write your code in swift as a proctored test, using Lockdown Browser, and must be taken...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Using Swift playground and / or the command line for macOS (open Xcode, create a new...

    Using Swift playground and / or the command line for macOS (open Xcode, create a new Xcode project, macOS, command line tool), practice the following exercises: Exercise: Swift Variables Declare 2 variables/constants with some random values and any name of your choice Considering these 2 variables, one as a value of PI and other as a radius of circle, find the area of circle Print the area of circle Declare a string variable explicitly with value “Northeastern”. Declare a string...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT