0% found this document useful (0 votes)
8 views20 pages

Computational Problem Solving MCQ PDF

The document outlines a course on Computational Problem Solving, focusing on algorithm design, implementation, and analysis using programming. It includes resources such as 18 chapters and 899 verified questions and flashcards for study. Key topics covered are problem decomposition, algorithm development, control structures, and debugging, with practical applications across various disciplines.

Uploaded by

evrqcau0vf
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views20 pages

Computational Problem Solving MCQ PDF

The document outlines a course on Computational Problem Solving, focusing on algorithm design, implementation, and analysis using programming. It includes resources such as 18 chapters and 899 verified questions and flashcards for study. Key topics covered are problem decomposition, algorithm development, control structures, and debugging, with practical applications across various disciplines.

Uploaded by

evrqcau0vf
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Computational Problem Solving

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

use of programming to automate solutions in real-world scenarios. Students learn to

break down problems, develop step-by-step solutions, and implement these using a

modern programming language. Key topics include problem decomposition, algorithm

development, control structures, data structures, and debugging. Through hands-on

projects and exercises, students gain practical experience in applying computational

methods to a variety of applications across different disciplines.

Recommended Textbook
C++ Programming From Problem Analysis to Program Design 6th Edition by D.S. Malik

Available Study Resources on Quizplus


18 Chapters
899 Verified Questions
899 Flashcards
Source URL: https://quizplus.com/study-set/1103

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

Q2) The programming language C++ evolved from ____.


A) BASIC
B) assembly
C) C
D) C+
Answer: C

Q3) To develop a program to solve a problem, you start by ____.


A) analyzing the problem
B) implementing the solution in C++
C) designing the algorithm
D) entering the solution into a computer system
Answer: A

Q4) The ASCII data set consists of ____________________ characters.


Page 3
Answer: 128

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

Q4) A data type is called ____________________ if the variable or named constant


of that type can store only one value at a time.
Answer: simple

Q5) A(n) ____________________ is a sequence of zero or more characters.


Answer: string
Page 4
To view all questions and flashcards with answers, click on the resource link above.
Chapter 3: Inputoutput
Available Study Resources on Quizplus for this Chatper
50 Verified Questions
50 Flashcards
Source URL: https://quizplus.com/quiz/21710

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

Q5) cin is called a(n) ____________________ object.


Answer: istream
Page 5
To view all questions and flashcards with answers, click on the resource link above.
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/21711

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

Q5) In C++, both ! and != are relational operators.


A)True
B)False

Q6) The value of the expression 7 + 8 <= 15 is ____________________.

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
____________________.

Q3) A loop ____________________ is a set of statements that remains true each


time the loop body is executed.

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

Q5) If a(n) ____________________ statement is placed in a do...while structure, the


loop-continue test is evaluated immediately after this statement.

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

Q2) The statement: return 37, y, 2 * 3; returns the value ____.


A) 2
B) 3
C) y
D) 6

Q3) A(n) ____________________ parameter s a formal parameter that receives a


copy of the content of the corresponding actual parameter.

Q4) The execution of a return statement in a user-defined function terminates the


program.
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.

Q6) In C++, :: is called the ____________________.


Page 8

To view all questions and flashcards with answers, click on the resource link above.
Chapter 7: User-Defined Simple Data Types, Namespaces,

and the String Type


Available Study Resources on Quizplus for this Chatper
50 Verified Questions
50 Flashcards
Source URL: https://quizplus.com/quiz/21714

Sample Questions
Q1) In C++, ____ is called the scope resolution operator.
A) .
B) \(?\)
C) :
D) ::

Q2) Which of the following statements declares the studentGrade variable?


A) enum studentGrade {A, B, C, D, F};
B) enum int {A, B, C, D, F} studentGrade;
C) enum studentGrade {A, B, C, D, F} grades;
D) enum grades {A, B, C, D, F} studentGrade;

Q3) A data type wherein you directly specify values in the variable declaration with no
type name is called a(n) ____________________type.

Q4) The string expression strVar.____________________ inserts all the characters


of str at index pos into strVar.

Q5) Suppose str = "ABCDEFG". The output of the statement


cout << str.length() << endl;
is ____________________.

Q6) Suppose str = "abcd". After the statement


Page 9 str = str + "ABCD"; the value of str is
"____________________".

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];

Q2) The word ____________________ is used before the array declaration in a


function heading to prevent the function from modifying the array.

Q3) The statement strlen("Marylin Stewart"); returns ____________________.

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.

Q3) Which of the following is an allowable aggregate operation on a struct?


A) Arithmetic
B) Assignment
C) Input/output
D) Comparison

Q4) A struct is typically a ____ data structure.


A) simple
B) dynamic
C) heterogeneous
D) linked

Q5) A struct variable can be passed as a parameter ____.


A) only by const
B) only by reference
C) only by value
D) either by value or by reference

Q6) Arrays are passed by ____________________


Page 11 only.

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

Q3) A(n) ____________________ is a statement specifying what is true after the


function call is completed.

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

Q2) Which of the following statements about inheritance is true if


memberAccessSpecifier is protected?
A) The private members of the base class become protected members of the derived
class.
B) The derived class can directly access any member of the base class.
C) The public members of the base class become protected members of the derived
class.
D) The protected members of the base class become private members of the derived
class.

Q3) In object-oriented design, we debug ____________________; in structured


programming, we debug functions.

Q4) Objects are created when ____________________ variables are declared.

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

Q2) The C++ operator ____ is used to destroy dynamic variables.


A) destroy
B) delete
C) *
D) ~

Q3) In ____ binding, the necessary code to call a specific function is generated by the
compiler.
A) static
B) dynamic
C) shallow
D) deep

Q4) In C++, ____ is called the address of operator.


A) &
B) *
C) #
Page 14
D) ->

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.

Q2) The return type of the function operator == is ____.


A) int
B) bool
C) char
D) void

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&lt;int&gt; 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

Q5) In C++, a function ____________________ can be overloaded.


Page 15
To view all questions and flashcards with answers, click on the resource link above.
Chapter 14: Exception Handling
Available Study Resources on Quizplus for this Chatper
50 Verified Questions
50 Flashcards
Source URL: https://quizplus.com/quiz/21721

Sample Questions
Q1) The class ____________________ deals with the string subscript out of range
error.

Q2) In C++, throw is a(n) ____________________ word.

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.

Q5) An object that is being thrown cannot be an anonymous object.


A)True
B)False

Q6) Which of the following statements throws a valid exception in C++?


A) throw.function();
B) throw 2;
C) throws str;
D) 4 throw;

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

Q5) The collating sequence of A in the ASCII character set is


____________________.
Page 17
To view all questions and flashcards with answers, click on the resource link above.
Chapter 16: Searching, Sorting and the Vector Type
Available Study Resources on Quizplus for this Chatper
50 Verified Questions
50 Flashcards
Source URL: https://quizplus.com/quiz/21723

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: ____________________.

Q5) The first element in a vector object is at location ____________________.

To view all questions and flashcards withPage


answers,
18 click on the resource link above.
Chapter 17: Linked Lists
Available Study Resources on Quizplus for this Chatper
50 Verified Questions
50 Flashcards
Source URL: https://quizplus.com/quiz/21724

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

Q5) In C++, the dereferencing operator is ____________________.

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

Q5) The ____________________ constructor is called when a stack object is


passed as a (value) parameter to a function.

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

Page 20

You might also like