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

Slides:



Advertisements
Similar presentations
Decision Structures - If / Else If / Else. Decisions Often we need to make decisions based on information that we receive. Often we need to make decisions.
Advertisements

Programming with Alice Computing Institute for K-12 Teachers Summer 2011 Workshop.
LO: Were learning to understand how logic applies to us when building applications.
Microsoft® Small Basic
ECS 15 if and random. Topic  Testing user input using if statements  Truth and falsehood in Python  Getting random numbers.
General Computer Science for Engineers CISC 106 Lecture 21 Dr. John Cavazos Computer and Information Sciences 04/10/2009.
General Computer Science for Engineers CISC 106 Lecture 19 Dr. John Cavazos Computer and Information Sciences 04/06/2009.
General Computer Science for Engineers CISC 106 Lecture 20 Dr. John Cavazos Computer and Information Sciences 04/08/2009.
Class 9.1 Chapter 4 Sections: 4.1, 4.2, 4.3
CS 206 Introduction to Computer Science II 02 / 11 / 2009 Instructor: Michael Eckmann.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 3: Conditional Expressions.
If statements Chapter 3. Selection Want to be able to do a statement sometimes, but not others if it is raining, wear a raincoat. Start first with how.
Aim: How to test a hypothesis and design an experiment Do Now: 1) What do you need to know in order to test your hypothesis? 2)Take out your homework.
E-1 University of Washington Computer Programming I Lecture 6: Conditionals © 2000 UW CSE.
Chapter 9 IF Statement Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2012.
Functional Skills Level 1 ICT revision Curriculum links This PPT covers many aspects of Level 1 Functional ICT. Please refer to the resource description.
4x + 2y = 18 a. (1,8) = 18 a. 4(1) + 2(8) = 18 b. (3,3)20 = 18 b. 4(3) + 2(3) = = = 18 15x + 5y = 5 a. (-2,7) NoYes b. (-1,4) a.
Starter – Homework What were our findings?. Computer Science Constants_variables and data types 2.
XOR and XNOR Logic Gates. XOR Function Output Y is TRUE if input A OR input B are TRUE Exclusively, else it is FALSE. Logic Symbol  Description  Truth.
Tea traditions in England
Institute for Personal Robots in Education (IPRE)‏ CSC 170 Computing: Science and Creativity.
Boolean expressions, part 2: Logical operators. Previously discussed Recall that there are 2 types of operators that return a boolean result (true or.
Computer Science: A Structured Programming Approach Using C1 Objectives ❏ To understand how decisions are made in a computer ❏ To understand the logical.
CSC 107 – Programming For Science. Announcements.
CSC 107 – Programming For Science. George Boole  Mathematician from English middle-class  Lived from 1815 – 1864  Started work at age 16 as a teaching.
COMP 110 switch statements and while loops Luv Kohli September 10, 2008 MWF 2-2:50 pm Sitterson
Welcome. Introduction to teacher Md. Muyeen uddin Mulgram secondery school Keshabpur, jessore Mobile: ,
COMP Flow of Control: Branching 1 Yi Hong May 19, 2015.
Sight Word List.
142 H -1 Conditionals Essential feature for a computer language Conditional Statement: allows the computer to choose between several paths depending on.
Computer Programming TCP1224 Chapter 5 The Selection Structure.
CS 206 Introduction to Computer Science II 10 / 02 / 2009 Instructor: Michael Eckmann.
Beginning Fortran Introduction 13 October 2009 *Black text on white background provided for easy printing.
LISTS. LEARNING OBJECTIVES Create a block that accepts a parameter Create a block that returns a value Create scripts that manipulates lists Incorporate.
Reading from a file, Sorting, and a little Searching Data Structures and Algorithms CS 244 Brent M. Dingle, Ph.D. Department of Mathematics, Statistics,
3.1.3 Program Flow control Structured programming – SELECTION in greater detail.
PHY 107 – Programming For Science. Announcements no magic formulas exist  Need to learn concepts: no magic formulas exist  Single solution not useful;
Starter – Its the small things in life What’s wrong with this code Height = 10 Width = 10 A = Height * Width Print A Remember to check: Spelling Spacing.
DIGITAL ELECTRONICS. Everything in digital world is based on binary system. Numerically it involves only two symbols 0 or 1. –0 = False = No –1 = True.
Conditional statements and boolean expressions Arithmetic, relational and logical operators.
CSC 107 – Programming For Science. Announcements  Lectures may not cover all material from book  Material that is most difficult or challenging is focus.
PYTHON PROGRAMMING Week 3 - Tuesday. STARTER Hour of Code Video.
1 COMS 261 Computer Science I Title: C++ Fundamentals Date: September 15, 2004 Lecture Number: 11.
For Loop GCSE Computer Science – Python. For Loop The for loop iterates over the items in a sequence, which can be a string or a list (we will discuss.
Lesson 6 Binary Understand what Binary Code means and apply this knowledge Understand how data is represented using bit systems and be able to change decimal.
Conditionals.
Introduction to programming in java Lecture 11 Boolean Expressions and Assignment no. 2.
Computer Science Up Down Controls, Decisions and Random Numbers.
Introduction to C++ Programming Language
Chapter 4: Decision Structures and Boolean Logic
Number Line Where are you on the learning journey?
Python I/O.
Intro to Computer Science CS1510 Dr. Sarah Diesburg
Scratch: selection / branching/ if / If…else / compound conditionals / error trapping by Mr. Clausen.
Chapter 4: Decision Structures and Boolean Logic
Design and Implementation
GCSE Computer Science – Logic Gates & Boolean Expressions
Computer Science Core Concepts
Binary Logic.
Lecture 5 Binary Operation Boolean Logic. Binary Operations Addition Subtraction Multiplication Division.
Programming In Lesson 4.
Truth tables Mrs. Palmer.
Evaluating Boolean expressions
Compound Conditionals
Computer Programming Basics
Midterm Review October 23, 2006 ComS 207: Programming I (in Java)
Selection—Making Decisions
Topics discussed in this section:
Function Notation.
Chapter 4: Decision Structures and Boolean Logic
Presentation transcript:

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

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.

Computer Science Constants_variables and data types 2

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

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

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

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

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

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”)

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“)

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

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

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

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

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"

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"

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"

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"

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

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.

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.