Difference between revisions of "CSC103: DT's Notes 1"
Line 1: | Line 1: | ||
--© [[User:Thiebaut|D. Thiebaut]] 08:10, 30 January 2012 (EST) | --© [[User:Thiebaut|D. Thiebaut]] 08:10, 30 January 2012 (EST) | ||
− | < | + | <onlysmith> |
=CSC103 How Computers Work--Class Notes= | =CSC103 How Computers Work--Class Notes= | ||
Line 115: | Line 115: | ||
T | T | ||
|} | |} | ||
+ | |||
+ | Let's keep our alarm example and think of how to program an alarm so that we can spend the morning in bed and not get up early on Saturdays and Sundays. We could have Statement ''a'' be "Today is Saturday", and Statement ''b'' be ''Today is Sunday". The boolean expression that will allow us to enjoy a morning in bed on weekends is ''a'' '''or''' ''b''. We can make our decision by saying: "if ''a'' '''or''' ''b'', we can stay in bed." On Saturdays, ''a'' is true, and the whole expression is true. On Sundays, ''b'' is true, and we can also stay in bed. On any other day, both ''a'' and ''b'' are false, and '''or'''-ing them together yields false, and we'd better get up early! | ||
+ | |||
+ | |||
+ | |||
− | |||
====Example==== | ====Example==== | ||
Line 188: | Line 192: | ||
=References= | =References= | ||
<references /> | <references /> | ||
− | </ | + | </onlysmith> |
<br /> | <br /> |
Revision as of 18:41, 30 January 2012
--© D. Thiebaut 08:10, 30 January 2012 (EST)