1.1 Which of the following statements is true?
(a) hardware controls software
(b) software commands the computer to perform actions and make decisions
(c) C is an object oriented programming language
(d) Both (b) and (c)
1. What is a single item in an array called?
Answer: an array element
2. How do we refer to the third element in an array called prices?
3. Declare an array called listOfNames that contains 5 peoples names.
1. What is a stream?
Answer: A sequence of characters for input or output.
2. What is the name of the standard output stream?
3. What is the symbol for the stream extraction operator?
4. What symbol do we use
1. Write the first two lines of the class definition for a template class called change.
Answer: template <class T>
2. If a template class called collection has been defined, write the declaration of a
1. Name the two sections of a class:
Answer: public, private
2. An object is a(n) _ of a class.
3. What C+ construct is used to define and implement an abstract data type?
4. What is the first line o
1. What are the four predefined data types of C+?
Answer: int, float, char, bool
2. Write the compiler directive that is equivalent to the following line of code:
const monthsInYear = 12;
Answer: #define monthsInYear 12
3. What are
1. Why are recursive functions an important tool in programming?
Answer: Because recursion often provides a simple solution to an otherwise difficult
2. What is a recursive function?
Answer: A function that calls itself.
1. What is the difference between static and dynamic data structures?
Answer: A dynamic data structure can change in size as a program executes. A static
data structures size is fixed at compilation.
2. A memory cell that stores t
1. What is the part of the loop that contains the statements to be repeated called?
Answer: The loop body
2. What is the value of x after execution of the following code segment?
int ctr = 0;
int x = 3;
while (ctr < 2)
x = x
1. What kind of parameter do you use if you want a function to return more than one
Answer: A reference parameter.
2. What is the value of x after the following function call, given the function definition
1. What symbol indicates that the following line is a comment?
Answer: / (or /*)
2. What are the two kinds of statements inside a function?
Answer: Declaration statements and executable statements
3. What does the following stateme
1. What was John von Neumanns contribution to computing?
Answer: The stored-program computer.
2. What is time-sharing?
Answer: Many users share one computer simultaneously.
3. What is software?
Answer: The programs or instructions
Multi-tasking allows a single CPU to run many programs at the same time. [True]
Pre-emptive multi-tasking uses a hardware interrupt to instruct the CPU to run another program such as the operating system.