Quiz One

  1. What is the difference between a machine-language program and a high-level language program?

    A Machine-level language program is written in a form the computer can execute directly. A high-level language program is written in a form that is easy for a human being to write and read. A high-level language program must be translated into a machine-language program before the computer can execute it.

  2. What does a compiler do?

    A Compiler translates a high-level language program into a machine-language program.

  3. Who was the first programmer, according to Savitch?

    Ada Augusta, Countess of Lovelace and daughter of the poet Byron.

  4. What is an algorithm?

    An algorithm is a sequence of precise instructions that leads to a solution.

  5. What are the two main phases of software development?

    1. The problem solving phase

    2. The implementation phase

  6. List as many of the six steps in the software life cycle as you can:

    1. Problem Definition

    2. Algorithm Design

    3. Implementation

    4. Testing

    5. Maintenance and Evolution

    6. Obsolescence

  7. What are the following symbols used for in a C++ program?

    1. //

      Beginning of a comment to the end of the line

    2. ;

      End of statement

    3. { and }

      Begin and End of a Block of code

    4. " and "

      Begin and End of a String

    5. /* and */

      Begin and End of a multi-line comment

  8. What does each of the following statements do in a C++ program?

    1. int apples;

      A variable declaration: apples is an integer variable

    2. cout << "How many apples do you want?";

      Sends the string to the output stream

    3. cin >> apples;

      Reads input stream into the variable apples

    4. cout << "I will give you " << apples << " apples.";

      Concatenates the string and the value to the output stream

  9. Give an example of each of the following types of errors:

    1. syntax error

      Forgetting a semicolon at the end of a line

    2. runtime error

      Trying to divide a number by zero

    3. logic error

      Multiplying instead of adding two numbers