Wyo C++ - Chapter 5 Resources

Chapter 5 Objectives

Chapter 5 Vocabulary

Chapter 5 Lecture Notes

Chapter 5 Programming Assignment

Ch 5 Practice Test

"On the Net" Topics (textbook Web site)

Ch. 5 Demo Program #1 - to illustrate declaration, initialization, and assignment statements.

Ch. 5 Demo Program #2 - to illustrate promotion (implicit type conversion) and typecasting (explicit type conversion)

Ch. 5 Demo Program #3 - to illustrate the relationship between char and int datatypes as well as typecasting

Ch. 5 Demo Program #4 - to illustrate garbage values, typecasting, promotion, & using the int typecast operator to round.

Ch. 5 Demo Program #5 - to illustrate how to display with fixed format rather than scientific format

Ch. 5 Demo Program #6 - to illustrate underflow

Ch. 5 Demo Program #7 - to parse the digits in an integer

Ch. 5 Demo Program #8 - a rounding algorithm

Interactive Quiz - order of operations & operators

Ch. 5 Worksheet #1 - operators, order of operations

Ch. 5 Worksheet #2 - expressions, promotion, typecasting

Ch. 5 Worksheet #3 - find errors

Ch. 5 Worksheet #4 - identify as many operators as you can

Ch. 5 Worksheet #5 - statements, variables, etc.

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

  • uses parentheses to override the order of operations ("Please Excuse My Dear Aunt Sally")
  • uses the modulus operator ( % )
  • uses a compound operator such as +=
  • uses the incrementing operator ( ++ )
  • illustrates the unwanted effect of integer division
  • uses typecasting
  • uses promotion
  • illustrates integer overflow when you assign a value that is too large to an int variable
  • illustrates underflow when a floating-point value becomes too small (i.e. too close to 0) to be stored in a double variable
  • that uses a common rounding algorithm to round a floating-point value to the nearest tenth's place
  • obtains an integer value from the user using a cin statement, even though this is a Ch. 6 topic

  • prompts the user to input an integer value and then obtains that integer value from the user via the keyboard, even though this is a Ch. 6 topic