Test 1 CSCI 130 Fall 2013


  1. Algorithms
    1. [2 points] What is an algorithm? Give the definition.
    2. [4 points] Why is it important to develop and algorithm before you implement a program in code?
  2. Programming Tools
    1. [2 points] What is the purpose of a compiler?
    2. [2 points] What is a secondary purpose of a compiler?
  3. Identifiers
    1. [2 points] What is an identifier?
    2. [1 point each] Identify each identifier as valid. If an identifier is invalid, state why.
      1. char
      2. dogsForSale
      3. 4Sale
      4. THE_BIG_NUMBER
      5. interest Rate
      6. xferate
  4. Variables
    1. [2 points] What is a variable?
    2. [2 points] How is a variable different from an identifier?
    3. [4 points] Give two conventions for naming a variable.
  5. Data Types
    1. [2 points] What is a data type?
    2. [4 points] Describe the char data type.
    3. [2 points] Give the code required to declare a character variable.
    4. [2 points] Give the code required to initialize the value of the character variable in the previous question to the lower case letter a.
  6. [4 points] Describe the performance of the stream extraction operator when used to read a character.
  7. [10 points] Write a complete program which will ask the user for a three letter word and print that word out in reverse. (You should NOT use strings for this program).