Difference between revisions of "CSC103: DT's Notes 1"

From dftwiki3
Jump to: navigation, search
Line 1: Line 1:
 
--© [[User:Thiebaut|D. Thiebaut]] 08:10, 30 January 2012 (EST)
 
--© [[User:Thiebaut|D. Thiebaut]] 08:10, 30 January 2012 (EST)
<onlydft>
+
<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!
 +
 +
 +
  
  
An example will illustrate this concept.
 
  
 
====Example====
 
====Example====
Line 188: Line 192:
 
=References=
 
=References=
 
<references />
 
<references />
</onlydft>
+
</onlysmith>
  
 
<br />
 
<br />

Revision as of 18:41, 30 January 2012

--© D. Thiebaut 08:10, 30 January 2012 (EST)


This section is only visible to computers located at Smith College