App Development with Swift Review Correct Questions and Answers 2024/2025 Solved 100%
What are the three primary goals of swift? - Safe, fast, expressive What features of swift make it a "safe language" - Type safety, type inference, error handling, optionals. Which of the following is a great environment for prototyping Swift code? - Playgrounds (not xcode, safari, or terminal) What will the following code print to the console? let helloWorld = "Hello, world!" let helloPlayground = "Hello, playground!" let goodbyePlayground= "Goodbye, playground!" print("Testing, Testing, 1-2-3") - "Testing, Testing, 1-2-3" Which of the following values would be best represented with a constant? a. Player name b. Player level c. Player score d. Player location - Player name Which of the following would be best represented with a variable? a. name b. birthday c. age d. home address - age Which keyword is used to declare a constant? - let Which keyword is used to declare a variable? - var Which of the following is NOT a reason for declaring most values as constants? a. It is a best practice b. The complier can make special optimizations for immutable values. c. It is safer; developers can rely on a consistent value d. Most values never change - Most values never change Using type inference, which of the following variables would be assigned in a double type? A. var state = "Rhode Island" B. let country = "Belgium" C. let population = 142000 D. let speedLimit = 75.0 - let speedLimit = 75.0 Will the following code snippet compile? Why? let number: Double = 3 a. Yes, because the compiler will assign the value 3.0 to number b. Yes, because 3 is a double c. No, because 3 is not a double - Yes, because the compiler will assign the value 3.0 to number What is the value of myNumber at the end of the following code? let x = 2 let y = 4 let z = 6 let myNumber = x + y + z - 12 What is the value of myNumber at the end of the following code? let x = 2 let y = 4 let z = 6 let myNumber = x + y * z - 26 What is the value of myNumber at the end of the following code? let x = 2 let y = 4 let z = 6 let myNumber = x * y - z - 2 What is the value of myNumber at the end of the following code? let x = 2 let y = 4 let z = 6
Written for
- Institution
- App Development
- Course
- App Development
Document information
- Uploaded on
- March 5, 2024
- Number of pages
- 21
- Written in
- 2023/2024
- Type
- Exam (elaborations)
- Contains
- Questions & answers
Subjects
-
app development with swift review