Programming Fundamentals Final Exam Questions
Programming Fundamentals Final Exam Questions
https://quizplus.com/study-set/319
21 Chapters
1050 Verified Questions
Programming Fundamentals
Final Exam Questions
Cou
Programming Fundamentals introduces students to the basic concepts and principles of
computer programming. This course covers essential topics such as data types,
variables, control structures (loops and conditionals), functions, and basic algorithms.
Students will learn to design, write, and debug simple programs using a modern
constructs and applying them to solve real-world problems. By the end of the course,
students will have gained a solid foundation for further study in computer science and
software development.
Recommended Textbook
C++ Programming Program Design Including Data Structures 6th Edition by D.S. Malik
Page 2
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/128444
Sample Questions
Q1) The programming language C++ evolved from ____.
A) BASIC
B) assembly
C) C
D) C+
Answer: C
Q3) When you compile your program,the compiler identifies the logic errors and
suggests how to correct them.
A)True
B)False
Answer: False
To view all questions and flashcards with answers, click on the resource link above.
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/5305
Sample Questions
Q1) ____________________ can be used to identify the authors of the program,give
the date when the program is written or modified,give a brief explanation of the
program,and explain the meaning of key statements in a program.
Answer: Comments
comments
Q2) Suppose that alpha and beta are int variables.The statement alpha = --beta; is
equivalent to the statement(s)____.
A) alpha = 1 - beta;
B) alpha = beta - 1;
C) beta = beta - 1;
Alpha = beta;
D) alpha = beta;
Beta = beta - 1;
Answer: C
To view all questions and flashcards with answers, click on the resource link above.
Page 4
Chapter 3: Input/Output
Available Study Resources on Quizplus for this Chatper
50 Verified Questions
50 Flashcards
Source URL: https://quizplus.com/quiz/5306
Sample Questions
Q1) Suppose that x and y are int variables,ch is a char variable,and the input is: 4 2 A 12
Choose the values of x,y,and ch after the following statement executes:
Cin >> x >> ch >> y;
A) x = 4, ch = 2, y = 12
B) x = 4, ch = A, y = 12
C) x = 4, ch = ' ', y = 2
D) This statement results in input failure
Answer: D
Q2) To use the manipulator setprecision,the program must include the header file
____________________.
Answer: iomanip
Q3) When you want to process only partial data,you can use the stream function ____
to discard a portion of the input.
A) clear
B) skip
C) delete
D) ignore
Answer: D
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
50 Verified Questions
50 Flashcards
Source URL: https://quizplus.com/quiz/5307
Sample Questions
Q1) A control structure alters the normal sequential flow of execution in a program.
A)True
B)False
To view all questions and flashcards with answers, click on the resource link above.
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/128467
Sample Questions
Q1) In a sentinel-controlled while loop,the body of the loop continues to execute until the
EOF symbol is read.
A)True
B)False
Q2) In a while and for loop,the loop condition is evaluated before executing the body of
the loop.Therefore,while and for loops are called ____________________ loops.
Q4) What is the value of x after the following statements execute? int x = 5;
Int y = 30;
Do
X = x * 2;
While (x < y);
A) 5
B) 10
C) 20
D) 40
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/5309
Sample Questions
Q1) Given the function prototype: double testAlpha(int u,char v,double t); which of the
following statements is legal?
A) cout << testAlpha(5, 'A', 2);
B) cout << testAlpha( int 5, char 'A', int 2);
C) cout << testAlpha('5.0', 'A', '2.0');
D) cout << testAlpha(5.0, "65", 2.0);
Q3) To use the predefined function tolower,the program must include the header file
____.
A) <cctype>
B) <iostream>
C) <cmath>
D) <cstdlib>
To view all questions and flashcards with answers, click on the resource link above.
Page 8
Chapter 7: User-Defined Simple Data Types, Namespaces,
Sample Questions
Q1) A data type wherein you directly specify values in the variable declaration with no
type name is called a(n)____________________type.
Q3) Suppose str = "abcd".After the statement str = str + "ABCD"; the value of str is
"____________________".
Q5) Before using the data type string,the program must include the header file ____.
A) enum
B) iostream
C) string
D) std
Page 10
Chapter 8: Arrays and Strings
Available Study Resources on Quizplus for this Chatper
50 Verified Questions
50 Flashcards
Source URL: https://quizplus.com/quiz/5311
Sample Questions
Q1) Consider the following statement: double alpha[10][5];.The number of components
of alpha is ____.
A) 15
B) 50
C) 100
D) 150
Q2) The following statements store the value ____________________ into len.
int len;
len = strlen("Sunny California");
Q5) If an array index goes out of bounds,the program always terminates in an error.
A)True
B)False
Page 11
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/5312
Sample Questions
Q1) The syntax for accessing a struct member is structVariableName____.
A) .memberName
B) *memberName
C) [memberName]
D) $memberName
Q2) Consider the accompanying struct definition in Figure 1.The statement that initializes
the member testScore to 95 is ____________________.
Q6) You can use an assignment statement to copy the contents of one struct into
another struct of the same type.
A)True
B)False
To view all questions and flashcards with answers, click on the resource link above.
Chapter 10: Classes and Data Abstraction
Available Study Resources on Quizplus for this Chatper
50 Verified Questions
50 Flashcards
Source URL: https://quizplus.com/quiz/128469
Sample Questions
Q1) 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
To view all questions and flashcards with answers, click on the resource link above.
Chapter 11: Inheritance and Composition
Available Study Resources on Quizplus for this Chatper
50 Verified Questions
50 Flashcards
Source URL: https://quizplus.com/quiz/5314
Sample Questions
Q1) The constructors of a derived class can (directly)initialize only the (public
data)members inherited from the base class of the derived class.
A)True
B)False
Q2) If the derived class classD overrides a public member function functionName of the
base class classB,then to specify a call to that public member function of the base class
you use the statement ____.
A) classD::functionName();
B) classB::functionName();
C) classD.functionName();
D) classB.functionName();
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
To view all questions and flashcards with answers, click on the resource link above.
Page 14
Chapter 12: Pointers, Classes, Virtual Functions, Abstract
Sample Questions
Q1) 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
To view all questions and flashcards with answers, click on the resource link above.
Chapter 13: Overloading and Templates
Available Study Resources on Quizplus for this Chatper
50 Verified Questions
50 Flashcards
Source URL: https://quizplus.com/quiz/5316
Sample Questions
Q1) Using a class template,you can write a single code segment for a set of related
____.
A) classes
B) functions
C) operators
D) constructors
Q3) 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
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
50 Verified Questions
50 Flashcards
Source URL: https://quizplus.com/quiz/5317
Sample Questions
Q1) The statements that may generate an exception are placed in a ____ block.
A) throw
B) finally
C) try
D) catch
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) If the operator new cannot allocate memory space,this operator throws
a(n)____________________ exception.
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;
Q5) If the operator new cannot allocate memory space,this operator throws
a(n)____________________ exception.
Sample Questions
Q1) Every call to a recursive function requires the system to allocate memory for the local
variables and formal parameters.
A)True
B)False
Q5) If a function A calls function B and function B calls function A,then function A is
____________________ recursive.
To view all questions and flashcards with answers, click on the resource link above.
Chapter 16: Linked Lists
Available Study Resources on Quizplus for this Chatper
50 Verified Questions
50 Flashcards
Source URL: https://quizplus.com/quiz/5319
Sample Questions
Q1) In a circular linked list with more than one node,it is convenient to make the pointer
first point to the ____________________ node of the list.
Q2) Consider the accompanying code.What is the effect of the following statement?
newNode->info = 50;
A) Stores 50 in the info field of the newNode
B) Creates a new node
C) Places the node at location 50
D) Cannot be determined from this code
Q3) In a linked list,if a new item is always inserted at the beginning or at the end of the
list and the data read is unsorted,the linked list will be unsorted.
A)True
B)False
Q5) You can use the pointer head of a linked list to traverse the list.
A)True
B)False
Page 19
To view all questions and flashcards with answers, click on the resource link above.
Chapter 17: Stacks and Queues
Available Study Resources on Quizplus for this Chatper
50 Verified Questions
50 Flashcards
Source URL: https://quizplus.com/quiz/5320
Sample Questions
Q1) In the array representation of a stack,the stack is initialized simply by setting
stackTop to ____________________.
Q4) The expression a + b is the same in both infix notation and postfix notation.
A)True
B)False
To view all questions and flashcards with answers, click on the resource link above.
Chapter 18: Searching and Sorting Algorithms
Available Study Resources on Quizplus for this Chatper
50 Verified Questions
50 Flashcards
Source URL: https://quizplus.com/quiz/5321
Sample Questions
Q1) The ____________________ search algorithm is the optimal worst-case
algorithm for solving search problems by using the comparison method.
Q2) For a list of length n,selection sort makes ____ item assignments.
A) n(n - 1)/2
B) 3(n - 1)
C) 3(n)
D) 4(n + 1)
Q3) A sequential search of an n-element list takes ____ key comparisons on average to
determine whether the search item is in the list.
A) 0
B) n/2
C) n
D) n<sup>2</sup>
To view all questions and flashcards with answers, click on the resource link above.
Page 21
Chapter 19: Binary Trees
Available Study Resources on Quizplus for this Chatper
50 Verified Questions
50 Flashcards
Source URL: https://quizplus.com/quiz/5322
Sample Questions
Q1) The ____________________ of a binary tree is the number of nodes on the
longest path from the root to a leaf.
Q4) After deleting the desired item from a binary search tree,the resulting tree must be a
binary search tree.
A)True
B)False
Sample Questions
Q1) The ____ of sets A and B is the set of all elements that are in A or in B.
A) intersection
B) union
C) graph
D) reunion
Q3) The ____________________ algorithm gives the shortest distance for a given
node to every other node in the graph.
Q4) Let G be an undirected graph.Let u and v be two vertices in G.Then u and v are called
____ if there is an edge from one to the other.
A) adjacent
B) weighted
C) connected
D) shortest path
Sample Questions
Q1) Functions begin and end do not take any parameters.
A)True
B)False
Q2) The vector container stores and manages its objects in a dynamic array.
A)True
B)False
Q5) You must use the container name,the container element type,and the scope
resolution operator to use the typedef iterator.
A)True
B)False
To view all questions and flashcards with answers, click on the resource link above.