Test Bank for Problem Solving with C++: The Object of Programming, 8/e
Chapter 1 Introduction to Computer and C++ Programming
SHORT ANSWER
- A set of instructions that the computer will follow is called a ______.
Answer: program
- The collection of programs used by the computer is known as ______.
Answer: software
- Computers that are interconnected are known as a ______.
Answer: network
- A digit that can hold a zero or a one is known as a ______.
Answer: bit
- List at least two input devices ______.
Answer: keyboard, mouse, network card, file
- List at least two output devices ______.
Answer: screen, printer, file, network card
- A variable that can hold a whole number is called a(n) ______.
Answer: integer
- What punctuation signifies the end of a C++ statement? ______
Answer: A semicolon.
- A mistake in a computer program is called a ______.
Answer: bug
- A ______is the program that translates a program written in C++ into machine language.
Answer: compiler
- Errors in a program can be classified into three types, list them
Answer: Syntax, logic,run-time
- What does the following statement in C++ print to the screen?
cout < “Hello students\n”;
Answer: Hello students.
- A mistake that is a direct violation of the syntax rules will generate a compiler ______.
Answer: error
- If your program compiles and runs, but gives an incorrect output, this is known as a ______error.
Answer: logic
- The part of the computer that controls and executes programs is called the ______.
Answer: CPU
MULTIPLE CHOICE
- Who was the programmer for Charles Babbage’s analytical engine?
- Grace Hopper
- Ada Lovelace
- Lord Bryan
- Walter Savitch
Answer: B
- An algorithm is
- The inputs and outputs of a program
- The part of the computer that does the processing
- A finite set of steps to solve a problem
- A complete computer program
Answer: C
- A memory address is
- Where a variable is stored
- Where the computer is located
- A step in the program.
- Where the CPU is stored.
Answer: A
- A computer that is normally used by only one person at a time is called a
- Server
- Mainframe
- Personal Computer
- Network
Answer: C
- The physical machines that make up a computer is called the
- Software
- Network
- Devices
- CPU
- Hardware
Answer: E
- Which of the following is not a phase of the program-design process?
- Problem-solving
- Implementation
- Marketing the final program
Answer: C
- Which of the following is not part of the Software Life Cycle?
- Analysis
- Design
- Data Entry
- Implementation
- Testing
Answer: C
- From which language did C++ directly evolve?
- A
- Ada
- C
- C+
- C-
Answer: C
- What does the following line of code display to the screen?
cout < “This is the computer\n programming book\n”;
- This is the computern programming book
- This is the computer
- Nothing
- This is the computer
programming book
Answer: D
- C++ statements end with a
- Period
- Comma
- Semicolon
- Nothing
Answer: C
- Which of the following is not an example of a program bug?
- Run-time error
- Operator error
- Syntax error
- Logic error
Answer:B
- What does the following code print to the screen?
cout < “hello”;
- Hello
- hello
- HELLO
- Nothing
Answer: B
- The set of instructions that a computer will follow is known as:
- Hardware
- Algorithm
- Program
- CPU
Answer: C
- The anagram CPU stands for
- Computer Programming Unit
- Central Processing Unit
- Central Program User
- Computer Paper User
Answer: B
- The output of the compiler is called
- The program
- Source code
- Linked code
- Object code
Answer:D
- The term OS stands for
- Operating System
- Oscillating System
- Operations Services
- Nothing
Answer: A
- Who designed the first programmable computer?
- IBM
- Microsoft
- Intel
- Babbage
- Dell
Answer: D
- A finite sequence of precise instructions that leads to a problem solution is
- A program
- The CPU
- A List of Inputs and Outputs
- An Algorithm
Answer: D
- Who developed C++?
- Bjarne Stroustrup
- Ken Thompson
- Charles Babbage
- Ada Lovelace
Answer: A
- One of the biggest difference between C and C++ is:
- C is object-oriented
- C++ is object-oriented
- All C++ programs are also C programs
- C only runs on UNIX computers
Answer: B
- int number;
- is an output statement
- is an input statement
- is a variable declaration
- is a program
Answer: C
- cout < “How many items would you want?\n”;
- is an output statement
- is an input statement
- is a variable declaration
- is a program
Answer: A
- cin > number;
- is an output statement
- is an input statement
- is a variable declaration
- is a program
Answer: B
- What does the following print to the screen?
cout < “Hello Students/n”;
- Hello Students
- hello Students
- HELLO STUDENTS
- Hello Students/n
Answer:D
- #include <iostream>
- is a variable declaration
- an executable statement
- an include directive
- illegal code
Answer: C
- A byte consists of how many bits?
- 6
- 7
- 8
- 9
- 10
Answer: C
- What is wrong with the following statement?
cout < “Hello to everyone\n”
- cout should be count
- missing a semicolon
- missing a “
- missing a (
Answer: B
- What is wrong with the following statement?
cout < “Hello to everyone\n;
- cout should be count
- missing a semicolon
- missing a “
- missing a (
Answer: C
- C++ is an example of a
- Machine language
- High-level language
- Low-level language
- Assembly language
Answer: B
- RAM stands for
- Read access memory
- Random access memory
- Really atrocious memory
- A hard drive
Answer: B
TRUE/FALSE
- Grace Hopper discovered the first documented computer bug.
Answer: TRUE
- The following statement is legal:
cout > “Hello, my name is Bill\n”;
Answer: FALSE
- You should write your program before you write the algorithm.
Answer: FALSE
- It is considered better style to put the braces ({}) on separate lines.
Answer: TRUE
- The compiler will catch all your programming mistakes.
Answer: FALSE
- C++ is a low-level language.
Answer: FALSE
- Main memory holds its data if the computer is turned off
Answer: FALSE
- An algorithm is always written in C++
Answer: FALSE
- There are 8 bytes in one bit.
Answer: FALSE
- The printer is an example of an input device.
Answer: FALSE
1