Quiz I (Spring 2018)
Quiz I (Spring 2018)
COE 212
Engineering Programming
Section I
Spring 2018
W. FAWAZ
Quiz I
Problem I
5) Which of the following statements increments the value of the variable called
val by 10? Assume that the variable val was declared and initialized properly.
a. int y, z=9;
y = z++;
val += y;
b. int y = 19, z;
y%=10;
z = ++y;
val += z;
c. Both of the above
d. None of the above
Problem II
2. Consider the following statement where a Scanner object called scan is used
to obtain a value from the end user. Assume that scan was created properly.
String val = scan.nextLine();
This statement produces a run-time error if the end user types a decimal
value of 23.5 and then hits the return key (Enter).
Answer: True False