

Applied Programming Techniques
Exam Questions
Course Introduction
Applied Programming Techniques explores practical approaches to software development, emphasizing advanced programming methodologies and their real-world applications. The course covers topics such as modular design, problem-solving strategies, debugging, code optimization, and the use of contemporary programming libraries and frameworks. Students engage in hands-on projects to implement robust algorithms, develop scalable solutions, and collaborate effectively using industry-standard tools. By the end of the course, students will have honed their ability to apply programming best practices to tackle complex challenges and create efficient, maintainable code.
Recommended Textbook
C++ Programming From Problem Analysis to Program Design 6th Edition by D.S.
Available Study Resources on Quizplus
18 Chapters
899 Verified Questions
899 Flashcards
Source URL: https://quizplus.com/study-set/1103 Page 2

Malik

Chapter 1: An Overview of Computers and Programming Languages
Available Study Resources on Quizplus for this Chatper
50 Verified Questions
50 Flashcards
Source URL: https://quizplus.com/quiz/128446
Sample Questions
Q1) A program that loads an executable program into main memory is called a(n)
A) compiler
B) loader
C) linker
D) assembler
Answer: B
Q2) The term ____________________ is used to describe a program that has been written in a high-level language.
Answer: source program
source code
source
Q3) The basic commands that a computer performs are input (get data), output (display result), storage, and performance of arithmetic and logical operations.
A)True
B)False
Answer: True
Q4) A sequence of 0s and 1s is sometimes referred to as ____________________ code.
Answer: binary
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/21709
Sample Questions
Q1) A(n) ____________________ is a collection of statements, and when it is activated, or executed, it accomplishes something.
Answer: subprogram sub program sub-program function
modlue
Q2) Suppose that sum is an int variable. The statement sum += 7; is equivalent to the statement sum = sum + 7;
A)True
B)False
Answer: True
Q3) In a C++ program, one and two are double variables and input values are 10.5 and 30.6. After the statement cin >> one >> two; executes, ____.
A) one = 10.5, two = 10.5
B) one = 10.5, two = 30.6
C) one = 30.6, two = 30.6
D) one = 11, two = 31
Answer: B
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
50 Verified Questions
50 Flashcards
Source URL: https://quizplus.com/quiz/21710
Sample Questions
Q1) Entering a char value into an int variable causes serious errors, called input failure. A)True
B)False
Answer: True
Q2) On some compilers, the statements cin >> left; and cin >> right; might not work. In this case, you can use the statement ____________________ in place of cin >> left;. Answer: cin.setf(ios::left);
Q3) Suppose that ch1 and ch2 are char variables, alpha is an int variable, and the input is: A 18
What are the values after the following statement executes? cin.get(ch1); cin.get(ch2); cin >> alpha;
A) ch1 = 'A', ch2 = ' ', alpha = 18
B) ch1 = 'A', ch2 = '1', alpha = 8
C) ch1 = 'A', ch2 = ' ', alpha = 1
D) ch1 = 'A', ch2 = '\n', alpha = 1
Answer: A
To view all questions and flashcards with answers, click on the resource link above.

Chapter 4: Control Structures I Selection
Available Study Resources on Quizplus for this Chatper
50 Verified Questions
50 Flashcards
Source URL: https://quizplus.com/quiz/21711
Sample Questions
Q1) What is the output of the following C++ code? int x = 35; int y = 45; int z; if (x > y)
\(\quad\)z = x + y; else
\(\quad\)z = y - x;
cout << x << " " << y << " " << z << endl;
A) 35 45 80
B) 35 45 10
C) 35 45 -10
D) 35 45 0
Q2) Which of the following is the "not equal to" relational operator? A) !
B) | C) != D) &
Q3) In C++, the logical operator AND is represented by ____________________.
Q4) Putting a semicolon after the parentheses following the expression in an if statement (that is, before the statement) is a(n) ____________________ error.
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
50 Verified Questions
50 Flashcards
Source URL: https://quizplus.com/quiz/21712
Sample Questions
Q1) Suppose j, sum, and num are int variables, and the input is 26 34 61 4 -1. What is the output of the code? sum = 0; cin >> num; for (int j = 1; j <= 4; j++)
{ \(\quad\)sum = sum + num; \(\quad\)xin >> num; }
cout << sum << endl;
A) 124
B) 125
C) 126
D) 127
Q2) A(n) ____-controlled while loop uses a bool variable to control the loop.
A) counter
B) sentinel
C) flag
D) EOF
Q3) A semicolon at the end of the for statement (just before the body of the loop) is a(n) ____________________ error.
To view all questions and flashcards with answers, click on the resource link above. Page 7

Chapter 6: User-Defined Functions
Available Study Resources on Quizplus for this Chatper
50 Verified Questions
50 Flashcards
Source URL: https://quizplus.com/quiz/21713
Sample Questions
Q1) The data type of a variable in a return statement must match the function type.
A)True
B)False
Q2) 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.
Q3) The output of the statement: cout << tolower('$') << endl; Is ____.
A) '$'
B) '0'
C) '1'
D) An error, because you cannot use tolower with '$'.
Q4) If a formal parameter is a nonconstant reference parameter, during a function call, its corresponding actual parameter must be a(n) ____________________.
Q5) The program that tests a function is called a(n) ____________________ program.
Q6) A function ____________________ is a function that is not fully coded.
Q7) In C++, :: is called the ____________________.
To view all questions and flashcards with answers, click on the resource link above. Page 8

Chapter 7:
User-Defined Simple Data Types, Namespaces, and the String Type
Available Study Resources on Quizplus for this Chatper
50 Verified Questions
50 Flashcards
Source URL: https://quizplus.com/quiz/21714
Sample Questions
Q1) An anonymous type can be passed as a parameter to a function.
A)True
B)False
Q2) Considering the statement string str = "Gone with the wind";, the output of the statement cout << str.find("the") << endl; is ____.
A) 9
B) 10
C) 11
D) 12
Q3) Suppose that str1, str2, and str3 are string variables. After the following statements execute, the value of str3 is "____". str1 = "abc";
Str2 = "xyz";
Str3 = str1 + '-' + str2;
A) abc
B) xyz
C) abc-xyz
D) xyz-abc
Q4) For the operator + to work with the string data type, one of the operands of + must be a(n) ____________________ variable.
Page 9
To view all questions and flashcards with answers, click on the resource link above.

Chapter 8: Arrays and Strings
Available Study Resources on Quizplus for this Chatper
50 Verified Questions
50 Flashcards
Source URL: https://quizplus.com/quiz/21715
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) What is the output of the following C++ code? int list[5] = {0, 5, 10, 15, 20}; int j; for (j = 0; j < 5; j++)
\(\quad\)cout << list[j] << " "; cout << endl;
A) 0 1 2 3 4
B) 0 5 10 15
C) 0 5 10 15 20
D) 5 10 15 20
Q3) The array index can be any integer less than the array size. A)True B)False
Q4) In a(n) ____________________ data type, each data item is a collection of other data items.
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
50 Verified Questions
50 Flashcards
Source URL: https://quizplus.com/quiz/21716
Sample Questions
Q1) A(n) ____________________ is a collection of a fixed number of components in which the components are accessed by name.
Q2) An array name and index are separated using ____.
A) curly brackets
B) square brackets
C) a dot
D) a comma
Q3) Consider the accompanying struct definition in Figure 1. The statement that initializes the member firstName to Melissa is ____________________.
Q4) A struct is typically a ____ data structure.
A) simple
B) dynamic
C) heterogeneous
D) linked
Q5) Arrays are passed by ____________________ only.
Q6) Memory is allocated for struct variables only when you ____________________ them.
Q7) Both arrays and structs are examples of ____________________ data types.
Q8) A(n) ____________________ is a set of elements of the same type.
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
49 Verified Questions
49 Flashcards
Source URL: https://quizplus.com/quiz/21717
Sample Questions
Q1) A class object can be ____. That is, it can be created once, when the control reaches its declaration, and destroyed when the program terminates.
A) static
B) automatic
C) local
D) public
Q2) Consider the accompanying class definition, and the declaration: rectangleType bigRect;
Which of the following statements is correct?
A) rectangleType.print();
B) rectangl
C) bigRect.print();
D) bigRect::print();
Q3) The components of a class are called the ____ of the class.
A) elements
B) members
C) objects
D) properties
Q4) Classes were specifically designed in C++ to handle ____________________.
Q5) The header file is also known as the ____________________.
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
50 Verified Questions
50 Flashcards
Source URL: https://quizplus.com/quiz/21718
Sample Questions
Q1) 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
Q2) Which of the following statements about inheritance is true if memberAccessSpecifier is protected?
A) The private members of the base class become protected members of the derived class.
B) The derived class can directly access any member of the base class.
C) The public members of the base class become protected members of the derived class.
D) The protected members of the base class become private members of the derived class.
Q3) In ____________________, the derived class is derived from a single base class.
Q4) A derived class cannot directly access public members of a base class.
A)True
B)False
Q5) A derived class can directly access the protected members of the base class.
A)True
B)False

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

Chapter 12: Pointers, Classes, Virtual Functions, and
Abstract Classes
Available Study Resources on Quizplus for this Chatper
50 Verified Questions
50 Flashcards
Source URL: https://quizplus.com/quiz/21719
Sample Questions
Q1) In C++, pointer variables are declared using the reserved word pointer.
A)True
B)False
Q2) What is the output of the following code? int *p; int x;
x = 76;
p = &x;
*p = 43;
Cout << x << ", " << *p << endl;
A) 76, 76
B) 76, 43
C) 43, 76
D) 43, 43
Q3) In C++, the dot operator has a lower precedence than the dereferencing operator.
A)True
B)False
Q4) Consider the following statements: int x;
int &y = x;
The second statement declares y to be a(n) ____________________ of x.
To view all questions and flashcards with answers, click on the resource link above. Page 14

Chapter 13: Overloading and Templates
Available Study Resources on Quizplus for this Chatper
50 Verified Questions
50 Flashcards
Source URL: https://quizplus.com/quiz/21720
Sample Questions
Q1) Which of the following is the general syntax of the function prototype to overload the pre-increment operator ++ as a member function?
A) className operator++();
B) className operator++(int);
C) friend className operator++();
D) friend className operator++(int);
Q2) To overload the pre-increment (++) operator for a class, if the operator function is a member of that class, it must have ____ parameter(s).
A) no
B) one
C) two
D) three
Q3) Which of the following function prototypes overloads the != operator for the class rectangleType?
A) bool operator!=(rectangle&) const;
B) bool operator!=(const rectangleType&) const;
C) int operator!=(const rectangleType) const;
D) int operator!=(rectangle&) const;
Q4) A conversion constructor is a(n) ____________________-parameter function.
To view all questions and flashcards with answers, click on the resource link above. Page 15

Chapter 14: Exception Handling
Available Study Resources on Quizplus for this Chatper
50 Verified Questions
50 Flashcards
Source URL: https://quizplus.com/quiz/21721
Sample Questions
Q1) If the operator new cannot allocate memory space, this operator throws a(n) ____________________ exception.
Q2) If the catch block with an ellipses (in the heading) is needed, then it should be the first catch block in a sequence of try/catch blocks.
A)True
B)False
Q3) 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
Q4) The general syntax to rethrow an exception caught by a catch block is: ____ (in this case, the same exception is rethrown).
A) rethrow;
B) throw;
C) rethrow exception;
D) throw exception;
To view all questions and flashcards with answers, click on the resource link above.
Page 16

Chapter 15: Recursion
Available Study Resources on Quizplus for this Chatper
50 Verified Questions
50 Flashcards
Source URL: https://quizplus.com/quiz/21722
Sample Questions
Q1) To design a recursive function, you must determine the limiting conditions.
A)True
B)False
Q2) Consider the accompanying definition of the recursive function mystery. Given the declaration: int beta[10] = {2, 5, 8, 9, 13, 15, 18, 20, 23, 25};
What is the output of the following statement?
Cout << mystery(beta, 4, 7) << endl;
A) 27
B) 33
C) 55
D) 66
Q3) The ____ case is the case for which the solution to an equation is obtained directly.
A) general
B) base
C) direct
D) tail
Q4) The rightmost bit of the binary representation of 33 is ____________________.
Q5) Recursive algorithms are implemented using ____________________ functions.
Q6) The collating sequence of A in the ASCII character set is
To view all questions and flashcards with answers, click on the resource link above. Page 17

Chapter 16: Searching, Sorting and the Vector Type
Available Study Resources on Quizplus for this Chatper
50 Verified Questions
50 Flashcards
Source URL: https://quizplus.com/quiz/21723
Sample Questions
Q1) Which of the following statements declares intList to be an empty vector?
A) vector intList();
B) vector<int> intList(0);
C) vector<int> intList(10);
D) vector<int> intList;
Q2) 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;
Q3) 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 18

Chapter 17: Linked Lists
Available Study Resources on Quizplus for this Chatper
50 Verified Questions
50 Flashcards
Source URL: https://quizplus.com/quiz/21724
Sample Questions
Q1) In a linked list, the link component of each node is a(n) ____________________.
Q2) A linked list is a random access data structure.
A)True
B)False
Q3) Each node of a singly linked list has two components: ____ and ____.
A) info, head
B) link, back
C) back, head
D) info, link
Q4) In C++, the dereferencing operator is ____________________.
Q5) A doubly linked list can be traversed in either direction.
A)True
B)False
Q6) We deallocate the memory for a linked list by calling the operator clear. A)True
B)False
Q7) A linked list in which the last node points to the first node is called a(n) ____________________ linked list.
To view all questions and flashcards with answers, click on the resource link above. Page 19
Q8) Each node of a linked list must store the data as well as the ____________________ for the next node in the list

Chapter 18: Stacks and Queues
Available Study Resources on Quizplus for this Chatper
50 Verified Questions
50 Flashcards
Source URL: https://quizplus.com/quiz/21725
Sample Questions
Q1) In the late 1950s, the Australian philosopher and early computer scientist Charles L. Hamblin proposed a scheme in which the operators follow the operands (postfix operators), resulting in ____________________ notation.
Q2) In the array representation of a stack, if a value called stackTop indicates the number of elements in the stack, then stackTop-1 points to the top item of the stack.
A)True
B)False
Q3) You can perform the operation ____ to remove the top element from the stack.
A) dequeue
B) top
C) pop
D) push
Q4) The infix expression (a + b) * (c - d / e) + f is equivalent to the postfix expression ab + cde /-* f +
A)True
B)False
Q5) In ____________________ notation, operators are written after the operands.
To view all questions and flashcards with answers, click on the resource link above. Page 20