{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Lecture Notes 9

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

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

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

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

View Full Document
ultimate check Tester main method read string tell user output Boolean expression -consist of boolean variable, literals, operations. Evaluate to T/F
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

{[ snackBarMessage ]}