Saturday, September 15, 2012

CS 201 Quize




Question # 1 of 10 ( Start time: 08:02:27 PM )
Total Marks: 1
From the following; which one is the correct syntax of an array declaration: array size is 5 and it is of float data type?
Select correct option:

float [5] name;
name[5] float;
float name[5];
None of the given options


Question # 5 of 10 ( Start time: 08:06:04 PM )
Total Marks: 1
A structure is a collection of _____________under a single name.
Select correct option:

values
variables
data
None of the given

Question # 6 of 10 ( Start time: 08:07:21 PM )
Total Marks: 1
Select correct option:

Output
Input
Input/output
None of the given options

Question # 7 of 10 ( Start time: 08:08:44 PM )
Total Marks: 1
Look at the program code and identify the error. 1 #include 2 #define PI 3.1415926; // Defining PI 3 main() { 4 int radius = 5; 5 cout << "Area of circle with radius " << radius << " = " << PI * radius * radius; }
Select correct option:

It will be compiled successfully and will not generate error
It will be compiled and returns nothing
Error exists in line number 2. Semi colon is not allowed with define directive
The value of PI cannot be defined in the beginning

Question # 9 of 10 ( Start time: 08:10:51 PM )
Total Marks: 1
+= , *= , /= , etc are called,
Select correct option:

Assignment operators
Logical operator
Compound assignment operator
Unary operator

Question # 1 of 10 ( Start time: 07:14:32 PM )
Total Marks: 1
The data type before a function name represents its,
Select correct option:

Return Type
Function data
Function arguments
Function name

Question # 2 of 10 ( Start time: 07:15:49 PM )
Total Marks: 1
When we call a function, its control
Select correct option:

transfers to its Prototype
transfers to its definition
returns to statement following function call
The compiler stops execution of whole program

Question # 3 of 10 ( Start time: 07:16:37 PM )
Total Marks: 1
When an array of object is created dynamically then there is no way to provide parameterized constructors for array of objects.
Select correct option:

True
False

Question # 4 of 10 ( Start time: 07:17:50 PM )
Total Marks: 1
Reference is not really an address it is ______________.
Select correct option:

a synonym
an antonym
a value
a number

Question # 5 of 10 ( Start time: 07:18:22 PM )
Total Marks: 1
Which of the following concept is NOT associated with stream?
Select correct option:

Source
Template
Destination
State

Question # 6 of 10 ( Start time: 07:18:57 PM )
Total Marks: 1
___________ work more or less in the same way as macros
Select correct option:

Friend functions
Inline functions
User defined functions
Built-in functions

Question # 7 of 10 ( Start time: 07:19:35 PM )
Total Marks: 1
To get the memory address of a variable we use ____ .
Select correct option:

&
%
*
$


Question # 8 of 10 ( Start time: 07:20:05 PM )
Total Marks: 1
Class is a user defined___________.
Select correct option:

data type
memory reference
value
none of the given options.



Question # 9 of 10 ( Start time: 07:20:46 PM )
Total Marks: 1
The compiler generates __________________ automatically
Select correct option:

member functions
classes
objects of a class
constructors

Question # 10 of 10 ( Start time: 07:21:14 PM )
Total Marks: 1
In_________, we try to have a precise problem statement
Select correct option:

Analysis
Design
Coding
None of the given


A friend function of a class is a function defined ________________________.
Select correct option:

inside that class and that has no access to the members of the class
outside that class and that has the right to access public members of the class only
outside that class and that has the right to access all members of the class.
outside that class and that has the right to access all members of the class.

symbolic constant PI can be defined as:
Select correct option:

#define PI 3.14 ;
#define PI 3.14
#define PI=3.14
# include pi= 3.14

The concept of friend function negates the concept of _________________.
Select correct option:

inheritance
polymorphism
persistence
encapsulation

The first parameter of operator function for << operator _________________.
Select correct option:

Must be passed by value
Must be passed by reference
Can be passed by value or reference
Must be object of class

The ASCHI code of null character is___________
Select correct option:

000
010
111
110

If you create a header file of your own and you save it in the “Headerfiles” folder which is located on the current working directory then you must enclose your header file within _________
Select correct option:

braces
quotation marks
# sign
angle brackets

According to c++ norms; the first character of a variable name must be an alphabet or
Select correct option:

Underscore
Special character
Digit
None of the given options

The heap memory structure __________.
Select correct option:

remains constant
contains no space
constantly changes in size
is just like stack

free function is available in _______________ header file.
Select correct option:

conio.h
iostream.h
string.h
stdlib.h

Question # 1 of 10 ( Start time: 11:45:45 PM )          Total Marks: 1
Default constructor takes _________.
 Select correct option:
one parameter

two parameters

no parameters

character type parameter


Question # 2 of 10 ( Start time: 11:46:44 PM )          Total Marks: 1
All the preprocessors directives starts with ________.
 Select correct option:


$

&

#

_




Question # 3 of 10 ( Start time: 11:48:08 PM )          Total Marks: 1
The members of a class declared with the keyword struct are _____________by default.
 Select correct option:


static

private

protected

public



Question # 4 of 10 ( Start time: 11:49:37 PM )          Total Marks: 1
Loops are _______________ Structure
 Select correct option:


Decision

Sequential

Repetition

None of the given options



Question # 5 of 10 ( Start time: 11:50:59 PM )          Total Marks: 1
We cannot use ______________ pointer for storing and reading data from it.
 Select correct option:


NULL

integer

double

zero


Member functions

Objects of input/output streams

Parameterized manipulators

Non-parameterized manipulators

Question # 7 of 10 ( Start time: 11:53:56 PM )          Total Marks: 1
When an object of a class is defined inside another class then,
 Select correct option:


Destructor of enclosing class will be called first

Destructor of inner object will be called first

Constructor and Destructor will be called simultaneously

None of the given options



Question # 8 of 10 ( Start time: 11:55:23 PM )          Total Marks: 1
Consider the following code segment. Which of the following will be called while executing code at line 2? String s1 , s2; s1 = s2 ;
 Select correct option:


Copy constructor

Default constructor

Assignment operator

Parameterized constructor


Question # 9 of 10 ( Start time: 11:56:36 PM )          Total Marks: 1
We cannot increment ________________.
 Select correct option:


pointers

arrays

references

variables


Question # 10 of 10 ( Start time: 11:57:27 PM )        Total Marks: 1
In statement Matrix m2 = m1 ;
 Select correct option:


Assignment operator is being used

Copy constructor is being used.

Statement has syntax error

None of the given options



Quiz Start Time: 12:44 PM
Time Left
87
sec(s)
Question # 1 of 10 ( Start time: 12:44:38 PM )
Total Marks: 1
C is widely known as development language of _______ operating system.
Select correct option:

Linux
Unix
Windows
Mac OS
 
Quiz Start Time: 12:44 PM



Question # 2 of 10 ( Start time: 12:45:17 PM )
Total Marks: 1
At the___________, we try to break up the problem into functional units
Select correct option:

analysis phase
design phase
Implementation phase
None of the given
 
Quiz Start Time: 12:44 PM



Question # 3 of 10 ( Start time: 12:46:28 PM )
Total Marks: 1
While developing a program; should we think about the user interface?
Select correct option:

Yes
No
 
BC080400849 : Nimra Qamar



Quiz Start Time: 12:44 PM



Question # 4 of 10 ( Start time: 12:47:02 PM )
Total Marks: 1
suppose we have int y[10]; To access the 4th element of the array we write_________
Select correct option:

y[4];
y[3];
y[2];
none of given
 
BC080400849 : Nimra Qamar



Quiz Start Time: 12:44 PM



Question # 5 of 10 ( Start time: 12:47:39 PM )
Total Marks: 1
What will be the result of arithmetic expression 5+25/5*5?
Select correct option:

45
6
30
9
 
BC080400849 : Nimra Qamar



Quiz Start Time: 12:44 PM



Question # 6 of 10 ( Start time: 12:48:10 PM )
Total Marks: 1
The string in the array is terminated by a _______
Select correct option:

zero
nil
null
one
 
BC080400849 : Nimra Qamar



Quiz Start Time: 12:44 PM



Question # 7 of 10 ( Start time: 12:48:38 PM )
Total Marks: 1
If an array has 50 elements, what is allowable range of subscripts?
Select correct option:

0 – 49
1 – 49
0 – 50
1 – 50
 
BC080400849 : Nimra Qamar



Quiz Start Time: 12:44 PM



Question # 8 of 10 ( Start time: 12:49:34 PM )
Total Marks: 1
Why we use "cin"?
Select correct option:

To send data to printer
To read data from keyboard
To display message
To display output on the screen
 
BC080400849 : Nimra Qamar



Quiz Start Time: 12:44 PM



Question # 9 of 10 ( Start time: 12:50:28 PM )
Total Marks: 1
_________operator uses the sign ^.
Select correct option:

Bit-wise OR
Exclusive OR
AND Operator
NOT operator