

Applied Programming in C++
Chapter Exam Questions
Course Introduction
Applied Programming in C++ introduces students to the fundamental concepts and practical applications of programming using the C++ language. The course covers essential topics such as data types, control structures, functions, object-oriented programming, and standard libraries. Through hands-on projects and coding exercises, students develop problem-solving skills and gain experience in creating efficient and maintainable software. By the end of the course, participants will be able to design, implement, and debug C++ programs to solve real-world computational problems.
Recommended Textbook C++ Programming From Problem Analysis to Program Design 8th Edition by
Available Study Resources on Quizplus
18 Chapters
751 Verified Questions
751 Flashcards
Source URL: https://quizplus.com/study-set/3129 Page 2

D. S. Malik

Chapter 1: An Overview of Computers and Programming Languages
Available Study Resources on Quizplus for this Chatper
40 Verified Questions
40 Flashcards
Source URL: https://quizplus.com/quiz/62002
Sample Questions
Q1) Main memory is an ordered sequence of items, called ____.
A) pixels
B) registers
C) memory cells
D) addresses
Answer: C
Q2) A step-by-step problem-solving process in which a solution is arrived at in a finite amount of time is called a(n) ____.
A) algorithm
B) linker
C) analysis
D) design
Answer: A
Q3) The ____________________ handles the overall activity of the computer and provides services such as memory management, input/output activities, and storage management.
Answer: operating system
OS
Q4) The ASCII data set consists of ____________________ characters. Answer: 128
To view all questions and flashcards with answers, click on the resource link above. Page 3

Chapter 2: Basic Elements of C++
Available Study Resources on Quizplus for this Chatper
50 Verified Questions
50 Flashcards
Source URL: https://quizplus.com/quiz/62003
Sample Questions
Q1) ____________________ is the process of planning and creating a program. Answer: Programming programming
Q2) An operator that has only one operand is called a unique operator.
A)True
B)False
Answer: False
Q3) The escape sequence \r moves the insertion point to the beginning of the next line.
A)True
B)False Answer: False
Q4) A comma is also called a statement terminator.
A)True
B)False
Answer: False
Q5) The maximum number of significant digits in values of the double type is 15.
A)True
B)False
Answer: True
To view all questions and flashcards with answers, click on the resource link above. Page 4

Chapter 3: Inputoutput
Available Study Resources on Quizplus for this Chatper
40 Verified Questions
40 Flashcards
Source URL: https://quizplus.com/quiz/62004
Sample Questions
Q1) Manipulators without parameters are part of the ____ header file.
A) iostream
B) iomanip
C) ifstream
D) pmanip
Answer: A
Q2) Suppose that ch1, ch2, and ch3 are variables of the type char. The input is: A B C
Choose the value of ch3 after the following statement executes:
Cin >> ch1 >> ch2 >> ch3;
A) 'A'
B) 'B'
C) 'C'
D) '\n'
Answer: C
To view all questions and flashcards with answers, click on the resource link above.
Page 5

Chapter 4: Control Structures I Selection
Available Study Resources on Quizplus for this Chatper
40 Verified Questions
40 Flashcards
Source URL: https://quizplus.com/quiz/62005
Sample Questions
Q1) Suppose x is 5 and y is 7. Choose the value of the following expression: (x != 7) && (x <= y)
A) false
B) true
C) 0
D) null
Q2) Putting ____________________ in front of a logical expression reverses the value of that logical expression.
Q3) Which of the following will cause a logical error if you are attempting to compare x to 5?
A) if (x == 5)
B) if (x = 5)
C) if (x <= 5)
D) if (x >= 5)
Q4) Which of the following is the "not equal to" relational operator?
A) !
B) |
C) !=
D) &
To view all questions and flashcards with answers, click on the resource link above. Page 6

Chapter 5: Control Structures II Repetition
Available Study Resources on Quizplus for this Chatper
40 Verified Questions
40 Flashcards
Source URL: https://quizplus.com/quiz/62006
Sample Questions
Q1) In the case of the sentinel-controlled while loop, the first item is read before the while loop is entered.
A)True
B)False
Q2) Which of the following statements generates a random number between 0 and 50?
A) srand(time(0));
Num = rand() % 50; B) srand(time(10));
Num = rand()/50;
C) srand(time(0));
Num = rand()50; D) srand(time(10));
Num = rand() % 50;
Q3) The statement in the body of a while loop acts as a decision maker.
A)True
B)False
Q4) The number of iterations of a counter-controlled loop is known in advance.
A)True
B)False
Q5) The function eof is a member of the data type ____________________.
Page 7
To view all questions and flashcards with answers, click on the resource link above.

Chapter 6: User-Defined Function
Available Study Resources on Quizplus for this Chatper
41 Verified Questions
41 Flashcards
Source URL: https://quizplus.com/quiz/62007
Sample Questions
Q1) The execution of a return statement in a user-defined function terminates the program.
A)True
B)False
Q2) Given the following function prototype: Double tryMe(double, double);
Which of the following statements is valid? Assume that all variables are properly declared.
A) cin >> tryMe(x);
B) cout << tryMe(2.0, 3.0);
C) cout << tryMe(tryMe(double, double), double);
D) cout << tryMe(tryMe(float, float), float);
Q3) Which statement below about prototypes and headers is true?
A) Parameter names must be listed in the prototype, but not necessarily in the header.
B) Prototypes end with a semicolon, but headers do not.
C) Headers should come before prototypes.
D) Headers end with a semicolon, but prototypes do not.
Q4) A function ____________________ is a function that is not fully coded.
To view all questions and flashcards with answers, click on the resource link above. Page 8

Chapter 7: Namespaces, the Class String, and
User-Defined Simple Data Types
Available Study Resources on Quizplus for this Chatper
40 Verified Questions
40 Flashcards
Source URL: https://quizplus.com/quiz/62008
Sample Questions
Q1) Suppose str = "xyzw";. After the statement str[2] = 'Y'; The value of str is "____".
A) xyzw
B) xYzw
C) xyYw
D) xzYw
Q2) The ____ function is used to interchange the contents of two string variables.
A) iterator
B) traverse
C) swap
D) change
Q3) Consider the declaration: Enum sports {BASKETBALL, FOOTBALL, HOCKEY, BASEBALL, SOCCER};
Which of the following statements is true?
A) SOCCER--=BASEBALL
B) BASEBALL++ = BOCCER
C) HOCKEY + FOOTBALL < SOCCER
D) FOOTBALL <= SOCCER
To view all questions and flashcards with answers, click on the resource link above. Page 9
Chapter 8: Arrays
Available Study Resources on Quizplus for this Chatper
40 Verified Questions
40 Flashcards
Source URL: https://quizplus.com/quiz/62009
Sample Questions
Q1) Which of the following correctly declares name to be a character array and stores "William" in it?
A) char name[6] = "William";
B) char name[7] = "William";
C) char name[8] = "William";
D) char name[8] = 'William';
Q2) If an array index goes out of bounds, the program always terminates in an error.
A)True
B)False
Q3) Consider the following declaration: char str[15];. Which of the following statements stores "Blue Sky" into str?
A) str = "Blue Sky";
B) str[15] = "Blue Sky";
C) strcpy(str, "Blue Sky");
D) strcpy("Blue Sky");
Q4) In C++, the null character is represented as ____.
A) '\0'
B) "\0"
C) '0'
D) "0"

Page 10
To view all questions and flashcards with answers, click on the resource link above.

Chapter 9: Records Structs
Available Study Resources on Quizplus for this Chatper
40 Verified Questions
40 Flashcards
Source URL: https://quizplus.com/quiz/62010
Sample Questions
Q1) To compare struct variables, you compare them ____.
A) by reference
B) by value
C) index-wise
D) member-wise
Q2) In structs, you access a component by using the struct name together with the relative position of the component.
A)True
B)False
Q3) Which of the following is an allowable aggregate operation on a struct?
A) Arithmetic
B) Assignment
C) Input/output
D) Comparison
Q4) An array name and index are separated using ____.
A) curly brackets
B) square brackets
C) a dot
D) a comma
Q5) A struct is a(n) ____________________, not a declaration.
To view all questions and flashcards with answers, click on the resource link above. Page 11

Chapter 10: Classes and Data Abstraction
Available Study Resources on Quizplus for this Chatper
43 Verified Questions
43 Flashcards
Source URL: https://quizplus.com/quiz/62011
Sample Questions
Q1) Consider the accompanying class definition. Which of the following variable declarations is correct?
A) rectangle rectangleType;
B) class rectangleType rectangle;
C) rectangleType rectangle; D) rectangle rectangleType.area;
Q2) In C++, you can pass a variable by reference and still prevent the function from changing its value by using the keyword ____ in the formal parameter declaration.
A) automatic
B) private
C) static
D) const
Q3) With ____________________ functions, the definitions of the member functions are placed in the implementations file.
Q4) A destructor has the character ____, followed by the name of the class. A) .
B) :: C) # D)
To view all questions and flashcards with answers, click on the resource link above. Page 12

Chapter 11: Inheritance and Composition
Available Study Resources on Quizplus for this Chatper
41 Verified Questions
41 Flashcards
Source URL: https://quizplus.com/quiz/62012
Sample Questions
Q1) Which of the following is true about a derived class?
A) A derived class can directly access any member variable of the base class.
B) A derived class can redefine any public member function of the base class.
C) A derived class can have at most one base class.
D) A derived class can redefine any member function of the base class.
Q2) The ____ members of an object form its internal state.
A) private
B) protected
C) public
D) static
Q3) A derived class can directly access the protected members of the base class.
A)True
B)False
Q4) A call to the base class's constructor is specified in the heading of the definition of a derived class constructor.
A)True
B)False
Q5) In ____________________ (aggregation), one or more members of a class are objects of another class type.
To view all questions and flashcards with answers, click on the resource link above. Page 13
Chapter 12: Pointers, Classes, Virtual Functions, and
Abstract Classes
Available Study Resources on Quizplus for this Chatper
43 Verified Questions
43 Flashcards
Source URL: https://quizplus.com/quiz/62013
Sample Questions
Q1) If p is a pointer variable, the statement p = p + 1; is valid in C++.
A)True
B)False
Q2) A memory leak is an unused memory space that cannot be allocated.
A)True
B)False
Q3) An array created during the execution of a program is called a(n) ____ array.
A) list
B) static
C) execution
D) dynamic
Q4) The copy constructor automatically executes when, as a parameter, an object is passed by ____________________.
Q5) The ____ operator can be used to return the address of a private data member of a class.
A) dereferencing
B) destructor
C) address of
D) member access

Page 14
Q6) The binding of virtual functions occurs at program ____________________ time.
To view all questions and flashcards with answers, click on the resource link above.
Page 15

Chapter 13: Overloading and Templates
Available Study Resources on Quizplus for this Chatper
41 Verified Questions
41 Flashcards
Source URL: https://quizplus.com/quiz/62014
Sample Questions
Q1) The only built-in operations on classes are assignment (=) and ____________________.
Q2) When the post-increment operator is overloaded as a nonmember function of the class, the operator function has ____ parameter(s).
A) no
B) one
C) two
D) three
Q3) The associativity of the operator = is from right to left.
A)True
B)False
Q4) The return type of the function to overload the operator >> must be a reference to a(n) ____ object.
A) iostream
B) ostream
C) stream
D) istream
Q5) The ____________________ operator causes a member-wise copy of the member variables of the class.
To view all questions and flashcards with answers, click on the resource link above. Page 16

Chapter 14: Exception Handling
Available Study Resources on Quizplus for this Chatper
42 Verified Questions
42 Flashcards
Source URL: https://quizplus.com/quiz/62015
Sample Questions
Q1) If you want to include members in your exception class, you typically include the function ____.
A) that
B) this
C) log
D) what
Q2) When division by zero occurs and the problem is not addressed, the program crashes with an error message that is ____ dependent.
A) code
B) computer
C) platform
D) IDE
Q3) The heading of a try block can contain ellipses in place of a parameter.
A)True
B)False
Q4) An exception is an occurrence of an undesirable situation that can be detected during program compilation.
A)True
B)False
To view all questions and flashcards with answers, click on the resource link above. Page 17

Chapter 15: Recursion
Available Study Resources on Quizplus for this Chatper
41 Verified Questions
41 Flashcards
Source URL: https://quizplus.com/quiz/62016
Sample Questions
Q1) The ____________________ Fibonacci number in a sequence is the sum of the second and third Fibonacci numbers.
Q2) If every recursive call results in another recursive call, then the recursive function (algorithm) is said to have ____ recursion.
A) unlimited
B) indefinite
C) infinite
D) tail
Q3) Consider the accompanying definition of a recursive function. What is the output of the following statement? cout << puzzle(3, 7) << endl;
A) 10
B) 21
C) 42
D) 420
Q4) In a recursive function, the base case stops the recursion.
A)True
B)False
Q5) Recursive algorithms are implemented using ____________________ functions.
To view all questions and flashcards with answers, click on the resource link above. Page 18

Chapter 16: Searching and Sorting
Available Study Resources on Quizplus for this Chatper
46 Verified Questions
46 Flashcards
Source URL: https://quizplus.com/quiz/62017
Sample
Questions
Q1) In the bubble sort algorithm, which code accomplishes swapping values in elements at positions index and index + 1?
A) list[index] = list[index + 1]
List[index + 1] = list[index]
B) list[index + 1] = list[index]
List[index] = list[index + 1]
C) list[index] = temp;
List[index] = list[index + 1];
Temp = list[index + 1];
D) temp = list[index];
List[index] = list[index + 1];
List[index + 1] = temp;
Q2) The sequential search algorithm does not assume that the list is sorted. A)True B)False
Q3) The type vector provides the function ____________________, which returns the first element in the vector object.
Q4) If you initially declare a vector object and do not specify its size, then in order to add elements to the vector object, we use the function ____________________.
To view all questions and flashcards with answers, click on the resource link above. Page 19
Chapter 17: Linked Lists
Available Study Resources on Quizplus for this Chatper
41 Verified Questions
41 Flashcards
Source URL: https://quizplus.com/quiz/62018
Sample Questions
Q1) You can use the pointer head of a linked list to traverse the list.
A)True
B)False
Q2) For classes that include pointer data members, the assignment operator must be explicitly ____________________.
Q3) We deallocate the memory for a linked list by calling the operator clear.
A)True
B)False
Q4) Data can be organized and processed sequentially using an array, called a(n) ____ list.
A) linked
B) ordered
C) sequential
D) ascending
Q5) Which of the following statements appears in the insert function of a doubly linked list?
A) current++;
B) trailCurrent++;
C) newNode++;
D) count++;

Page 20
To view all questions and flashcards with answers, click on the resource link above.

Chapter 18: Stacks and Queues
Available Study Resources on Quizplus for this Chatper
42 Verified Questions
42 Flashcards
Source URL: https://quizplus.com/quiz/62019
Sample Questions
Q1) In ____________________ notation, operators are written after the operands.
Q2) A queue is a First In First Out data structure. A)True
B)False
Q3) A technique in which one system models the behavior of another system is called
A) imitation
B) recursion
C) simulation
D) stimulation
Q4) If you try to add a new item to a full stack, the resulting condition is called a(n) ____.
A) override
B) overflow
C) overload
D) underflow
Q5) When describing a queuing system, we use the term ____________________ to refer to the time it takes to serve a customer.
Q6) The elements at the ____________________ of the stack have been in the stack the longest.
To view all questions and flashcards with answers, click on the resource link above. Page 21