You are on page 1of 14

Execution of multiple activities at same time is called.

Parallel processing.
Multitasking.
All of above.
Multiprocessing.

Parallelism leads to what


Distribution
Non-simultaneous.
Decentralization.
Concurrency.

ensure that only one process at a time may be granted to resources.


Mutual exclusive.
Mutual cooperation.
Deadlock.
Mutual inclusive.

A process is an active entity.


True
False

Select the correct output for this program.


cout<<"Hello to ITP";
cout<<"BYE BYE ";
BYE BYE
Hello to ITP BYE BYE
Error
Hello to ITP

A loop structure consists of:


All of above.
Body of Loop.
Loop control variable.
Condition.

Choose the correct loop syntax in C++.


for(declaration; increment operation; condition);
Both b and c
for(declaration; condition; increment operation);
for(initialization; condition; inc/dec);

A structure is called as______array.


Select the correct option
single dimensional
multi-dimensional
heterogeneous
homogeneous

In programming language, '=' operator is used to represent _____operation.


Select the correct option
assignment
equal to
comparison
inequivalent
Assignment statement is
Select the correct option
declarative
object oriented
functional
imperative
___ type of statement.

What should be printed on screen? if(-1 == -1) cout<<"LOVE PAKISTAN'; else cout<<T;
Select the correct option
I
LOVE PAKISTAN
I LOVE PAKISTAN
Compilation Error.

In imperative paradigm, statements are executed


Select the correct option
randomly
last statement at the start
sequentially
first statement at the end

int a=15; if (a <15) cout << "a"; else cout << "abc": What would be the output?
Select the correct option
abc
aabc
15

What type of control structure is used in the following statement?


while(expression) statement;
Select the correct option
Selection.
Symmetric
Sequence
Loop

Integer data type can only store _______numbers.


Select the correct option
fractions
whole
decimal
real

Which of the following is the correct way to declare a variable named shipping_price which will store the price converted from
dollars which is not necessarily a whole number.
Select the correct option
float shipping_price;
char shipping_price;
int shipping_price;
boolean shipping_price;

Nested functions are example of


__paradigm.
Select the correct option
declarative
imperative
object oriented
functional
C#, Java are examples of
Select the correct option
imperative paradigm
declarative paradigm
functional paradigm
object oriented paradigm
paradigm?

In _______ paradigm, a program is developed by connecting predefined functions so that each functions outputs are used as
another functions inputs in such a way that the desired overall input-to-output relationship is obtained.
Select the correct option
imperative paradigm
functional paradigm
declarative paradigm
object oriented paradigm

An object is a part of a particular class is also known as a/an _______ of that class.
Select the correct option
case
instance
part
type

Choose the correct type of array to store the data given below.
50.5
60
70
70.8
Select the correct option
float number[5]
int number[5]
float number[6]
int number[6]
80

A two-dimensional array of integers named Scores having two rows and nine columns will be declared as:
Select the correct option
int Scores [9][2];
int Scores 2][9]:
int Scores[9]/[2]:
int Scores[2]/[9];

Descriptive names used in programming languages are called


Select the correct option
data type
int
float
variable

In OOP, each object is consist of collection of


Select the correct option
methods
elements
units
classes
A
_is a computer language programmers use to develop software programs, scripts, or other sets of instructions for computers to
execute.
Select the correct option
natural language
Java Language
C++ language
programming language

If a program is installed on two different machines and by making small changes it can be used on both. This is known as
Select the correct option
disadvantage of machine independence
disadvantage of machine dependence
goal of machine dependence
goal of machine independence

Weather forecasting is an example of ____ programming paradigm.


Select the correct option
functional
object oriented
declarative
imperative

A compiler translates
code to machine language at a time.
Select the correct option
complete
module by module.
one by one each instruction
function by function

Start finding an algorithm and then express that algorithm in sequence of commands. This approach is known as
Select the correct option
functional paradigm
imperative paradigm
object oriented paradigm
declarative paradigm

is an entity which takes some inputs and produces some output.


Select the correct option
Module
Program
Function
Task

programming is emerged as a result of the declarative paradigm.


Select the correct option
Functional
Logic
Procedural
Object oriented
The extended part of the compiler, which is not the actual part of the standard language, is called
Select the correct option
machine independence
machine dependence.
compiler extension
language extension

The programmer develops a precise statement of the described problem to be solved rather than describing an algorithm. This
approach is known as
Select the correct option
declarative paradigm
functional paradigm
object oriented paradigm
imperative paradigm

Programming languages are evolved in _______ no of paradigms


Select the correct option
3
2

FORTRAN stands for


Select the correct option
Formula transition
Reload Math Equations
Formula transporter
Formula transfer
Formula translator

Mnemonics are ________ to represent early generation language codes.


Select the correct option
words
names
symbols
characters

Software verification is to check correctness of software


Select the correct option
After deployment.
At the time of deployment.
Before deployment.
Before and after deployment

Identifiers are also known as


Select the correct option
variables
values
constants
names

In 2018, Welsch NHS a UK hospital software was failed because of the_______ issue.
Select the correct option
security
graphical
architectural
technical
If we are using sequential search algorithm and required element lies at the end of the list, then it will be considered.
Select the correct option
Best case scenario
Worst case scenario
Average case scenario
Medium case scenario

A complete mnemonic system used for representing is collectively known as


Select the correct option
assembly language
natural language
programming language
machine language

translates one instruction to machine language at a time.


Select the correct option
interpreter
translator
both a,b
compiler

Machine language consists of ________ digit system.


Select the correct option
decimal
octal
hexadecimal
binary

Difference between software program believed to be correct and the software program that is correct is known as
Select the correct option
Software Verification
Software Compatibility
Software Correctness
Software Validation

Insertion sort
elect the correct option
deletes elements in a list.
combines two lists.
divides two lists.
arranges elements in ascending or descending order.

Binary search starts comparison from the______


Select the correct option
Middle
Start and end both
End
Start

What is ascending order in alphabetical order?


Select the correct option
arranged in a series that begins with the least or smallest and ends with the greatest or largest
arranged in a series that begins with the odd number of elements.
arranged in a series that begins with the even number of elements.
arranged in a series that begins with the greatest or largest and ends with the least or smallest
Test for termination in recursive control is known as
Select the correct option
degenerate case
best case
both a,b
base case

Binary search algorithm works with ________ list?


Select the correct option
Shortlists
Multiple lists
Sub-lists
Long lists

What is a binary search algorithm?


Select the correct option
Divides an unsorted list and search element in it.
Divides sorted list into two lists and search element in it.
Sorts two lists and merges them and search elements in it.
One sorted and other unsorted list combine both and search elements in it.

Sequential search
Select the correct option
uses divide and conquer rule
randomly searches the list
linearly checks each element until a match is found.
matches sub-lists

If we have 30000 entries in a list and we are using a binary search algorithm. How many comparisons will be performed to find
the last element?
Select the correct option
15000
30000
30
15

The binary search executes each stage of the repetition as a ______ of the previous stage.
Select the correct option
task
part
subtask
copy

Efficiency of an algorithm is
Select the correct option
time required to delete the element from the end of the list.
time required to search an element.
number of comparisons required to find an element.
time required to add elements at the end of the list.

is a sorting algorithm that places an unsorted element at its suitable place in each iteration.
Select the correct option
Insertion sort
Bubble sort
Merge sort
Quick sort
Which of the following examples is based on insertion sort?
Select the correct option
Database scenarios and distributes scenarios
Real-time systems
Finding the value of X
Sorting a list of names into alphabetical order

If the test for termination of a loop is performed before the body is executed then the loop is known as
Select the correct option
whitebox test loop
post-test loop
pretest loop
blackbox test loop

____loop structure referred to as a pre-test loop.


Select the correct option
Sequential
Unconditional
Repeat
While

ASCII code of Alphabet F?


Select the correct option
is equal to 0.
is less than ASCII code of A
is equal to ASCII code of A
is greater than ASCII code of A

The control of a loop consists of the


Select the correct option
3
2
activities.

In
loop the test for termination is performed before the body is executed.
Select the correct option
whitebox test
post-test
pretest
blackbox test

Which of the following algorithms is used for sorting a list of names into alphabetical order within itself?
Select the correct option
Merge sort
Insertion sort
Regression algorithm
Decision tree

The test activity terminates the loop process by checking for a condition. This is known as the
Select the correct option
Test condition
Entry condition
Loop condition
Termination condition
What will be the output of the following pseudo code?
int x = 0;
if (x == 0)
printf("hi");
else
printf("hello");
Select the correct option
hellohi
hello
hihello

An algorithm that determines whether that value is in the list or not is known as
Select the correct option
Naive Bayes algorithm
KNN algorithm
Sequential search algorithm
K means algorithm

In a sequential search algorithm if we reach a value greater than the target value without finding the target, our search
terminates as a(an)
Select the correct option
not found
repeat
failure
success

The control of a loop is more


part of the structure, therefore deserves more attention.
Select the correct option
error-prone
error-proof
error-prove
error-plot

Before A,B,C and D ran a race they made the following predictions:
A predicted that B would win.
B predicted that D would win.
C predicted that A would be third.
D predicted that A's prediction would be correct.
Only one prediction will be correct. After analyzing the data, find out who will win the race?
Select the correct option
A
B
C

Before A,B,C and D ran a race they made the predictions. After analyzing the data, the winning order of the race was CDAB.
Only one prediction was true. Identify the correct prediction:
Select the correct option
A predicted that B would win
B predicted that D would win
C predicted that A would be third
D predicted that A's prediction would be correct

While (________): What will be written in the blank space?


Select the correct option
Function definition
Total Number of code lines
Condition
While (________): What will be written in the blank space?
Select the correct option
Function definition
Total Number of code lines
Condition
Body.

In Sequential Search Algorithm we may scan a list from its_.


,comparing each entry with the target entry.
Select the correct option
Top down
Beginning
End
Middle

Before A,B,C and D ran a race they made the following predictions:
A predicted that B would win.
B predicted that D would win.
C predicted that A would be third.
D predicted that A's prediction would be correct.
Only one prediction will be correct. After analyzing the data, find out who will be third in the race?
Select the correct option
D
B
A

What will be the output of the following pseudocode?


int X= 4;
if X >= 2
cout<<"true"
else
cout<<"false"
end
Select the correct option
2
True

The repeated execution of a statement or sequence of statements as long as some condition remains true is known as
Select the correct option
While Loop
Statement
Method
Pseudocode

Which of the following keyword is used in python language to define a function?


Select the correct option
function
fun
def
define

A semantic structure that allows the repeated operation of a particular sequence of instructions is known as:
Select the correct option
Module
Pseudocode
Sequence
Loop
The recurring semantic structure used for the selection of one of two possible activities depending upon the given condition
(true or false) is known as
Select the correct option
Select
if-else
For
While

"Gaining a complete understanding of the problem" belongs to which phase of problem-solving phases presented by the
mathematician G. Polya in 1945?
Select the correct option
2nd
1st
3rd
4th

What will be the output of the following pseudo code?


int marks = 72;
if (marks >= 90)
cout<<"Eligible for scholarship"
else
cout<<"Not eligible for scholarship"
Select the correct option
Runtime error
Might be eligible for scholarship
Eligible for scholarship

The close
between the process of algorithm discovery and that of general problem solving has caused computer scientists to join with
those of other disciplines in the search for better problem-solving techniques.
Select the correct option
dissolution
seclusion
association
solitude

How many times will the "Hello" message be printed by following the given pseudo code?
def Greetings():
Count = 3
while (Count>0):
print(Hello)
Count = Count-1
Select the correct option
4
2

Which of the following is not the problem-solving phase presented by the mathematician G. Polya in 1945?
Select the correct option
Carry out the plan
Divide the problem
Devise a plan for solving the problem
Understand the problem
Each primitive has its own syntax and semantics. Syntax refers to the primitive's
Select the correct option
Pictorial
Character
Symbolic
Alphabetic
representation.

The information in the state of the process must be sufficient to determine uniquely and _______________ the actions
required by each step.
Select the correct option
completely
ambiguously
uncertainly
partially

An else statement is preceded by ____ statement.


-elect the correct option
else-if
if
else
do

The algebraic formula for converting readings of variable X from KM to Meters is_
Select the correct option
x/1000
X+1000
X*1000
X%1000

A program is the representation of an algorithm, whereas a


_____ is the activity of executing an algorithm.
Select the correct option
Process
Cohesion
Model
Coupling

An algorithm must have a well-established structure in terms of the order of its


Select the correct option
Execution
Analysis
Termination
Return

A collection of primitives along with a collection of rules stating how the primitives can be combined to represent more
complex ideas constitutes a
Select the correct option
Programming Code
Programming Instructions
Programming Model
Programming Language

An informal notational system that helps the developers to develop algorithms is known as:
Select the correct option
Program Instructions
Model
Pseudocode
The algebraic formula for converting temperature readings from Celsius to Fahrenheit is_
Select the correct option
F = 32C + (5/9)
F = 32C + (9/5)
F = (5/9)C + 32
F = (9/5)C + 32

Each primitive has its own syntax and semantics. Semantics refers to the
Select the correct option
Meaning
Characteristics
Properties
Symbolic Representation
of the primitive.

From network security point of view, a primary prevention technique is to filter traffic passing through a point in the network,
usually through
Select the correct option
Operating system
Antivirus
Proxy server
Firewalls

The traditional ways of protecting information to control its access before Encryption was using.
Select the correct option
Finger prints
Digital Signatures
Passwords
Image processing

A good algorithm must have all characteristics except:


Select the correct option
Unambiguous
Unstructured
Terminating Process
Executable

By using
we can have a secure version of the applications.
Select the correct option
XML
Encryption techniques
Spam filters
3G

Public Key Encryption techniques uses


Select the correct option
single
two
_value(s), called as key(s).

Which of the following is not a role of Auditing software?


Select the correct option
Distinguishing between desirable and spam emails
Reload Math Equations
Deduction of sudden increase in message traffic
Monitor activities of system firewalls
Detection of irregularities
Which type of security attack is defined in the following statement? "It is a software that infects a computer by inserting itself
into a program that already resides in the machine."
Select the correct option
Virus
Worm
Trojan horse
Spyware

Spyware and Phishing


Select the correct option
Are Sniffing software
Protect computer data from external interference
Are similar kind of security attacks
Work unlike to each other in terms of collecting information

We cannot establish proxy server for


Select the correct option
FTP
Telnet
Firewall
HTTP

In computer security, Spam means


Select the correct option
Unwanted Junk emails
Denial of Service (DoS) attacks

You might also like