Test 1, Summer 2009

  1. (2 points) What is an editor?
  2. (2 points) What is a compiler?
  3. (6 points) Draw a diagram and describe the phases of the program development cycle.
  4. (6 points) Describe the rules C++ imposes for declaring a variable. Describe the style conventions the book adopts for declaring a variable. Give examples of each.
  5. (6 points) What does it mean to initialize a variable. Show two different ways to declare and initialize a variable. What happens when a variable is not initialized?
  6. (4 points) Name the four basic data types in C++. Give an example of each
  7. (2 points) short and long int are both integer types. What is the difference between them?
  8. (2 points) Describe the operation of the integer division and mod operators.
  9. (4 points) Write a series of C++ statements which will correctly calculate and round the following equation: C = 5/9(F-32). Assume both C and F are integers.
  10. (10 points) Write a complete C++ program that prompts the user for their first name, and produces the following output. (Assume Dan was input)
    Hello Dan!
    Did you know the first letter of your name is D?
    Did you know your name is 3 characters long?
  11. (6 points) Write a complete C++ program which has three integers stored as constants. Your program should compute, and output, the sum and average of these three integers. The output should be floating point numbers.