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
It looks like you are trying to ask the user for their favorite movies and age and then print a stat... View full answer
Get step-by-step solutions from verified subject matter experts
