2005 Mar 15 C++ Lessons by Nick Morrow Lesson 1 Quiz 1 (now with answers added) If you haven't studied lesson 1 you can find it in the Files section here: http://groups.yahoo.com/group/CPlusPlusforeCSandOS2 Questions: 1. Which of the following is not a proper variable name? A. number_of_widgets B. x C. process629 D. 2004_total_expenses Answer: D. It is not proper to start a C++ variable name with a number. 2. Assuming you have a variable named "total_widgets" of type "int", which of the following in not a proper way to declare this variable? A. int total_widgets; B. int total_widgets = 0 C. int total_widgets = 0; D. int total_widgets = 4; Answer: B. There should be a ";" at the end of the statement. 3. Is the variable "myVar" the same variable as "myvar"? A. Yes B. No Answer: B. Case does matter in C++. Be careful, this isn't REXX! 4. The following is not a good example of declaring more than one like type variable: A. float var1 = 0.0; float var2 = 0.0; B. float var1 = 0.0, var2 = 0.0; C. float var1, float var2 D. float var1, var2; Answer: C. There should be a ";" at the end of the second statement. C++ statements require a semicolon at the end of statements. This is not optional.