Home > Articles > Programming > C/C++

  • Print
  • + Share This
This chapter is from the book


The Workshop provides quiz questions to help you solidify your understanding of the material covered and exercises to provide you with experience in using what you've learned. Try to answer the quiz and exercise questions before checking the answers in Appendix D, and make sure that you understand the answers before continuing to the next chapter.


1. What is the difference between an integer variable and a floating-point variable?

2. What are the differences between an unsigned short int and a long int?

3. What are the advantages of using a symbolic constant rather than a literal constant?

4. What are the advantages of using the const keyword rather than #define?

5. What makes for a good or bad variable name?

6. Given this enum, what is the value of BLUE?

enum COLOR { WHITE, BLACK = 100, RED, BLUE, GREEN = 300 };

7. Which of the following variable names are good, which are bad, and which are invalid?

  1. Age
  2. !ex
  3. R79J
  4. TotalIncome
  5. __Invalid


  1. What would be the correct variable type in which to store the following information?

    1. Your age.
    2. The area of your backyard.
    3. The number of stars in the galaxy.
    4. The average rainfall for the month of January.
  1. Create good variable names for this information.

  2. Declare a constant for pi as 3.14159.

  3. Declare a float variable and initialize it using your pi constant.

  • + Share This
  • 🔖 Save To Your Account