Skip to main content

Programming Fundamentals Final Exam Questions - 766 Verified Questions

Page 1


Programming Fundamentals

Final Exam Questions

Course Introduction

Programming Fundamentals introduces students to the core concepts of computer programming and logical problem-solving using a high-level programming language. This course covers essential topics such as data types, control structures, functions, arrays, and basic input/output operations. Through practical lab exercises and projects, students develop algorithmic thinking and learn to write, debug, and test simple programs. By the end of the course, students gain a solid foundation for further study in computer science and the ability to approach programming challenges systematically.

Recommended Textbook

Starting out with C++ Early Objects 9th Edition by Tony Gaddis

Available Study Resources on Quizplus

19 Chapters

766 Verified Questions

766 Flashcards

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

Chapter 1: Introduction to Computers and Programming

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

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

Sample Questions

Q1) Creating a program requires many steps. Three of these are

A) input, processing, and output.

B) keywords, operators, and punctuation.

C) program design, writing source code, and testing.

D) syntax, logic, and error handling.

E) none of the above.

Answer: C

Q2) ________ is used in a C++ program to mark the end of a statement, or to separate items in a list.

A) A separator

B) Punctuation

C) An operator

D) A keyword

E) A blank space

Answer: B

Q3) List five elements that are common to all programming languages.

Answer: keywords, programmer-defined symbols, operators, punctuation, and syntax

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

3

Chapter 2: Introduction to C Plus Plus

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

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

Sample Questions

Q1) Which of the following will cause the next output to begin on a new line?

A) cout << endl;

B) cout << "endl";

C) cout << "/n";

D) All of the above

E) A and C, but not B

Answer: A

Q2) C++ automatically places ________ at the end of a string literal.

A) a semicolon

B) quotation marks

C) the null terminator

D) a newline escape sequence

E) a blank

Answer: C

Q3) C++ is a case-sensitive language.

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

40 Verified Questions

40 Flashcards

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

Sample Questions

Q1) If the value of dollars is 5.0, the following statement will output 5.00 to the monitor:

cout << fixed << showpoint << setprecision(4) << dollars << endl;

A)True

B)False

Answer: False

Q2) The cin object must be followed by

A) a single stream insertion (<<) operator.

B) one or more stream insertion operators (<<).

C) a single stream extraction (>>) operator.

D) one or more stream extraction (>>) operators.

E) no operators.

Answer: D

Q3) Operator associativity is either left to right or

A) top to bottom.

B) front to back.

C) right to left.

D) inside to outside.

E) nothing else; it is always left to right.

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

40 Verified Questions

40 Flashcards

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

Sample Questions

Q1) A trailing else placed at the end of an if/else if statement provides a default action when ________ of the if conditions is/are True.

A) none

B) any one

C) only the last one

D) at least two

E) all

Q2) The statement pass = (score >= 7) ?

True : false; does exactly the same thing as the if/else statement below: if (score >= 7)

pass = True; else pass = false;

A)True

B)False

Q3) The scope of a variable is the program it is defined in.

A)True

B)False

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

Chapter 5: Looping

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

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

Sample Questions

Q1) The block of code in the body of a while statement can contain an unlimited number of statements, provided they are enclosed in a set of braces.

A)True

B)False

Q2) A(n) ________ is a variable that controls the number of times a loop iterates.

A) counter

B) accumulator

C) sentinel

D) total

E) loop control variable

Q3) A while loop is somewhat limited, because the counter can only count up, not down.

A)True

B)False

Q4) The statements in the body of a do-while loop are executed

A) only if the test condition is initially True.

B) at least once.

C) until the test condition becomes True.

D) until an exit statement is encountered.

E) forever until the user presses the break key.

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

40 Verified Questions

40 Flashcards

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

Sample Questions

Q1) You may use the exit() function to return the flow of control from a function back to main() regardless of where the function was called from.

A)True

B)False

Q2) A(n) ________ is information that is passed to a function, and a(n) ________ is a special variable that receives and holds that information.

A) function call, function header

B) function prototype, function header

C) parameter, argument

D) argument, parameter

E) formal argument, actual argument

Q3) A function ________ eliminates the need to place the function definition before all calls to the function.

A) header

B) prototype

C) argument

D) parameter

E) that is void

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

8

Chapter 7: Introduction to Classes and Objects

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

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

Sample Questions

Q1) A C++ member function that uses, but does not change, the value of a member variable is called

A) an accessor.

B) a mutator.

C) a user.

D) a constant.

E) a constructor.

Q2) The bundling of an object's data and functions together is called A) OOP.

B) encapsulation.

C) data hiding.

D) structuring.

E) private access.

Q3) If setSide is a Square class function and box is a Square object, which of the following statements would set the length of box's side to 5?

A) setSide(5);

B) box.setSide(5);

C) Square.setSide(5);

D) Square.setSide = 5;

E) None of the above

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/29534

Sample Questions

Q1) The statement int grades[ ] = { 100, 90, 99, 80 }; Is an example of

A) default arguments.

B) an illegal array declaration.

C) an illegal array initialization.

D) data encapsulation.

E) implicit array sizing.

Q2) An individual array element can be processed or passed to a function just like a regular C++ variable.

A)True

B)False

Q3) An array can store multiple values, but the values must be A) all the same data type.

B) declared at the time the array is created.

C) constants.

D) numeric, not characters or strings.

E) none of the above.

Q4) An array can be returned by a function as well as passed to a function. A)True

B)False

Page 10

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

Chapter 9: Searching, Sorting, Algorithm Analysis

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

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

Sample Questions

Q1) If algorithm A requires 2n + 1 basic operations to process an input of size n, and Algorithm B requires 3n + 2 basic operations to process the same input, algorithm A is considered to be more efficient than Algorithm B.

A)True

B)False

Q2) The advantage of a linear search is that

A) it is simple.

B) it is efficient.

C) it is fast.

D) it can be used on unordered data.

E) both A and D

Q3) The ________ sort usually performs fewer exchanges than the ________ sort. A) bubble, selection B) selection, bubble

C) binary, linear

D) linear, binary

E) linear, bubble

Q4) A binary search requires that the elements be in order. A)True

B)False

Page 11

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

Chapter 10: Pointers

Available Study Resources on Quizplus for this Chatper

62 Verified Questions

62 Flashcards

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

Sample Questions

Q1) Dynamic memory allocation occurs

A) when a variable is created by the compiler.

B) when a variable is created at run-time.

C) when a pointer fails to dereference the right variable.

D) when a pointer is assigned an incorrect address.

E) None of the above

Q2) ________ can be used as pointers.

A) Array names

B) C++ string objects

C) Punctuation marks

D) All of the above

E) None of the above

Q3) C++ does not perform array bounds checking.

A)True

B)False

Q4) An array name is a pointer constant because the address it represents cannot be changed during run-time.

A)True

B)False

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

Chapter 11: More About Classes and Object-Oriented Programming

Available Study Resources on Quizplus for this Chatper

70 Verified Questions

70 Flashcards

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

Sample Questions

Q1) If an rvalue reference refers to a memory location, that memory location becomes an lvalue.

A)True

B)False

Q2) A static member function cannot be called if no objects of the class exist.

A)True

B)False

Q3) The base class's ________ affects the way its members are inherited by the derived class.

A) name

B) return data type

C) access specification

D) both A and B

E) None of the above

Q4) When you derive a class from an existing class, you

A) can add new data, but cannot add new functions.

B) can add new functions, but cannot add new data.

C) can add both new data and new functions.

D) must add both new data and new functions.

E) None of the above

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

Chapter 12: More on C-Strings and the String Class

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

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

Sample Questions

Q1) The string class member function ________ returns the C-string value of the string object.

A) c_string(string s)

B) c_str(string s)

C) c_str()

D) c_string()

E) None of the above

Q2) An array of characters ending with the null terminator is called

A) a C-string.

B) a C++ String.

C) a string literal.

D) a string class object.

E) None of the above

Q3) The expression strcmp("ab", "cde") returns

A) the boolean value false.

B) the boolean value True.

C) a negative integer.

D) a nonnegative integer.

E) None of the above

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

Chapter 13: Advanced File and Io Operations

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

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

Sample Questions

Q1) All stream objects have ________ that indicate the condition of the stream.

A) error state bits

B) condition statements

C) markers

D) intrinsic error messages

E) None of the above

Q2) The statement dataFile.close();

A) is illegal in C++.

B) needs a file name argument to execute correctly.

C) closes a file.

D) is legal but risks losing valuable data.

E) None of the above

Q3) When the >> operator extracts information from a file, it expects to read data that are separated by A) commas.

B) tabs.

C) whitespace.

D) semicolons.

E) None of the above

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

Page 15

Chapter 14: Recursion

Available Study Resources on Quizplus for this Chatper

20 Verified Questions

20 Flashcards

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

Sample Questions

Q1) The speed and amount of memory available to modern computers diminishes the performance impact of the overhead of recursion so much that for many applications, this overhead is not noticeable.

A)True

B)False

Q2) Recursive algorithms tend to be less efficient than iterative algorithms.

A)True

B)False

Q3) A recursive function that does not correctly handle its base case may

A) return 0 and stop.

B) return FALSE and stop.

C) cause an infinite chain of recursive calls.

D) reach the NULL terminator and stop.

E) None of the above

Q4) 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 the above

Page 16

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

Chapter 15: Polymorphism and Virtual Functions

Available Study Resources on Quizplus for this Chatper

22 Verified Questions

22 Flashcards

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

Sample Questions

Q1) ________ functions are dynamically bound by the compiler.

A) Constructor

B) Destructor

C) Static

D) Virtual

E) None of the above

Q2) In C++ polymorphism is very difficult to achieve unless you also use inheritance.

A)True

B)False

Q3) When the compiler binds a call to a member function using only information available at compile time, the compiler is said to use ________ binding.

A) local

B) safe

C) static

D) dynamic

E) None of the above

Q4) Static binding occurs when the compiler binds a function call at compile time.

A)True

B)False

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

Chapter 16: Exceptions, Templates, and the Standard

Template Library Stl

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

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

Sample Questions

Q1) A ________ is a "generic" function that can work with different data types.

A) function argument

B) function parameter

C) function template

D) member function

E) None of the above

Q2) Non-template functions have a slight advantage in speed over template functions.

A)True

B)False

Q3) All type parameters defined in a function template must appear at least once in the A) function parameter list.

B) preprocessor directives.

C) function call.

D) type.h file.

E) None of the above

Q4) Using a function template often requires writing less code than overloading a function.

A)True

B)False

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

38 Verified Questions

38 Flashcards

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

Sample Questions

Q1) In many recursive operations on linked lists,

A) the head of the list is chopped off and thrown away.

B) the base case considers the last element of the list.

C) the base case is when the list is empty or has a single element.

D) All of the above

E) None of the above

Q2) A list that contains pointers to the previous node, the next node, and a node in the third dimension is known as a triple-linked list.

A)True

B)False

Q3) Nodes in a linked list are stored in contiguous memory.

A)True

B)False

Q4) When you delete a node from a linked list, you must ensure that the links in the surrounding nodes are set to bypass the node being deleted.

A)True

B)False

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

19

Chapter 18: Stacks and Queues

Available Study Resources on Quizplus for this Chatper

36 Verified Questions

36 Flashcards

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

Sample Questions

Q1) A(n) ________ is an abstract data type that stores and retrieves items in a last-in-first-out manner.

A) array

B) queue

C) stack

D) vector

E) None of the above

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

A)True

B)False

Q3) Stacks are useful data structures for algorithms that work with lists of items in a

A) first in, first out order.

B) first in, last out order.

C) last in, last out order.

D) garbage in, garbage out order.

E) None of the above

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

Chapter 19: Binary Trees

Available Study Resources on Quizplus for this Chatper

38 Verified Questions

38 Flashcards

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

Sample Questions

Q1) A program keeps track of a binary tree using a pointer to A) one of its leaves.

B) its root node.

C) the node in the tree holding the biggest value.

D) the node in the tree holding the smallest value.

E) None of the above

Q2) The preorder method of traversing a binary tree involves processing the root node's data, traversing the left subtree, and then traversing the right subtree.

A)True

B)False

Q3) Deleting a node from a binary search tree node

A) is easiest when the node is the root.

B) is hardest when the node is a leaf.

C) is hardest when the node has one child.

D) is hardest when the node has two children.

E) None of the above

Q4) There exists a binary tree with a hundred nodes, but only one leaf.

A)True

B)False

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

Turn static files into dynamic content formats.

Create a flipbook
Programming Fundamentals Final Exam Questions - 766 Verified Questions by Quizplus - Issuu