Wyo C++ - Chapter 7 Resources

Chapter 7 Objectives

Chapter 7 Vocabulary

Chapter 7 Lecture Notes

Ch. 7 Programming Assignment

"On the Net" Topics (textbook Web site)

Ch. 7 Demo Program #1- to illustrate how C++ treats arithmetic and Boolean expressions. The program also illustrates the use of a couple relational and logical operators.

Ch. 7 Demo Program #2 - to illustrate the use of common logical and relational operators

Ch. 7 Demo Program #3 - to illustrate the use of the if statement

Ch. 7 Demo Program #4 - to illustrate common errors related to the use of the C++ if statement

Ch. 7 Demo Program #5 - to illustrate the use of the switch structure

Ch. 7 Worksheet #1 - control expressions, if statements, switch structures

Ch. 7 Worksheet #2 - if statements, control expressions

Ch. 7 Worksheet #3 - not online

Ch. 7 Worksheet #4 - string parsing

As a class, build several demonstration programs that ...

  • use an if statement
  • use an if/else statement
  • use an if/else if/else if statement
  • use an if/else if/else if/else statement
  • use various logical operators such as !, &&, and || in the control expression of an if
  • use various relational operators including <, >, <=, >=, ==, !=
  • use a single variable with no other operators in an if statement control expression
  • use a bool variable with an if statement
  • use nested if statements and discuss the difference between them and using && in a single if statement
  • use an if statement along with the mod operator to test whether a number less than 30 is prime
  • use a switch structure with a menu
  • use a switch structure that purposefully does not include break statements in every case