You are on page 1of 1

Fall 2016: Lab 2

60-100 Key Concepts in Computer Science


School of Computer Science
University of Windsor
Due: In your lab section (Thursday, September 22 or Tuesday, September 27).
Re. pseudocode: A guideline has been posted to Blackboard under the section Resources that
summarizes the pseudocode syntax.
Hand in: handwritten or word processor.
[6 marks] Plot the three functions y=x2, y=2x2, y=x2+2 on the same X-Y graph for {x | -3 x 3}.
[6 marks] Write pseudocode for an algorithm to compute the minimum value of a list of integers.
[9 marks] Write pseudocode for an algorithm to compute the product of a list of integers.
[8 marks] Which of these are propositions?
a) Do not pass go.
b) There is no green bird in BC.
c) 4 + z = 7
d) Jupiter is made of water.
5. [9 marks] Let p, q, and r be the following propositions:
p: You have the flu.
q: You miss the midterm exam.
r: You pass the course.
1.
2.
3.
4.

Using the above propositions, write these compound propositions in English sentences:
a) p r
b) p q r
c) q r
6. [12 marks] Write the truth table for the following compound propositions:
a) (p q) r
b) (p q) r
c) r (p q)

You might also like