Computational Problem Solving MCQ PDF
Computational Problem Solving MCQ PDF
MCQ PDF
https://quizplus.com/study-set/1103
18 Chapters
899 Verified Questions
Computational Problem Solving
MCQ PDF
Cou
Computational Problem Solving introduces students to foundational concepts and
techniques used to design, implement, and analyze algorithms for tackling complex
problems. The course emphasizes computational thinking, logical reasoning, and the
break down problems, develop step-by-step solutions, and implement these using a
Recommended Textbook
C++ Programming From Problem Analysis to Program Design 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/128446
Sample Questions
Q1) A(n) ____ consists of data and the operations on those data.
A) disk
B) compiler
C) interpreter
D) object
Answer: D
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/21709
Sample Questions
Q1) A mixed arithmetic expression contains all operands of the same type.
A)True
B)False
Answer: False
Q2) The value of the expression 33/10, assuming both values are integral data types, is
____.
A) 0.3
B) 3
C) 3.0
D) 3.3
Answer: B
Q3) The maximum number of significant digits in values of the double type is 15.
A)True
B)False
Answer: True
Sample Questions
Q1) The manipulator ____________________ is used to output the value of an
expression in a specific number of columns.
Answer: setw
Q2) Suppose that x and y are int variables, z is a double variable, and the input is: 28 32.6
12
Choose the values of x, y, and z after the following statement executes:
Cin >> x >> y >> z;
A) x = 28, y = 32, z = 0.6
B) x = 28, y = 32, z = 12.0
C) x = 28, y = 12, z = 32.6
D) x = 28, y = 12, z = 0.6
Answer: A
Q3) You can disable the manipulator left by using the stream function
____________________.
Answer: unsetf
Q4) The functions get, ignore, and so on are members of the data type
____________________.
Answer: istream
Sample Questions
Q1) To output results correctly, the switch structure must include a(n)
____________________ statement after each cout statement, except the last cout
statement.
Q2) Suppose P and Q are logical expressions. The logical expression P && Q is true if both
P and Q are true.
A)True
B)False
Q3) The expression (x >= 0 && x <= 100) evaluates to false if either x < 0 or x >= 100.
A)True
B)False
Q4) Which of the following is the "not equal to" relational operator?
A) !
B) |
C) !=
D) &
Page 6
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/21712
Sample Questions
Q1) Which of the following is a repetition structure in C++?
A) if
B) switch
C) while...do
D) do...while
Q2) To generate a random number, you can use the function rand of the header file
____________________.
Q4) Assume that all variables are properly declared. The following for loop executes 20
times.
for (i = 0; i <= 20; i++)
cout << i;
A)True
B)False
Q6) The for loop body executes indefinitely if the loop condition is always
____________________.
Page 7
To view all questions and flashcards with answers, click on the resource link above.
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) Once you write and properly debug a function, you can use it in the program (or
different programs) again and again without having to rewrite the same code
repeatedly.
A)True
B)False
Q5) When you attach & after the dataType in the formal parameter list of a function, the
variable following that dataType becomes a(n) ____________________
parameter.
To view all questions and flashcards with answers, click on the resource link above.
Chapter 7: User-Defined Simple Data Types, Namespaces,
Sample Questions
Q1) In C++, ____ is called the scope resolution operator.
A) .
B) \(?\)
C) :
D) ::
Q3) A data type wherein you directly specify values in the variable declaration with no
type name is called a(n) ____________________type.
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) Given the following declaration: int j;
Int sum;
Double sale[10][7];
Which of the following correctly finds the sum of the elements of the fourth column of
sale?
A) sum = 0;
For(j = 0; j < 7; j++)
Sum = sum + sale[j][3];
B) sum = 0;
For(j = 0; j < 7; j++)
Sum = sum + sale[j][4];
C) sum = 0;
For(j = 0; j < 10; j++)
Sum = sum + sale[j][4];
D) sum = 0;
For(j = 0; j < 10; j++)
Sum = sum + sale[j][3];
To view all questions and flashcards with answers, click on the resource link above.
Page 10
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) Both arrays and structs are examples of ____________________ data types.
Q2) Consider the accompanying struct definition in Figure 1. The statement cout
____________________ outputs the variables firstName and lastName separated
by one space.
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
49 Verified Questions
49 Flashcards
Source URL: https://quizplus.com/quiz/21717
Sample Questions
Q1) The word ____ at the end of the member functions in the accompanying class
clockType in Figure 1 specifies that these functions cannot modify the member variables
of a clockType object.
A) static
B) const
C) automatic
D) private
Q2) 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
Q4) If an object is created in a user program, then the object can access both the public
and private members of the class.
A)True
B)False
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) C++ provides ____ functions as a means to implement polymorphism in an
inheritance hierarchy, which allows the run-time selection of appropriate member
functions.
A) redefined
B) overridden
C) virtual
D) overloaded
Q5) To define new classes in C++, you create new ____________________ files.
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) The dereferencing operator is also known as the indirection operator and refers to
the object to which its operand points.
A)True
B)False
Q3) In ____ binding, the necessary code to call a specific function is generated by the
compiler.
A) static
B) dynamic
C) shallow
D) deep
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/21720
Sample Questions
Q1) The ____________________ operator function as a member of a class has only
one parameter; as a nonmember of a class, it has two parameters.
Q3) Suppose cType is a class template, which can take int as a parameter. The
statement: ____ declares x to be an object of type cType, and the type passed to the
class cType is int.
A) cType<int> x;
B) cType int x;
C) cType int = x;
D) cType int :: x;
Q4) The name of the function to overload the operator <= is ____.
A) overload<=
B) <=new
C) operator<=
D) <=operator
Sample Questions
Q1) The class ____________________ deals with the string subscript out of range
error.
Q3) Suppose you have written a program that inputs data from a file. If the input file
does not exist when the program executes, then you should choose which option?
A) Terminate the program.
B) Include code in the program to recover from the exception.
C) Log the error and continue.
D) Include code in the header file.
Q4) When an exception occurs in a try block, control immediately passes to one of the
____________________ blocks.
Page 16
To view all questions and flashcards with answers, click on the resource link above.
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) The following is a valid recursive definition to determine the factorial of a
non-negative integer.
0! = 1
1! = 1
n! = n * (n - 1)! if n > 0
A)True
B)False
Q2) If you execute an infinite recursive function on a computer, the function executes
until the system runs out of ____________________.
Q3) Which of the following solution methods would be the best choice for a mission
control system?
A) Iterative
B) Direct recursive
C) Indirect recursive
D) Infinite recursive
Q4) To design a recursive function, you must determine the limiting conditions.
A)True
B)False
Sample Questions
Q1) Assume that n = 1000. To sort the list, bubble sort makes about ____ item
assignments.
A) 10,000
B) 100,000
C) 250,000
D) 500,000
Q2) For a list of length n, insertion sort makes ____ item assignments.
A) n(n-1)/4
B) n(n-1)/2
C) n<sup>2</sup>
D) n<sup>3</sup>
Q3) When moving array values for insertion sort, to move list[4] into list[2], first ____.
A) move list[2] to list[3]
B) delete list[2]
C) move list[4] to list[3]
D) copy list[4] into temp
Q4) If you want to use the class vector in your program, you must include the following
statement: ____________________.
Sample Questions
Q1) A linked list must be searched ____________________, starting from the first
node.
Q2) When building a linked list in the ____ manner, a new node is always inserted at the
end of the linked list.
A) backward
B) forward
C) traversal
D) random
Q3) Each node of a linked list must store the data as well as the
____________________ for the next node in the list
Q4) In a linked list, the address of the first node in the list is stored in a separate location,
called the ____ or first.
A) head
B) pointer
C) front
D) top
Q6) The ____________________ operator advances the iterator to the next node in
the linked list.
Page 19
To view all questions and flashcards with answers, click on the resource link above.
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 a(n) ____________________ array, the first array position immediately
follows the last array position.
Q2) A(n) ____ is a list of homogenous elements in which the addition and deletion of
elements occurs only at one end.
A) stack
B) queue
C) array
D) linked list
Q3) In the linked implementation of stacks, the memory to store the stack elements is
allocated statically.
A)True
B)False
Q4) 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
To view all questions and flashcards with answers, click on the resource link above.
Page 20