Lab 2: Prelab Questions

Write out your answers for these questions on a separate piece of paper.


Written 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 Home Page | Lab Exercise | Homework Projects
© 2003 by Prentice Hall. All rights reserved.
Report all errors to Jeremy D. Frens.