CIS 757 757BOOLE Prof. Auciello
Truth Table AND
OR
Try It!
A
AND B
Result
A
B
A and B
A
B
A OR B
1
1
1
1
1
1
1
0
0
1
0
0
0
1
0
0
1
0
0
0
0
0
0
0
Assignment: "Hack" this program, experiment. Use it and understand it completely.
100boole -- explain each statement in English.
Excellent Reference Page: http://www.w3schools.com/js/js_obj_boolean.asp
Further work with Boolean: http://www.quirksmode.org/js/boolean.html
Questions:
Where is input value stored?
Note: Outline of Program is:
HEAD
SCRIPT
get input
calculate.
display result.
/SCRIPT
/HEAD
BODY
define input fields.
provide action to calculate result.
define output field.
/BODY
What connects the result field with the output box?
Further Activities:
1. Implement OR Operations
2. Error-Trap (validate input) to allow only 0 or 1 to be entered. (acknowledgement to Fernando Mendez , assisting with error-trapping).