Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computer Science – Truth Jam Table JamBreadSandwich Yes No YesNo YesNo TeaMilkDrink No Yes NoYes NoYes What am I getting at?

Similar presentations


Presentation on theme: "Computer Science – Truth Jam Table JamBreadSandwich Yes No YesNo YesNo TeaMilkDrink No Yes NoYes NoYes What am I getting at?"— Presentation transcript:

1 Computer Science – Truth Jam Table JamBreadSandwich Yes No YesNo YesNo TeaMilkDrink No Yes NoYes NoYes What am I getting at?

2 Quick – homework recap In September I requested that you went away and took part in some self study. Code academy gives you the opportunity to learn at your pace and back up your learning in class. I asked for 20%...by today.

3 Computer Science 3.1.1 Constants_variables and data types 2

4 Where are we starting at? Writing programs using Boolean: Uh?Mmmm...Yeah!

5 Success Criteria You must be able to recall the 3 boolean operators and understand their context You must be able to name the six arithmetic tests that can be used to create Boolean values. Should be able to apply these boolean operators within coded solutions Could be able to code your own programs of your own design using boolean operators

6 Quick recap What is boolean? How could you illustrate it? Symbols?

7 Boolean - True or False Operator AND True only if... OR True if... NOT True if...

8 Boolean – Think of some expressions to illustrate these operators Operator Some examples AND Wet and cold OR Black or white NOT I’m happy NOT sad

9 Boolean – Think of some expressions to illustrate these operators Boolean ‘Jamspression’ Jam = Bread = if ( Jam and Bread ): print (“Then you can have a jam sandwich”) else: print (“well, you'll either have: Jam or sandwich but not a jam sandwich”)

10 Boolean – Think of some expressions to illustrate these operators Boolean ‘teaspression’ tea = 0 milk = 1 if ( vodka or coke ): print ("well, you'll get a drink of some kind“) else: print ("you will get no drink at all“)

11 Boolean – Think of some expressions to illustrate these operators Boolean ‘Contradictspression’ a = "True" if not( a ): print "True" else: print "False"

12 Quick warm up Create a boolean expression using AND, OR and NOT 10 minutes

13 Six arithmetic tests OperatorWhat is it? < <= == != >= >

14 Sort task Stand in a line IF You < the person on your right: then move right = one step Else: move left = one step

15 Boolean – Think of some expressions to illustrate these operators spider=raw_input("Is there a spider? - Type Yes or No") if ( spider == "Yes" ): print "Run Away!" else: print "Relax"

16 Boolean – Think of some expressions to illustrate these operators a = 10 b = 20 if ( a == b ): print "they are the same" else: print "they are different"

17 Boolean – Think of some expressions to illustrate these operators a = 50 b = 20 if ( a <= b ): print "a is smaller" else: print "a is bigger"

18 Boolean – Think of some expressions to illustrate these operators spider=raw_input("Is there a spider? - Type Yes or No") if ( spider == "Yes" ): print "Run Away!" else: print "Relax"

19 Really quick Progress check The three boolean operators... Name me the arithmetic operator tests...

20 Using boolean expressions... Write: A program that controls the central heating system. Below 15 degrees and it’ll switch on. A program that signals to a person if their phone is fully charged.

21 Homework Show me evidence: What is a list / array used for? Evidence that you can create a list / array Evidence that you can write code to manipulate* a list / array *search, index, add, append, change, print etc etc.


Download ppt "Computer Science – Truth Jam Table JamBreadSandwich Yes No YesNo YesNo TeaMilkDrink No Yes NoYes NoYes What am I getting at?"

Similar presentations


Ads by Google