Assignment 6
This assignment is worth 10 points.
Objectives
- When you finish this assignment you should be able to
- Describe the int and float data types.
- Identify the operations associated with int and float data types.
- Describe coercion and type casting.
- Read chapter 3, Don't worry about 3.8 as we will be covering that later.
- Define the following:
- Coercion
- Type Casting
- Numeric Overflow
- Round Off Error
- What is the result of running the following code? Why does the result occur?
-
int a;
float b = 4.9;
a = b;
-
float a;
a = 4/5;
-
int a=015;
cout < < a << endl;
- How can a floating point number be converted to an integer with rounding?
- What happens when the stream insertion operator is used to read
- An integer?
- A floating point number?