This content has been marked as final.
Show 7 replies


2. Re: Truth Tables
Mush15 Jul 14, 2008 10:09 AM (in response to soldier43)You perform the operation dictated by the logic in each task to find the value of X
so if for example X = A+B, simply add the value of A and B to find X 
3. Re: Truth Tables
soldier43 Jul 14, 2008 4:14 PM (in response to Mush15)but lets say, with problem 1...
X = a + b + c
what happens when
a = 0
b = 1
c = 1
x can't be 2.. would it just be 1? 
4. Re: Truth Tables
Mush15 Jul 15, 2008 5:03 AM (in response to soldier43)EX
var a:int = 0;
var b:int = 1;
var c:int = 1;
var d:int = a+b+c;
// d = 2 
5. Re: Truth Tables
soldier43 Jul 21, 2008 6:36 PM (in response to Mush15)this is more so boolean math instead of just simply adding numbers. 0 = false, 1 = true. my professor explained the logic behind this and i understand it now. thanks for trying your hand at helping me out. 
6. Re: Truth Tables
GraspDiver Jul 22, 2008 8:31 AM (in response to soldier43)A truth table is a matrix (no not a movie). Say you have an alarm on a chicken coop door and you want to know when the chickens are in the coop and when the door is open to warn you that a fox could get in. The truth table shows the states of the door (open or closed) and the states of the chickens (in or out). so your truth table would be:
doorOpen doorClosed
chickensIn 1 0
chickensOut 0 0
the only time the alarm would go off is when the chicken are in the coop and the door is open. so your code would be:
if (chickensIn and doorOpen) {goCleseThe Door;} 
7. Re: Truth Tables
GraspDiver Jul 22, 2008 8:34 AM (in response to soldier43)ok, the replay screwed up the formatting, but hopefully u get the drift.