Question: Question 6 6.67 pts Optional chaining and the nil-coalescing operator cannot be used together in the same line of code. O True False Question 7



Question 6 6.67 pts Optional chaining and the nil-coalescing operator cannot be used together in the same line of code. O True False Question 7 6.67 pts Given the following Outer Planets enumeration: enum OuterPlanets: Int{ case mars = 4, jupiter, saturn, uranus, neptune } What is the rawValue for saturn? 02 3 O4 O 5 O 6 O 7 Question 8 6.67 pts Swift enumerations can be nested. An enumeration case can be an enumeration. True False Question 9 6.67 pts Given the following lines of code and a valid Trip class that has a property called title: var trip: Trip? trip?.title = "Vacation to San Francisco" What will happen when the above lines execute? A trip instance is created and the title is set on the instance. Attempting to access title on trip crashes the program, because trip was not initialized with a Trip object and is nil. Because optional chaining is used and trip is nil, there will be no attempt to access title on trip. The nil-coalescing operator ensures that a valid trip instance is created before title is set on it. Question 14 6.67 pts Because not every raw value will return an enumeration case, the raw value initializer for an enumeration has to be a failable initializer. Given the following: var color = RainbowColor(rawValue: 6) What type is color? O Color Color? Color! Int Int? O Int! Rainbow Color Rainbow Color? Rainbow Color
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
