We don’t always know ahead of time what things will be like when our computer programs run. Different users have different needs, and sometimes you will want to do something based off of one user’s need that you don’t want to do with someone else. That is where conditionals come in. This lesson demonstrates how conditionals can be used to tailor a program to specific information.
By completing this activity girls will
IF(CARD is RED) Award YOUR team 1 pointELSE Award OTHER team 1 pointExample #1:If (CARD is RED) Award YOUR team 1 point Else If (CARD is higher than 9) Award YOUR team 1 point Else Award YOUR team the same number of points on the cardExample #2: If (CARD is lower than 5) If (CARD is BLACK) Award YOUR team the same number of points on the card Else Award OTHER team 1 pointElse If (CARD is HEARTS) Award YOUR team 1 pointWrap-up discussion
Per group:
Interim CSTA K-12 Computer Science Standards: 1B-A-2-1, 1B-A-5-3, 1B-A-3-7, 2-A-7-4, 2-A-6-10
Next Generation Science Standards: 3-5-ETS1-1, 3-5-ETS1-2
Common Core Standards for English Language Arts: W.5.2d, W.5.6, SL.5.1, L.5.6, SL.6.1, SL.6.6, RST.6.3, RST.6.4
This work, "Conditionals," is a derivative of “Conditionals with Cards” by code.org CC BY-NC-SA 4.0, licensed under CC by SciGirls