100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
App Development with Swift Review Questions and Answers $12.49   Add to cart

Exam (elaborations)

App Development with Swift Review Questions and Answers

 0 view  0 purchase
  • Course
  • 2024 Prep Tests
  • Institution
  • 2024 Prep Tests

App Development with Swift Review Questions and Answers What are the three primary goals of swift? - ANSWER-Safe, fast, expressive What features of swift make it a "safe language" - ANSWER-Type safety, type inference, error handling, optionals. Which of the following is a great environment for...

[Show more]

Preview 4 out of 32  pages

  • November 3, 2024
  • 32
  • 2024/2025
  • Exam (elaborations)
  • Questions & answers
  • 2024 Prep Tests
  • 2024 Prep Tests
avatar-seller
KaylinHoffman
Copyright © KAYLIN 2024/2025 ACADEMIC YEAR. ALL RIGHTS RESERVED FIRST PUBLISH NOVEMBER, 2024




App Development with Swift Review

Questions and Answers


What are the three primary goals of swift? - ANSWER✔✔-Safe, fast, expressive


What features of swift make it a "safe language" - ANSWER✔✔-Type safety, type inference, error

handling, optionals.


Which of the following is a great environment for prototyping Swift code? - ANSWER✔✔-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") - ANSWER✔✔-"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


Copyright ©Stuvia International BV 2010-2024 Page 1/32

,Copyright © KAYLIN 2024/2025 ACADEMIC YEAR. ALL RIGHTS RESERVED FIRST PUBLISH NOVEMBER, 2024


d. Player location - ANSWER✔✔-Player name


Which of the following would be best represented with a variable?


a. name


b. birthday


c. age


d. home address - ANSWER✔✔-age


Which keyword is used to declare a constant? - ANSWER✔✔-let


Which keyword is used to declare a variable? - ANSWER✔✔-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 - ANSWER✔✔-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 - ANSWER✔✔-let speedLimit = 75.0



Copyright ©Stuvia International BV 2010-2024 Page 2/32

,Copyright © KAYLIN 2024/2025 ACADEMIC YEAR. ALL RIGHTS RESERVED FIRST PUBLISH NOVEMBER, 2024


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 - ANSWER✔✔-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 - ANSWER✔✔-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 - ANSWER✔✔-26

Copyright ©Stuvia International BV 2010-2024 Page 3/32

, Copyright © KAYLIN 2024/2025 ACADEMIC YEAR. ALL RIGHTS RESERVED FIRST PUBLISH NOVEMBER, 2024


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 - ANSWER✔✔-2


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 - ANSWER✔✔-36


Identify the issue with the code snippet below:


let x = 14


let y = 2.5




let result = x * y - ANSWER✔✔-The code with not compile. x is a Int and y is an Double.


What is the operator called when it has an arithmetic symbol in front of the equals sign = ?




Copyright ©Stuvia International BV 2010-2024 Page 4/32

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller KaylinHoffman. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $12.49. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

75057 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$12.49
  • (0)
  Add to cart