Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

18.which keyword is used to create an array in swift? a. array() b. c. …

Question

18.which keyword is used to create an array in swift?
a. array()
b.
c. set()
d. dictionary()
clear my choice

19.which framework in ios handles base objects like nsstring, nsarray, nsdictionary?
a. uikit
b. foundation
c. core animation
d. mapkit
clear my choice

20.what is the result of print(10 % 3) in swift?
a. 3
b. 1
c. 10
d. 0
clear my choice

Explanation:

Brief Explanations
  1. In Swift, an empty array is created using square - brackets []. array() is not the correct keyword for creating an array in Swift. set() is used for creating sets and dictionary() is for creating dictionaries.
  2. The Foundation framework in iOS handles base objects like NSString, NSArray, NSDictionary. UIKit is mainly for building user interfaces, Core Animation is for animations and MapKit is for maps.
  3. In Swift, the % operator is the modulo operator. When 10 is divided by 3, the quotient is 3 and the remainder is 1. So 10 % 3 equals 1.

Answer:

  1. B. []
  2. B. Foundation
  3. B. 1