Test Bank for Problem Solving with C++: The Object of Programming, 8/e

Chapter 1 Introduction to Computer and C++ Programming

SHORT ANSWER

  1. A set of instructions that the computer will follow is called a ______.

Answer: program

  1. The collection of programs used by the computer is known as ______.

Answer: software

  1. Computers that are interconnected are known as a ______.

Answer: network

  1. A digit that can hold a zero or a one is known as a ______.

Answer: bit

  1. List at least two input devices ______.

Answer: keyboard, mouse, network card, file

  1. List at least two output devices ______.

Answer: screen, printer, file, network card

  1. A variable that can hold a whole number is called a(n) ______.

Answer: integer

  1. What punctuation signifies the end of a C++ statement? ______

Answer: A semicolon.

  1. A mistake in a computer program is called a ______.

Answer: bug

  1. A ______is the program that translates a program written in C++ into machine language.

Answer: compiler

  1. Errors in a program can be classified into three types, list them

Answer: Syntax, logic,run-time

  1. What does the following statement in C++ print to the screen?

cout < “Hello students\n”;

Answer: Hello students.

  1. A mistake that is a direct violation of the syntax rules will generate a compiler ______.

Answer: error

  1. If your program compiles and runs, but gives an incorrect output, this is known as a ______error.

Answer: logic

  1. The part of the computer that controls and executes programs is called the ______.

Answer: CPU

MULTIPLE CHOICE

  1. Who was the programmer for Charles Babbage’s analytical engine?
  2. Grace Hopper
  3. Ada Lovelace
  4. Lord Bryan
  5. Walter Savitch

Answer: B

  1. An algorithm is
  2. The inputs and outputs of a program
  3. The part of the computer that does the processing
  4. A finite set of steps to solve a problem
  5. A complete computer program

Answer: C

  1. A memory address is
  2. Where a variable is stored
  3. Where the computer is located
  4. A step in the program.
  5. Where the CPU is stored.

Answer: A

  1. A computer that is normally used by only one person at a time is called a
  2. Server
  3. Mainframe
  4. Personal Computer
  5. Network

Answer: C

  1. The physical machines that make up a computer is called the
  2. Software
  3. Network
  4. Devices
  5. CPU
  6. Hardware

Answer: E

  1. Which of the following is not a phase of the program-design process?
  2. Problem-solving
  3. Implementation
  4. Marketing the final program

Answer: C

  1. Which of the following is not part of the Software Life Cycle?
  2. Analysis
  3. Design
  4. Data Entry
  5. Implementation
  6. Testing

Answer: C

  1. From which language did C++ directly evolve?
  2. A
  3. Ada
  4. C
  5. C+
  6. C-

Answer: C

  1. What does the following line of code display to the screen?

cout < “This is the computer\n programming book\n”;

  1. This is the computern programming book
  2. This is the computer
  3. Nothing
  4. This is the computer

programming book

Answer: D

  1. C++ statements end with a
  2. Period
  3. Comma
  4. Semicolon
  5. Nothing

Answer: C

  1. Which of the following is not an example of a program bug?
  2. Run-time error
  3. Operator error
  4. Syntax error
  5. Logic error

Answer:B

  1. What does the following code print to the screen?

cout < “hello”;

  1. Hello
  2. hello
  3. HELLO
  4. Nothing

Answer: B

  1. The set of instructions that a computer will follow is known as:
  2. Hardware
  3. Algorithm
  4. Program
  5. CPU

Answer: C

  1. The anagram CPU stands for
  2. Computer Programming Unit
  3. Central Processing Unit
  4. Central Program User
  5. Computer Paper User

Answer: B

  1. The output of the compiler is called
  2. The program
  3. Source code
  4. Linked code
  5. Object code

Answer:D

  1. The term OS stands for
  2. Operating System
  3. Oscillating System
  4. Operations Services
  5. Nothing

Answer: A

  1. Who designed the first programmable computer?
  2. IBM
  3. Microsoft
  4. Intel
  5. Babbage
  6. Dell

Answer: D

  1. A finite sequence of precise instructions that leads to a problem solution is
  2. A program
  3. The CPU
  4. A List of Inputs and Outputs
  5. An Algorithm

Answer: D

  1. Who developed C++?
  2. Bjarne Stroustrup
  3. Ken Thompson
  4. Charles Babbage
  5. Ada Lovelace

Answer: A

  1. One of the biggest difference between C and C++ is:
  2. C is object-oriented
  3. C++ is object-oriented
  4. All C++ programs are also C programs
  5. C only runs on UNIX computers

Answer: B

  1. int number;
  2. is an output statement
  3. is an input statement
  4. is a variable declaration
  5. is a program

Answer: C

  1. cout < “How many items would you want?\n”;
  2. is an output statement
  3. is an input statement
  4. is a variable declaration
  5. is a program

Answer: A

  1. cin > number;

  1. is an output statement
  2. is an input statement
  3. is a variable declaration
  4. is a program

Answer: B

  1. What does the following print to the screen?

cout < “Hello Students/n”;

  1. Hello Students
  2. hello Students
  3. HELLO STUDENTS
  4. Hello Students/n

Answer:D

  1. #include <iostream>
  2. is a variable declaration
  3. an executable statement
  4. an include directive
  5. illegal code

Answer: C

  1. A byte consists of how many bits?
  2. 6
  3. 7
  4. 8
  5. 9
  6. 10

Answer: C

  1. What is wrong with the following statement?

cout < “Hello to everyone\n”

  1. cout should be count
  2. missing a semicolon
  3. missing a “
  4. missing a (

Answer: B

  1. What is wrong with the following statement?

cout < “Hello to everyone\n;

  1. cout should be count
  2. missing a semicolon
  3. missing a “
  4. missing a (

Answer: C

  1. C++ is an example of a
  2. Machine language
  3. High-level language
  4. Low-level language
  5. Assembly language

Answer: B

  1. RAM stands for
  2. Read access memory
  3. Random access memory
  4. Really atrocious memory
  5. A hard drive

Answer: B

TRUE/FALSE

  1. Grace Hopper discovered the first documented computer bug.

Answer: TRUE

  1. The following statement is legal:

cout > “Hello, my name is Bill\n”;

Answer: FALSE

  1. You should write your program before you write the algorithm.

Answer: FALSE

  1. It is considered better style to put the braces ({}) on separate lines.

Answer: TRUE

  1. The compiler will catch all your programming mistakes.

Answer: FALSE

  1. C++ is a low-level language.

Answer: FALSE

  1. Main memory holds its data if the computer is turned off

Answer: FALSE

  1. An algorithm is always written in C++

Answer: FALSE

  1. There are 8 bytes in one bit.

Answer: FALSE

  1. The printer is an example of an input device.

Answer: FALSE

1