This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: 8. Write the truth table for the ! (not) operator. 9. What is De Morgan’s law? 10. How would you write a Boolean expression to test whether the value of the integer variable n was in the range 0 to 9, inclusive? CS1MD3 MidReview. 2 11. Describe in English what the following conditional expression means: (x != 4) || (x != 17) For what values of x is this condition true? 12. In the program in FIGURE 3-5, p. 87, how are the named constants de±ned? How does the program center the ±gure? Chapter 4 1. What for loop control line would you use in each of the following situations: a) Counting from 1 to 100. b) Counting by sevens starting at 0 until the number has more than two digits. c) Counting backward by twos from 100 to 0. 2. In the program in FIGURE 4-2, p. 104, how does the program add a list of integers using a sentinel?...
View Full Document
This note was uploaded on 10/27/2009 for the course COMP SCI 1MD3 taught by Professor Various during the Winter '07 term at McMaster University.
- Winter '07