Test 1 CSCI 130 Fall 2016


  1. Algorithms
    1. [3 points] Give the definition for an algorithm.
    2. [2 points] Describe why a programmer should develop and test an algorithm before beginning to code a solution.
  2. Program construction.
    1. [5 points] Give the code required for nearly all c++ programs.
    2. [1 point each] From the above code, give an example of each of the following program elements.
      • Reserved word
      • Standard identifier
      • Preprocessor directive
  3. Comments
    1. [2 points] Why should a programmer include comments in a program? (You said to is not an acceptable answer).
    2. [2 points] What happens to comments when a program is compiled?
    3. [2 points] Describe the behavior for comments included in /* */.
    4. [2 points] Describe the behavior for comments beginning with //
  4. Data Types
    1. [1 point each] Name four different data types.
    2. [2 points] What is a data type?
    3. [4 points] Select one data type and explain or demonstrate why it is a data type. (This answer should contain all elements of the previous answer.)
  5. [3 points] What is a syntax error?
  6. [6 points] We have discussed two major software tools needed to produce a working program. Name the broad class of each and describe the task each performs.
  7. Programming Conventions
    1. [2 points] Give an example of a syntax rule.
    2. [2 points] Give an example of a programming convention.
    3. [2 points] Explain the difference between a syntax rule and a programming convention.
    4. [4 points] Why should a programmer follow a programming convention?