AMAT 2120 Quiz 1 (Oct.24, 2005): Descriptive statistics

Quiz questions in   [pdf]   and [ps]   format
Questions with Answers and Comments [pdf]   [ps]

Statistics

(43 students wrote the quiz. The only question where democratic voting would fail to elect the best candidate was (d).)

Question (a): The term byte means
1 [certain type of C variables] 0
2 [certain type of variables in a programming language other than C] 0
3 [8 bits] 40
4 [256 bits] 3
5 [the range of integers from -128 to +127.] 0

Question (b): If the variable n is int and the variable x is float, then the assignment n=x;
1 [will cause compilation error] 8
2 [is safe and sound] 2
3 [will pass compilation but may lead to a mathematical error due to roundoff effect] 21
4 [will cause no problems for the program, but isn't best in terms of style; better use the explicit cast: n=(int)x;] 12

Question (c): Assuming that x is a variable of type int, the value of 0 && x is
1 [always 0] 22
2 [0 or 1 depending on the value of x] 21
3 [0 or x depending on the value of x] 0
4 [unpredictable] 0

Question (d): The statement #define _DEBUG is
1 [preprocessor directive] 13
2 [definition of function] 0
3 [declaration of the variable _DEBUG] 13
4 [instruction to the compiler to process the code in debugging mode] 17

Question (e): The command cd without arguments
1 [changes current directory to the root directory] 16
2 [changes current directory to user's home directory] 26
3 [creates an unnamed directory] 1
4 [creates root directory] 0