Skip to main content

Introduction to Programming Final Exam - 949 Verified Questions

Page 1


Introduction to Programming Final Exam

Course Introduction

Introduction to Programming is designed to equip students with the foundational concepts and skills required to begin coding in modern programming languages. The course covers key topics such as variables, data types, control structures (like loops and conditionals), functions, and basic input/output operations. Through a combination of lectures and hands-on exercises, students learn how to analyze problems, write algorithmic solutions, and develop simple applications. Emphasis is placed on logical thinking, problem-solving, and code readability to prepare learners for more advanced coursework in computer science and software development.

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) What does the term hardware refer to?

A) The relative difficulty of writing computer programs

B) The physical components that make up a computer

C) The way a computer's storage space is organized

D) The logical flow of instructions

E) None of these

Answer: B

Q2) The two parts of the CPU are

A) the output device and the input device

B) the software and the hardware

C) the Control Unit and the Arithmetic and Logic Unit

D) the single-task device and the multi-task device

E) None of these

Answer: C

Q3) Programs are often referred to as hardware.

A)True

B)False

Answer: False

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) The __________ is(are) used to display information on the computer's screen.

A) opening and closing braces

B) opening and closing quotation marks

C) cout object

D) backslash

E) None of these

Answer: C

Q2) Which part of the following line is ignored by the compiler?

Double userName = "janedoe"; // user's name is janedoe

A) "janedoe"

B) user's name is

C) user's name is janedoe

D) //

E) None of these

Answer: C

Q3) A value is stored in a variable with an assignment statement.

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) In the following statement, what will be executed first according to the order of precedence?

Result = 6 - 3 * 2 + 7 - 10 / 2;

A) 6 - 3

B) 3 * 2

C) 2 + 7

D) 10 / 2

E) 7 - 10

Answer: B

Q2) 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

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) Which value can be entered to cause the following code segment to display the message "That number is acceptable"?

Int number;

Cin >> number;

If (number > 10 && number < 100)

Cout << "That number is acceptable.\n";

Else

Cout << "That number is not acceptable.\n";

A) 100

B) 10

C) 99

D) 0

E) all of these

Q2) Which of the following is evaluated first, given the expression:

A && B || C && !D

A) A && B

B) B || C

C) C && !D

D) !D

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

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 C++ 11 you can pass a string object as an argument to a file stream object's open member function.

A)True

B)False

Q2) How many times will the following loop display "Looping again!"?

For (int i = 0; i <= 20; i++)

Cout << "Looping again!" << endl;

A) 20

B) 19

C) 21

D) an infinite number of times

Q3) What will the following code display?

Int number = 6;

Int x = 0;

X = --number;

Cout << x << endl;

A) 6

B) 5

C) 7

D) 0

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) The value in a __________ variable persists between function calls.

A) dynamic

B) global

C) floating-point

D) static local

E) counter

Q2) You may use the exit() function to terminate a program, regardless of which control mechanism is executing.

A)True

B)False

Q3) A __________ argument is passed to a parameter when the actual argument is left out of the function.

A) False

B) true

C) null

D) default

E) None of these

Q4) You must always furnish an argument with a function call.

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) An individual array element can be processed like any other type of C++ variable.

A)True

B)False

Q2) Although two-dimensional arrays are a novel idea, there is no known way to pass one to a function.

A)True

B)False

Q3) What does the following code do?

Const int SIZE = 5; Double x[SIZE];

For (int i = 2; i <= SIZE; i++)

{ X[i] = 0.0;

}

A) Each element in the array is initialized to 0.0.

B) Each element in the array except the first is initialized to 0.0.

C) Each element in the array except the first and last is initialized to 0.0.

D) An error will occur when the code runs.

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

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) The following is the pseudocode for which type of algorithm?

For maxElement = each subscript in the array, from the last to the first

For index = 0 To maxElement - 1

If array[index] > array[index + 1]

Swap array[index] with array[index + 1]

End If

End For

End For

A) bubble sort

B) binary sort

C) bubble search

D) selection sort

E) None of these

Q2) Regardless of the algorithm being used, a search through an array is always performed

A) from lowest to highest element

B) from highest to lowest element

C) beginning with the middle element

D) using a binary search algorithm

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) Use the delete operator only on pointers that were

A) never used

B) not correctly initialized

C) created with the new operator

D) dereferenced inappropriately

E) None of these

Q2) In the following statement, what does int mean?

Int *ptr = nullptr;

A) The variable named *ptr will store an integer value.

B) The variable named *ptr will store an asterisk and an integer value

C) ptr is a pointer variable and will store the address of an integer variable.

D) The variable named *ptr will store the value in nullptr.

E) None of these

Q3) With pointer variables you can access but not modify data in other variables.

A)True

B)False

Q4) It is legal to subtract a pointer variable from another pointer variable.

A)True

B)False

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

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) What is the result after the following statement executes?

Char var1 = tolower('A');

A) var1 stores the character value 'A'

B) var1 stores the ASCII value for lowercase 'a'

C) the character A is output to the monitor

D) the character a is output to the monitor

E) None of these

Q2) The function that accepts pointers to two C-strings and an integer argument that indicates how many characters to copy from the second string to the first is

A) strcpy

B) strncpy

C) copystring

D) strintcpy

E) None of these

Q3) A library function that can find one C-string inside another is A) strcmp

B) strstr

C) strfind

D) strsearch

E) None of these

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) Which of the following assigns a value to the hourlyWage member of employee[2]?

A) employee[2] -> hourlyWage = 50.00;

B) employee2.hourlyWage = 7.50;

C) hourlyWage[2].employee = 29.75;

D) employee[2].hourlyWage = 75.00;

E) None of these

Q2) It is possible for a structure to contain, as a member, a pointer to its own structure type.

A)True

B)False

Q3) In C++11, you can use a new type of enum known as a(n) __________ (also known as an enum class) to have multiple enumerators with the same name, within the same scope.

A) universal enum

B) auto enum

C) multi-cast enum

D) strongly typed enum

E) None of these

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

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) If a file already exists, you can open it with the flags ios::in | ios::out to preserve its contents.

A)True

B)False

Q2) 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

Q3) Data stored __________ disappears once the program stops running or the computer is powered down.

A) on a CD

B) in RAM

C) on a flash drive

D) on the disk drive

E) None of these

To view all questions and flashcards with answers, click on the resource link above. Page 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 a member function is defined outside of the class declaration, the function name must be qualified with the

A) class name, followed by a semicolon

B) name of the first object

C) class name, followed by the scope resolution operator

D) private access specifier

E) None of these

Q2) Which type of member function may only be called from a function that is a member of the same class?

A) public

B) private

C) global

D) local

E) None of these

Q3) More than one constructor function may be defined for a class.

A)True

B)False

Q4) In-place member initialization no longer is available in C++11.

A)True

B)False

To view all questions and flashcards with answers, click on the resource link above. Page 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) A(n) __________ is a special built-in pointer that is available to a class's member functions..

A) this pointer

B) &constructor pointer

C) ~destructor *ptr

D) overload operator, ->

E) None of these

Q2) An aggregate class's constructor can use a member initialization list to call the constructors for each of its member objects.

A)True

B)False

Q3) In C++11 the __________ operator swaps the members of the object being assigned with the temporary object.

A) move assignment

B) swap assignment

C) temp assignment

D) semantic assignment

E) None of these

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

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) Pointers to a base class may be assigned the address of a derived class object.

A)True

B)False

Q2) Polymorphism is when __________ in a class hierarchy perform differently, depending on which object performs the call.

A) base class constructors

B) derived class constructors

C) member functions

D) derived class destructors

E) None of these

Q3) Multiple inheritance is when a __________ class has __________ base classes.

A) base, no

B) derived, two or more

C) derived, no

D) compound, more than two

E) None of these

Q4) More than one class may be derived from a base class.

A)True

B)False

17

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

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 function template's prefix contains __________ enclosed in angle brackets.

A) one or more generic data types

B) the function definition

C) constant values

D) the function's return type

E) None of these

Q2) Which of the following is used to signal errors or unexpected results that happen as a program runs?

A) virtual functions

B) destructors

C) exceptions

D) templates

E) None of these

Q3) 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

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) An iterator of the iterator type that gives you read/write access to the element to which the iterator points is known as a(n)

A) immutable iterator

B) mutable iterator

C) auto iterator

D) range iterator

E) None of these

Q2) A(n) __________ is like a pointer. It is used to access the individual data elements in a container.

A) element access operator

B) subscript indicator

C) global data finder

D) iterator

E) None of these

Q3) An associative container uses __________ to access elements rapidly.

A) data

B) functions

C) keys

D) complex sort algorithms

E) None of these

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) A new node cannot become the first node in the list.

A)True

B)False

Q2) The __________ of a linked list points to the first node in the list.

A) starter

B) head

C) tail

D) declaration

E) None of these

Q3) Deleting an entire list simply requires the use of the delete operator.

A)True

B)False

Q4) The Standard Template Library (STL) provides a linked list container.

A)True

B)False

Q5) 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

To view all questions and flashcards with answers, click on the resource link above. Page 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) A real-world example of the queue data structure can be seen in a stack of cafeteria trays where the last tray pushed onto the stack is the first tray removed.

A)True

B)False

Q2) A stack that is implemented as a linked list is known as a deque.

A)True

B)False

Q3) Two primary queue operations are

A) push and pop

B) enqueue and dequeue

C) insert and delete

D) onqueue and offqueue

E) None of these

Q4) The __________ operation allows an item to be removed from the stack.

A) push

B) pop

C) delete

D) remove

E) None of these

To view all questions and flashcards with answers, click on the resource link above. Page 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) How many times will the following function call itself if 5 is passed as the argument? void showMessage(int n)

{ \(\quad\)If (n > 0)

\(\quad\){ \(\quad\)\(\quad\)cout << "Good day!" << endl; \(\quad\)\(\quad\)showMessage(n + 1); \(\quad\)}

}

A) 1

B) 4

C) 5

D) An infinite number of times

Q2) The QuickSort algorithm is used to sort

A) lists stored in arrays or linear linked lists

B) tree data structures

C) randomly-ordered files

D) All of these

E) None of these

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) A node that has no children is known as a

A) root node

B) head node

C) leaf node

D) pure binary node

E) None of these

Q2) Select all that apply. Which of the following are methods of traversing a binary tree?

A) LeftOrder traversal

B) PreOrder traversal

C) FrontOrder traversal

D) InOrder traversal

E) PostOrder traversal

Q3) The shape of a binary tree is

A) always triangular

B) always balanced

C) determined by the programmer

D) determined by the order in which values are inserted

E) None of these

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

23

Turn static files into dynamic content formats.

Create a flipbook
Introduction to Programming Final Exam - 949 Verified Questions by Quizplus - Issuu