Lab 2: Prelab Questions

Question #1: It is the ____________ compiler error that matters the most.

Question #2: A variable declaration consists of three things: a type, a(n) ____________, and an optional ____________.

Question #3: Integers are represented by the ____________ data type.

Question #4: The values 3.14159 and 2.998e8 are valid ____________ literals.

Question #5: How can you tell the difference between a char literal and a string literal?

Programming Exercises

Code #1: Write declarations for double variables, x and y, initialized to 3.1 and 5.667, respectively.

Code #2: Write declarations for char variables, ch1 and ch2, initialized to 'a' and 'Z', respectively.

Code #3: Write declarations for string variables, str1 and str2, initialized to "Samson" and "Delilah", respectively.

Code #4: Write declarations for int constants, CONST1 and CONST2, initialized to your favorite integers.


Lab Exercise
Report errors to Larry Nyhoff (nyhl@cs.calvin.edu)