Assignment 6

This assignment is worth 10 points.

Objectives

  1. Read chapter 3, Don't worry about 3.8 as we will be covering that later.
  2. Define the following:
    1. Coercion
    2. Type Casting
    3. Numeric Overflow
    4. Round Off Error
  3. What is the result of running the following code? Why does the result occur?
    1. int a;
      float b = 4.9;
      
      a = b;
             
    2. float a;
      
      a = 4/5;
             
    3. int a=015;
      cout < < a << endl;
             
  4. How can a floating point number be converted to an integer with rounding?
  5. What happens when the stream insertion operator is used to read
    1. An integer?
    2. A floating point number?