Skip to main content

Object-Oriented Programming Final Exam - 949 Verified Questions

Page 1


Object-Oriented Programming Final Exam

Course Introduction

Object-Oriented Programming is a foundational course that introduces the principles and practices of designing software using the object-oriented paradigm. Students learn to model real-world problems through classes and objects, apply concepts such as encapsulation, inheritance, and polymorphism, and develop robust, reusable, and maintainable code. Through practical programming exercises and projects, the course emphasizes structured problem-solving, code organization, and the use of popular object-oriented languages such as Java or C++. By the end, students will be able to design class hierarchies, apply design patterns, and create modular software systems suitable for complex applications.

Recommended Textbook

Starting Out with C++ from Control Structures to Objects 9th Edition by Tony Gaddis

Available Study Resources on Quizplus

21 Chapters

949 Verified Questions

949 Flashcards

Source URL: https://quizplus.com/study-set/1368 Page 2

Chapter 1: Introduction to Computers and Programming

Available Study Resources on Quizplus for this Chatper

47 Verified Questions

47 Flashcards

Source URL: https://quizplus.com/quiz/27271

Sample Questions

Q1) In programming, the terms "line" and "statement" always mean the same thing.

A)True

B)False

Answer: False

Q2) A computer monitor is a type of

A) input device

B) output device

C) storage device

D) software

E) None of these

Answer: A

Q3) During which stage does the central processing unit analyze the instruction and encode it in the form of a number, and then generate an electronic signal?

A) fetch

B) decode

C) execute

D) portability

Answer: B

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

3

Chapter 2: Introduction to C

Available Study Resources on Quizplus for this Chatper

62 Verified Questions

62 Flashcards

Source URL: https://quizplus.com/quiz/27272

Sample Questions

Q1) A character literal is __________, whereas a string literal is __________

A) enclosed in quotation marks, enclosed in brackets

B) enclosed in brackets, enclosed in quotation marks

C) enclosed in double quotation marks, enclosed in single quotation marks

D) enclosed in single quotation marks, enclosed in double quotation marks

E) None of these

Answer: D

Q2) Which of the following is not a valid C++ identifier?

A) April2018

B) employee_number

C) _1user

D) 1user

E) theLittleBrownFoxWhoRanAway

Answer: D

Q3) C++ does not have a built-in data type for storing strings of data.

A)True

B)False

Answer: True

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

Chapter 3: Expressions and Interactivity

Available Study Resources on Quizplus for this Chatper

45 Verified Questions

45 Flashcards

Source URL: https://quizplus.com/quiz/27273

Sample Questions

Q1) Which of the following will allow the user to input the values 15 and 20 and have them stored in variables named base and height, respectively?

A) cin << base << height;

B) cin base, height;

C) cin >> base >> height;

D) cin base >> cin height;

E) None of these

Answer: C

Q2) When a variable is assigned a number that is too large for its data type, it

A) underflows

B) overflows

C) reverses

D) converts

E) None of these

Answer: B

Q3) The fixed manipulator causes a number to be displayed in scientific notation. A)True

B)False

Answer: False

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

Page 5

Chapter 4: Making Decisions

Available Study Resources on Quizplus for this Chatper

51 Verified Questions

51 Flashcards

Source URL: https://quizplus.com/quiz/27274

Sample Questions

Q1) What is the value of the following expression?

True && !False

A) true

B) False

C) -1

D) +1

E) None of these

Q2) When an if statement is placed within the conditionally-executed code of another if statement, this is known as

A) complexity

B) overloading

C) nesting

D) validation

E) None of these

Q3) The default section is required in a switch statement.

A)True

B)False

Q4) The conditional operator takes two operands.

A)True

B)False

Page 6

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

Chapter 5: Loops and Files

Available Study Resources on Quizplus for this Chatper

60 Verified Questions

60 Flashcards

Source URL: https://quizplus.com/quiz/27275

Sample Questions

Q1) In the following statement, which operator is used first?

While (x++ < 10)

A) ++

B) <

C) neither; the expression is invalid

D) cannot tell without the rest of the code

Q2) You may nest while and do-while loops but you may not nest for loops.

A)True

B)False

Q3) Something within a while loop must eventually cause the condition to become False or a(n) __________ results.

A) null value

B) infinite loop

C) unexpected exit

D) compiler error

E) None of these

Q4) A while loop is somewhat limited because the counter can only be incremented by one each time through the loop.

A)True

B)False

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

Chapter 6: Functions

Available Study Resources on Quizplus for this Chatper

49 Verified Questions

49 Flashcards

Source URL: https://quizplus.com/quiz/27276

Sample Questions

Q1) A(n) __________ is information that is passed to a function, and a(n) __________ is information that is received by a function.

A) function call, function header

B) parameter, argument

C) argument, parameter

D) prototype, header

E) None of these

Q2) Functions are ideal for menu-driven programs. When the user selects a menu item, the program can __________ the appropriate function.

A) call

B) append

C) define

D) declare

E) None of these

Q3) A local variable and a global variable may not have the same name within a program.

A)True

B)False

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

Chapter 7: Arrays and Vectors

Available Study Resources on Quizplus for this Chatper

56 Verified Questions

56 Flashcards

Source URL: https://quizplus.com/quiz/27277

Sample Questions

Q1) What is the last legal subscript that can be used with the following array?

Int values[5];

A) 0

B) 5

C) 6

D) 4

E) 1

Q2) An array with no elements is

A) legal in C++

B) illegal in C++

C) automatically furnished with one element whose value is set to zero

D) automatically furnished with one element, the null terminator

E) None of these

Q3) An element of a two-dimensional array is referred to by

A) the array name followed by the column number of the element

B) the row subscript of the element followed by the column subscript of the element

C) a comma followed by a semicolon

D) the row subscript of the element followed by the array name

E) None of these

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

Page 9

Chapter 8: Searching and Sorting Arrays

Available Study Resources on Quizplus for this Chatper

30 Verified Questions

30 Flashcards

Source URL: https://quizplus.com/quiz/27278

Sample Questions

Q1) What is the output after the following code executes?

Int numerator = 5;

Int denominator = 25;

Int temp = 0;

Temp = numerator;

Numerator = denominator;

Denominator = temp;

Cout << numerator << "/" << denominator << " = " << (numerator/denominator) << endl;

A) 5/25 = numerator/denominator

B) 5/25 = 0

C) 5/25 = 0.2

D) 25/5 = 5

E) 25/5 = 25/5

Q2) A binary search begins with the __________ element of an array.

A) first

B) last

C) largest

D) middle

E) None of these

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

Page 10

Chapter 9: Pointers

Available Study Resources on Quizplus for this Chatper

47 Verified Questions

47 Flashcards

Source URL: https://quizplus.com/quiz/27279

Sample Questions

Q1) Every byte in the computer's memory is assigned a unique

A) pointer

B) address

C) dynamic allocation

D) name

E) None of these

Q2) Select all that apply. Which of the following can be used as pointers?

A) array names

B) numeric constants

C) keywords

D) None of these

Q3) Which of the following defines a unique_ptr named uniq that points to a dynamically allocated int?

A) unique_ptr&lt;uniq&gt; int( new int );

B) unique_ptr&lt;int&gt; int( new uniq );

C) unique_ptr&lt;uniq&gt; uniq( new int );

D) unique_ptr&lt;int&gt; uniq( new int );

E) None of these

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

Chapter 10: Characters, C-Strings, and More About the String Class

Available Study Resources on Quizplus for this Chatper

47 Verified Questions

47 Flashcards

Source URL: https://quizplus.com/quiz/27280

Sample Questions

Q1) A test using the isupper function will return False if the argument is an uppercase character.

A)True

B)False

Q2) C++11 introduces a function named to_string that converts a numeric value to a string object.

A)True

B)False

Q3) Select all that apply. Whitespace encompasses which of the following?

A) a tab

B) a newline

C) a space

D) None of these

Q4) The ftoa function converts a floating-point value to an ASCII value.

A)True

B)False

Q5) The C++ library provides functions for converting a string representation of a number to a numeric data type and vice-versa.

A)True

B)False

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

Chapter 11: Structured Data

Available Study Resources on Quizplus for this Chatper

46 Verified Questions

46 Flashcards

Source URL: https://quizplus.com/quiz/27281

Sample Questions

Q1) A function __________ return a structure.

A) may

B) may not C) will always D) can never

E) None of these

Q2) Which of the following statements outputs the value of the gpa member of element [1] of the student array?

A) cout << student1.gpa;

B) cout << firstStudent.gpa; C) cout << student[1].gpa;

D) cout << student1->gpa;

E) None of these

Q3) The expression s->m; indicates that s is a structure pointer and m is a structure member.

A)True B)False

Q4) You cannot directly assign an integer value to an enum variable. A)True B)False

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

Chapter 12: Advanced File Operations

Available Study Resources on Quizplus for this Chatper

38 Verified Questions

38 Flashcards

Source URL: https://quizplus.com/quiz/27282

Sample Questions

Q1) Which of the following is the data type that can be used to create files and write information to them but cannot be used to read information from them?

A) ofstream

B) ifstream

C) afstream

D) outstream

E) None of these

Q2) To write to a file, you use the file_write function.

A)True

B)False

Q3) Which of the following is the data type that can be used to create files, read data from them, and write data to them?

A) ofstream

B) ifstream

C) fstream

D) stream

E) None of these

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

14

Chapter 13: Introduction to Classes

Available Study Resources on Quizplus for this Chatper

54 Verified Questions

54 Flashcards

Source URL: https://quizplus.com/quiz/27283

Sample Questions

Q1) When using smart pointers to dynamically allocate objects in C++ 11, it is unnecessary to delete the dynamically allocated objects because the smart pointer will automatically delete them.

A)True

B)False

Q2) In C++11 you can have one constructor call another constructor in the same class by using

A) constructor delegation

B) in-place initialization

C) a member initialization list

D) None of these

Q3) The process of object-oriented analysis can be viewed as the following steps:

A) identify objects, then define each object's attributes, behaviors, and relationships

B) define data members and member functions, then assign the class name

C) declare public and private variables, prototype functions, and then write code

D) write the main() function, then determine which classes are needed

E) None of these

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

15

Chapter 14: More About Classes

Available Study Resources on Quizplus for this Chatper

46 Verified Questions

46 Flashcards

Source URL: https://quizplus.com/quiz/27284

Sample Questions

Q1) Which of the following operators may be used to assign one object to another?

A) =

B) ==

C) <>

D) @

E) None of these

Q2) When objects contain pointers, it is a good idea to create an explicit __________ function.

A) destructor

B) copy constructor

C) static constructor

D) inline constructor

E) None of these

Q3) A static member variable can be used when there are no objects of the class in existence.

A)True

B)False

Q4) When you overload the << operator you must also overload the >> operator.

A)True

B)False

Page 16

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

Chapter 15: Inheritance, Polymorphism, and Virtual Functions

Available Study Resources on Quizplus for this Chatper

43 Verified Questions

43 Flashcards

Source URL: https://quizplus.com/quiz/27285

Sample Questions

Q1) A derived class may not have any classes derived from it.

A)True

B)False

Q2) The __________ constructor is called before the __________ constructor.

A) base, derived

B) derived, base

C) public, private

D) private, public

E) None of these

Q3) A member function of a derived class may not have the same name as a member function of a base class.

A)True

B)False

Q4) Arguments are passed to the base class destructor by the __________ class __________ function.

A) derived, constructor

B) derived, destructor

C) base, constructor

D) base, destructor

E) None of these

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

Chapter 16: Exceptions and Templates

Available Study Resources on Quizplus for this Chatper

36 Verified Questions

36 Flashcards

Source URL: https://quizplus.com/quiz/27286

Sample Questions

Q1) A program may not contain both a "regular" version of a function and a template version of the function.

A)True

B)False

Q2) If an exception is not caught, it is stored for later use.

A)True

B)False

Q3) The try/catch/throw construct is able to handle only one type of exception in a try block.

A)True

B)False

Q4) How much memory is reserved for a function template?

A) four bytes

B) It depends on the size of the template.

C) two bytes

D) no memory

E) None of these

Q5) The line containing a throw statement is known as the throw point. A)True

B)False

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

Chapter 17: The Standard Template Library

Available Study Resources on Quizplus for this Chatper

38 Verified Questions

38 Flashcards

Source URL: https://quizplus.com/quiz/27287

Sample Questions

Q1) Because a vector container uses a dynamically allocated array to hold its elements, it is common for the vector class to allocate

A) less memory than it needs

B) more memory than it needs

C) a separate memory location for copies of new elements

D) None of these

Q2) To retrieve a value from a map, you call the __________ member function and pass the __________ that is associated with the desired value.

A) at(), key

B) at(), value

C) key(), key

D) pair(), key

E) None of these

Q3) Select all that apply. Which of the following statement(s) is(are) not true?

A) A map is an associative container.

B) Each element in a map has two parts.

C) Map elements are usually referred to as key-value pairs.

D) The key value in a map is used to locate a value.

E) The value element in a map is used to locate the key.

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

Page 19

Chapter 18: Linked Lists

Available Study Resources on Quizplus for this Chatper

41 Verified Questions

41 Flashcards

Source URL: https://quizplus.com/quiz/27288

Sample Questions

Q1) Select all that apply. While traversing a list, a node pointer knows when it has reached the end of the list if

A) it encounters the newline character

B) it encounters a null pointer

C) it finds itself back at the beginning of the list

D) it encounters a sentinel such as 9999

Q2) A linked list is called "linked" because each node in the series has a pointer that points to the next node in the list.

A)True

B)False

Q3) A linked list class must take care of removing the dynamically allocated nodes and this is done by

A) the constructor function

B) the destructor function

C) overriding the removal function

D) overloading the memory persistence operator

E) None of these

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

20

Chapter 19: Stacks and Queues

Available Study Resources on Quizplus for this Chatper

47 Verified Questions

47 Flashcards

Source URL: https://quizplus.com/quiz/27289

Sample Questions

Q1) The first item placed onto a stack is always the last item removed from the stack.

A)True

B)False

Q2) The programmer must declare in advance the size of a dynamic stack or queue.

A)True

B)False

Q3) Which of the following is a double-ended queue?

A) two-headed stack

B) two-tailed vector

C) circular array

D) deque

E) None of these

Q4) The two primary stack operations are

A) push and pull

B) push and pop

C) insert and delete

D) append and delete

E) None of these

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

21

Chapter 20: Recursion

Available Study Resources on Quizplus for this Chatper

27 Verified Questions

27 Flashcards

Source URL: https://quizplus.com/quiz/27290

Sample Questions

Q1) The QuickSort algorithm was developed in 1960 by

A) Bjarne Stroustrup

B) Tony Gaddis

C) C.A.R. Hoare

D) C.M. Turner

E) None of these

Q2) When a recursive function directly calls itself, this is known as direct recursion.

A)True

B)False

Q3) The QuickSort algorithm works on the basis of

A) three sublists

B) two sublists and a pivot

C) two pivots and a sublist

D) three pivots

E) None of these

Q4) When recursion is used on a linked list, it will always display the contents of the list in reverse order.

A)True

B)False

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

Chapter 21: Binary Trees

Available Study Resources on Quizplus for this Chatper

39 Verified Questions

39 Flashcards

Source URL: https://quizplus.com/quiz/27291

Sample Questions

Q1) When a binary tree is used to facilitate a search, it is referred to as a A) binary queue

B) binary ordered deque

C) sort algorithm

D) binary search tree

E) None of these

Q2) In a binary tree class you usually have a pointer as a member that is set to the A) leftmost child node

B) first leaf node

C) root of the tree

D) deepest leaf node

E) None of these

Q3) The InOrder, PreOrder, and PostOrder traversals can be accomplished using A) recursion

B) no pointers

C) no arguments

D) no parameters

E) None of these

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

Turn static files into dynamic content formats.

Create a flipbook
Object-Oriented Programming Final Exam - 949 Verified Questions by Quizplus - Issuu