Difference between revisions of "Logical operators assignment"

From WLCS
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
'''Directions:'''
+
==Directions==
# Open a text editor (Applications->Accessories->gEdit Text Editor)
+
# Open a Google Doc
 +
# Title the file: Logical Operators Assignment
 
# Put your name at the top
 
# Put your name at the top
# Save the file as YOURLASTNAME_logic.txt
+
# Complete the exercises below in this file
# Complete the exercises below in this file.  If you use DrPython, then be sure to copy your code back into this file
 
 
# Be sure to number each of your answers!!
 
# Be sure to number each of your answers!!
 
+
# Submit your assignment via Canvas
'''References:'''
+
==References==
 
* [[Media:BooleanLogic.ppt]]
 
* [[Media:BooleanLogic.ppt]]
  
'''Exercises:'''
+
==Exercises==
 
* Evaluate and simplify the following as True or False
 
* Evaluate and simplify the following as True or False
 
# not(False)
 
# not(False)
Line 23: Line 23:
 
# not(True) or True
 
# not(True) or True
  
'''Submit:'''
+
* Evaluate the following comparisons with logic operators (assume x = 2; y = 5)
* Submit the file to [http://wlhs.schoolweblockers.com/ School Web Lockers]
+
# x + 2 > y or y < 10
 +
# not(x < y) and y > 2 * x
 +
# y > 0 and y < 10 or x > 10 and x < 20
 +
# x + y != 5 and x - y < 0
 +
# x == 2 and y != 5
 +
# x != y or y >= x
 +
# not(x == 2 and y == 5)
 +
# x != 2 or y != 2
 +
 
 +
==Submit==
 +
* Submit your assignment via Canvas

Latest revision as of 06:04, 25 September 2018

Directions

  1. Open a Google Doc
  2. Title the file: Logical Operators Assignment
  3. Put your name at the top
  4. Complete the exercises below in this file
  5. Be sure to number each of your answers!!
  6. Submit your assignment via Canvas

References

Exercises

  • Evaluate and simplify the following as True or False
  1. not(False)
  2. True or False
  3. False and False
  4. True and False
  5. not(True or False)
  6. True or True
  7. False and True
  8. False or True
  9. not(False) and True
  10. not(True) or False
  11. not(True) or True
  • Evaluate the following comparisons with logic operators (assume x = 2; y = 5)
  1. x + 2 > y or y < 10
  2. not(x < y) and y > 2 * x
  3. y > 0 and y < 10 or x > 10 and x < 20
  4. x + y != 5 and x - y < 0
  5. x == 2 and y != 5
  6. x != y or y >= x
  7. not(x == 2 and y == 5)
  8. x != 2 or y != 2

Submit

  • Submit your assignment via Canvas