130 likes | 252 Views
Using Conditionals in QuizMe and Making Multiple Screens. Week 3. Activity. Simon Says Everyone stand up Do what you teacher says if she says “ Simon Says ”. Conditionals – If Statements. If (condition is true) then (do something)
E N D
Using Conditionals in QuizMe and Making Multiple Screens Week 3
Activity • Simon Says • Everyone stand up • Do what you teacher says if she says “Simon Says”
Conditionals – If Statements • If(condition is true) then (do something) • When the conditions change, the actions change • E.g. if Simon says “Simon says”then do the command • E.g. if you are thirsty and you have water, you take a drink
Conditionals- If else • If(condition) then (do something) else (do something else) • E.g. You’re asking someone to go to the prom. What happens if they say yes? What happens if they say no?
Flow Charts: Flow of Control Condition must have a value of TRUE or FALSE THEN true If answer is ‘yes’ ELSE false
Flow of Control Phone gets taken away true If you text during class false If (you text during class) Phone gets taken away else Keep phone You keep your phone
Conditionals in App Inventor • Found under Built-in in the Control drawer • if • ifelse true then do true then do false else do
Nested Conditionals • If (condition) then (do something) elseif(condition#2) then (something else) else (do something else) • E.g. if I get into Stanford I’ll go there. Elseif I get into Berkeley I’ll go there. Elseif I get into Harvey Mudd, I’ll go there.
Resources If you have problems • Watch the YouTube video • Read the App Inventor book on conditionals (page 259-266) • Post questions to the Technovation Challenge Google Group
Reminder:Weekly Reflections • What did your team like about this week? • What challenges did your team have this week? • Anything else your team would like to share?
Share with us onTwitter & Facebook Tweet us: @_technovation_ #technovation Like us on Facebook: Technovation Challenge