cs508 Midterm Solved Mcqs by Junaid
cs508 Midterm Solved Mcqs by Junaid
0304-1659294
1
Downloaded by aqsa ramzan ([email protected])
lOMoARcPSD|20717440
0304-1659294
2
Downloaded by aqsa ramzan ([email protected])
lOMoARcPSD|20717440
0304-1659294
3
Downloaded by aqsa ramzan ([email protected])
lOMoARcPSD|20717440
0304-1659294
4
Downloaded by aqsa ramzan ([email protected])
lOMoARcPSD|20717440
0304-1659294
5
Downloaded by aqsa ramzan ([email protected])
lOMoARcPSD|20717440
0304-1659294
6
Downloaded by aqsa ramzan ([email protected])
lOMoARcPSD|20717440
0304-1659294
7
Downloaded by aqsa ramzan ([email protected])
lOMoARcPSD|20717440
0304-1659294
8
Downloaded by aqsa ramzan ([email protected])
lOMoARcPSD|20717440
0304-1659294
9
Downloaded by aqsa ramzan ([email protected])
lOMoARcPSD|20717440
0304-1659294
10
Downloaded by aqsa ramzan ([email protected])
lOMoARcPSD|20717440
0304-1659294
11
Downloaded by aqsa ramzan ([email protected])
lOMoARcPSD|20717440
0304-1659294
12
Downloaded by aqsa ramzan ([email protected])
lOMoARcPSD|20717440
o Parameters
58. In the Decimal fixed point type, the distance between values is
implemented as a power of ___.
o 2
o 10 PG # 53
o 8
o 16
0304-1659294
13
Downloaded by aqsa ramzan ([email protected])
lOMoARcPSD|20717440
60. ____ operations must have one of its parameters of the tagged type.
o Concurrent
o Synchronized
o Primitive PG # 63
o Generic
0304-1659294
14
Downloaded by aqsa ramzan ([email protected])
lOMoARcPSD|20717440
0304-1659294
15
Downloaded by aqsa ramzan ([email protected])
lOMoARcPSD|20717440
0304-1659294
16
Downloaded by aqsa ramzan ([email protected])
lOMoARcPSD|20717440
0304-1659294
17
Downloaded by aqsa ramzan ([email protected])
lOMoARcPSD|20717440
o Defun PG # 74
o Def func
o func
74. dotime loop of LISP is similar in working to ___ of Ada.
o while loop
o for loop
o switch statement
o Both while loop and switch statement
0304-1659294
18
Downloaded by aqsa ramzan ([email protected])
lOMoARcPSD|20717440
o atom
78. . Function in LISP is in _____notation.
o postfix
o infix
o prefix PG # 68
o none of the given
79. ____ may also change global variable as a side effect.
o time LISP iteration
o list LISP iteration
o dolist LISP iteration
o dotime LISP iteration
80. We have extensive use of ____ in LISP.
o for loop
o switch statement
o recursion
0304-1659294
19
Downloaded by aqsa ramzan ([email protected])
lOMoARcPSD|20717440
0304-1659294
20
Downloaded by aqsa ramzan ([email protected])
lOMoARcPSD|20717440
87. If the program written in a particular language is less ___ than the cost of
failure of the system may be significant.
o Writable
o Reliable PG # 20
o General
o Readable
0304-1659294
21
Downloaded by aqsa ramzan ([email protected])
lOMoARcPSD|20717440
89. Conditional control transfer" gave rise to the idea of ___ which are blocks
of code that can be reused
over and over.
o Namespaces
o Header Files
o Objects
o Libraries PG # 22
90. Identify the feature which was not available in FORTRAN-IV.
o support for structured programming PG # 26
o logical IF statement
o support for explicit type declarations
o subprograms could also be passed as parameters
0304-1659294
22
Downloaded by aqsa ramzan ([email protected])
lOMoARcPSD|20717440
0304-1659294
23
Downloaded by aqsa ramzan ([email protected])
lOMoARcPSD|20717440
0304-1659294
24
Downloaded by aqsa ramzan ([email protected])
lOMoARcPSD|20717440
o Readable
o Writable
o Portable
o Reliable
99. Which of the given resulted in more complex software requiring support
for software engineering in the programming languages.
o increasing Hardware Cost only
o Decreasing Software Cost only
o increasing Hardware Cost and Decreasing Software Cost
o Decreasing Hardware Cost and increasing Software Cost
102. First language that provided the concept of Pointer data type was
____.
o COBOL
0304-1659294
25
Downloaded by aqsa ramzan ([email protected])
lOMoARcPSD|20717440
0304-1659294
26
Downloaded by aqsa ramzan ([email protected])
lOMoARcPSD|20717440
106. Following are some of the reasons for studying concepts related to
different programming languages EXCEPT
o Increased ability to learn new languages
o Increased capability to design communication links
o Increased ability to design new languages
o Increased capacity to express programming concepts
o C++
o JAVA
o LISP
o C#
108. Following are imperative languages EXCEPT
o LISP PG # 22
o C
o FORTRAN
o PASCAL
0304-1659294
27
Downloaded by aqsa ramzan ([email protected])
lOMoARcPSD|20717440
111. Binary operator in SONOBOL must has at least _____ spaces on both
sides.
o 2
o 1 PG # 35
o 3
0304-1659294
28
Downloaded by aqsa ramzan ([email protected])
lOMoARcPSD|20717440
0304-1659294
29
Downloaded by aqsa ramzan ([email protected])
lOMoARcPSD|20717440
o Records PG # 28
o Structure
o Object
o Variable
116. ____are a type of Aliasing.
o Pointers
o Parameters
o Arrays
o Linked List
0304-1659294
30
Downloaded by aqsa ramzan ([email protected])
lOMoARcPSD|20717440
0304-1659294
31
Downloaded by aqsa ramzan ([email protected])
lOMoARcPSD|20717440
o Aliasing PG # 16
o Data Mining
o Orthogonality
o Reliability
If a language has more than one way to accomplish the same task, then it can
cause confusion and complexity.
o %
o &
o $ PG # 40
o *
0304-1659294
32
Downloaded by aqsa ramzan ([email protected])
lOMoARcPSD|20717440
o increase writability
o increase readability and decrease writability
o decrease both readability and writability
o Artificial intelligence PG # 23
o Accounting
0304-1659294
33
Downloaded by aqsa ramzan ([email protected])
lOMoARcPSD|20717440
127. Smalltalk was the first purest _____ language and pioneered graphical
user interface.
o object oriented PG # 30
o structured
o procedural
o functional
o Unary $ PG # 42
o Binary S
o Unary &
o Binary &
0304-1659294
34
Downloaded by aqsa ramzan ([email protected])
lOMoARcPSD|20717440
o Primitive PG # 42
o built-in
o user defined
o both primitive and built-in
Primitive Functions
There are a number of primitive functions but we shall look at only a few.
These include SIZE and REPLACE
functions. The SIZE function returns the size of a string and the REPLACE
function is used to replace one character with another in the entire string.
o Type checking
o Array bounds checking
o Exception handling
0304-1659294
35
Downloaded by aqsa ramzan ([email protected])
lOMoARcPSD|20717440
o If Else statement
o Switch statement
o Go to Statement PG # 45
o For Loop
o ALGOL
o BASIC
o FORTRAN PG # 5
0304-1659294
36
Downloaded by aqsa ramzan ([email protected])
lOMoARcPSD|20717440
135. ______was the first step towards the complex languages of today.
o ENIAC
o Pascal
o A-0 Compiler
o Short Code language PG # 22
o Structured
o Object-Oriented PG # 48
o Non-Structured
o Logical
0304-1659294
37
Downloaded by aqsa ramzan ([email protected])
lOMoARcPSD|20717440
o Decreases
o Increases
o Has no affect on
o Stabilizes
0304-1659294
38
Downloaded by aqsa ramzan ([email protected])
lOMoARcPSD|20717440
0304-1659294
39
Downloaded by aqsa ramzan ([email protected])
lOMoARcPSD|20717440
o Unary $ PG # 42
o Binary dot(.)
o Binary $
144. In _____ we shape the program as a function.
o SNOBOL
o LISP
o ALGOL
o C
145. LISP was the first programming language that introduced the concept of
______.
o Pointers
o Arrays
o Dynamic typing
o Trees
0304-1659294
40
Downloaded by aqsa ramzan ([email protected])
lOMoARcPSD|20717440
Question#1
Correct syntax of creating variable of a specific length in ada is:
o Some_string: String(1>20);
o Some_String: String(1..20);
o Some_String: String(1:20);
o Some_String: String(1,20);
Question#2
Function in LISP is itself a --------------------.
o Obejct
o Datatype
o List
o Variable
Question#3
____________is the Modulus Operator in ADA programming language.
o Mod
o %
o &
o Modulu
Question#4
There are ________built in character types in Ada.
o Five
o Three
o One
o Two
0304-1659294
41
Downloaded by aqsa ramzan ([email protected])
lOMoARcPSD|20717440
Question#7
Data type in Ada can be extended through:
o Polymorphism
o Inheritance
o Function
o Arrays
Question#8
In Ada programing language __________operator is used to access individual
fields of a record type.
o Dot
o Space
o Colon
o Exclamation
Question#9
To terminate a simple loop in Ada , which of the following statement is used?
o Finish
o Break
o End
0304-1659294
42
Downloaded by aqsa ramzan ([email protected])
lOMoARcPSD|20717440
Question#10
How meny time the following loop in LISP will be executed?
(dotimes (count n result)
Body
)
o n
o n+1
o n-1
o n/2
Question#11
In LISP ._________ function is same as ____________function.
o Cdr . cons
o Car . rest
o Car . rest
o Car . second
Question#12
In USP . ___________is the main tool used for iteration .
o For Loop
o Recursion
o Do-While Loop
o While Loop
Question#13
The correct syntax of ‘For’ loop in Ada is
o For variable in low_value_high _value loop_(Loop body)
End loop;
0304-1659294
43
Downloaded by aqsa ramzan ([email protected])
lOMoARcPSD|20717440
Question#15
Exdensible type in Ada language are created through:
o Operator Overloading
o Tagged types
o Dynamic programming
o Pckages
Question#16
In LISP. Following statement returns the difference of the two lists.
o ( Difference L1 L2)
0304-1659294
44
Downloaded by aqsa ramzan ([email protected])
lOMoARcPSD|20717440
3.5
7/2
7.02
9.0
Question#19
To write a user defined function in LISP we use
Defun
Setq
Func
Def func
Question#20
A function in Ada language can have:
0304-1659294
45
Downloaded by aqsa ramzan ([email protected])
lOMoARcPSD|20717440
>(+(/35)4)
>(setqx3.0)
>(sqrtx)
>(+(sqrt4)4.0
Question#26
A person’s buying choice are further influenced by four major psychological
factors: motivation, perception,learning,and beliefs and attitudes.
False
True
Question#26
In buyer black box, only the informations pertaining to environment are processed.
True
Fales
Question#27
When you collect information from your company’s accounting and sales records
stored in the computer, you are developing an internal database.
True
fales
Question#28
Which of the following post-test loop is not supported in Ada language?
‘for’ loop
0304-1659294
46
Downloaded by aqsa ramzan ([email protected])
lOMoARcPSD|20717440
Question#29
Question#32
Question#33
0304-1659294
47
Downloaded by aqsa ramzan ([email protected])
lOMoARcPSD|20717440
XX and YY
X,Y,Z
XX only
XX,YY and (X,Y,Z)
Question#35
Question#37
In LISP , an empty list represented by nil is the same as
{}
()
0304-1659294
48
Downloaded by aqsa ramzan ([email protected])
lOMoARcPSD|20717440
The enum type of Ada language is different from the enum type of C language as
no________ on Ada enumtype is performed.
Arithmetic Operation
Relational Operation
Boolean Operation
logical Operation
Question#40
In LISP, if predicate is false then output will be:
F
NIL
T
0
Question#41
You have just extracted sales and cost data used by the accounting department for
preparing financial statement. Most llikely, this information should be complete
and in useable form to build an internal marketing database.
False
True
Question#42
Identify the correct syntax of ‘while’ loop in ada language:
Loop while (conditional) _loop body
End while;
while (conditional) _loop body
End while;
while (conditional)
0304-1659294
49
Downloaded by aqsa ramzan ([email protected])
lOMoARcPSD|20717440
When you collect information from company’s accounting and sales records stored
in the computer,you are developing an internal database.
True
False
Question#44
Question#45
Although consumers in different countries have different values,attitudes,and
behaviors, the products they buy are very similar to each other
True
False
Question#46
A person’s buying choice are further influenced by four major psychological
factors: motivation, perception, learning, and beliefs and attitudes.
False
True
Question#47
In a marketing information system, an internal database is a part of developing
needed information:
False
True
Question#48
0304-1659294
50
Downloaded by aqsa ramzan ([email protected])
lOMoARcPSD|20717440
Question#52
Consider the following two statements written in Ada:
2
8
3
7
0304-1659294
51
Downloaded by aqsa ramzan ([email protected])
lOMoARcPSD|20717440
Question#54
Which of the following function in LISP determines whether ‘m’ is a member of list ‘t’ or not?
(is Member (m,T))
(eq Member (T,m))
(defun Member (m,T))
(cond(( Member T)m)
Question#55
We may create our own excetions in___________.
Ada
C++
SNOBOL
C
Question#56
Using Ada language, the correct way to declare an integer type with the lower value being 1 and the
upper value being 100is__________
Type Marks is range1;100;
Type Marks is range1::100;
Type Marks is range1..100;
Type Marks is range1,100;
Question # 57
A/An _____________ is a sequence of orderd enumeration literals in ada.
String data type
Struct type
Float data type
Enumeration type
Question # 58
Each ‘if’ statement in Ada language must be terminated with corresponding.
‘else’ statement
‘then’ statement
‘elsif’ statement
‘end if’ statement
Question # 59
A ‘break’ statement in c-language is used to exit from loop structure. It’s alternative in Ada language is:
0304-1659294
52
Downloaded by aqsa ramzan ([email protected])
lOMoARcPSD|20717440
Question # 60
Two important version of LISP are______________.
Commen lisp and defacto
List and common lisp
Scheme and common lisp
Scheme and atoms
Question # 61
We use tagged type in Ada for____________
Inheritance
Encapsulation
Abstraction
Polymorphism
0304-1659294
53
Downloaded by aqsa ramzan ([email protected])