Lecture Notes 9

Lecture Notes 9 - True/False x- Boolean variable (T/F)...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Wednesday October 7, 2009 Lecture 9 Flipping a coin public class Coin { private int face; public final int HEADS=0; public final in TAILS=1: public Coin ( ) { flip( ); } public void flip ( ) { face = (int) (Math.random ( ) *2); } public Boolean isHeads ( ) { return (face ==HEADS); } } NOTES read string processing/checking ultimate check tell user whether it’s good or bad Card process/checking
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
ultimate check Tester main method read string tell user output Boolean expression -consist of boolean variable, literals, operations. Evaluate to T/F
Background image of page 2
Background image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: True/False x- Boolean variable (T/F) Conjunction (and) . ^ (in java & &) Disjunction (or) +v Negation(not) x (line on top of x) a b a.b T T T F T F T F F F F F a b a+b T T T F T T T T T F F F a a T F F T a b c (a+b) ^ (b.c) T T T F F T F T T F T T F T F F F F T T F T T F F F F T F F F T F F F F F F F T F Boolean gates http://en.wikipedia.org/wiki/Logic_gate NOT OR AND...
View Full Document

This note was uploaded on 08/18/2011 for the course COMS W1004 taught by Professor Cannon during the Spring '09 term at Columbia.

Page1 / 3

Lecture Notes 9 - True/False x- Boolean variable (T/F)...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online