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
Step: 1
It looks like you are trying to ask the user for their favorite movies and age and then print a stat...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get StartedRecommended Textbook for
Fundamentals of Financial Accounting
Authors: Fred Phillips, Robert Libby, Patricia Libby
5th edition
78025915, 978-1259115400, 1259115402, 978-0078025914
Students also viewed these Programming questions
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
View Answer in SolutionInn App