Please answer each question fully, carefully and thoughtfully.
No credit will be given for unreadable answers, please write neatly.
Answer the questions in any order, but please number each answer.
Make sure that your name is on your test.
(10 points) For the data types float and int
Describe each type.
Discuss where each type should be used.
(when you need an integer is insufficient)
Show how to declare a variable of each type.
(6 points) What is type casting? What is coercion? Which should
be employed when writing programs? Why?
(5 points) What is operator presidence? How is operator presidence
overridden by the use of parenthesis? Give an example.
(4 points) Trace the execution of the following code segment
int a, b, c, d;
float x=2.0;
a = 4;
b = a/x;
c = y/a;
x = 5/3;
(5 points) What is the setw() function? Describe the operation and
give examples of the use of this function. (Your examples should include both code and example output to accompany this code).
(3 points) Describe the operation of the following code.