Question: Send me full codeb (use swift ios) Question no 2 Part 1 Spot the error and explain the error as well func Exercise(_ repeat :

Send me full codeb (use swift ios)

Question no 2

Part 1

  1. Spot the error and explain the error as well

func Exercise(_ repeat: Int, type: String) -> Int {

var output: String = ""

for _ in 0 ..< repeat {

output += "I'm doing a \(type) "

}

if repeat < 10 {

output += "That was easy!"

} else if repeat < 30 {

output += "That was challenging!"

} else {

output += "Phew - I need a break!"

}

return output

}

print(Exercise(repeat: 34, type: "push up"))

func shareWinnings(people: Int, fairly: Bool) -> String {

var returnValue: String = "We're going to split this...

if fairly {

returnValue += "Everyone gets 1/\(people)"

} else {

returnValue +="I get half because I deserve it. "

returnValue += "Everyone else can split the remainder."

}

return returnValue

print(shareWinnings(people: 3, fairly: true))}

  1. Rearrange the line of code

struct XWing {

if callSign == "Red 5"

{

return false

var callSign: String

}

{

return true

else {

}

func shouldAttackDeathStar() -> Bool

}

}

  1. Rearrange the code

if number % 2 == 0 {

for number in numbers {

}

print(number)

var numbers = [1, 2, 3, 4, 5, 6]

}

} else {

print("Skipping odd number")

part: b

Q: Write a note on the following also give examples.

  • UINavigationController
  • UITabBarController
  • UISplitViewController

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!