Question: I need help with a conditional statement in Swift. I can'tfigure out how to make the output differ based on user input. Ihave the code

I need help with a conditional statement in Swift. I can'tfigure out how to make the output differ based on user input. Ihave the code In question down below. Any help is appreciated.

print("what are 3 of your favorite movies?")

let movies = readLine()

print(" So your three favorite films are(movies)?" )

print("How old are you?")

let name = readLine()

var solution:Int?

if solution != nil {

print("you are an adult.")

} else {

print( "you are young.")

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

It looks like you are trying to ask the user for their favorite movies and age and then print a stat... View full answer

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 Programming Questions!