We are here with you hands in hands to facilitate your learning & don't appreciate the idea of copying or replicating solutions. Read More>>

Looking For Something at vustudents.ning.com? Click Here to Search

www.bit.ly/vucodes

+ Link For Assignments, GDBs & Online Quizzes Solution

www.bit.ly/papersvu

+ Link For Past Papers, Solved MCQs, Short Notes & More


Dear Students! Share your Assignments / GDBs / Quizzes files as you receive in your LMS, So it can be discussed/solved timely. Add Discussion

How to Add New Discussion in Study Group ? Step By Step Guide Click Here.

Quiz No. 4 CS201 Discussion Feb 4 to 5, 2014

Dear Students,

Please share and discuss your Quizzes here with others.

I have shared my Quiz.

+ How to Follow the New Added Discussions at Your Mail Address?

+ How to Join Subject Study Groups & Get Helping Material?

+ How to become Top Reputation, Angels, Intellectual, Featured Members & Moderators?

+ VU Students Reserves The Right to Delete Your Profile, If?


See Your Saved Posts Timeline

Views: 1946

.

+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)

+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)

+ Click Here to Search (Looking For something at vustudents.ning.com?)

+ Click Here To Join (Our facebook study Group)

Replies to This Discussion

I will share my Quiz soon 

1-Friend classes are used in cases where one class is ____________to another class

Select correct option:

Tightly

Loosely coupled

Independent

Encapsulated

2 -

Question # 2

Total Marks: 1

Friend function declaration can go ___________________ the class

Select correct option:

Only outside

Only within

In the member function of

Anywhere in

3 –

Assignment operator is used to initialize a newly declared object from existing object.

Select correct option:

True

False

4 –

The _______________ data type always represents an empty set of values in C++

Select correct option:

Nil

Void

Zero

Null

5 -

When the compiler overload the assignment (=) operator by default then

Select correct option:

Class members are not assigned properly
compiler does not allow default assignment opera

Compiler does member wise assignment None of the above

None of the above

6 –

Once an object is declared as a friend, _________________________.

Select correct option:

It has access to all non-public members as if they

It has access to public members only

It has no access to data members of the class

It has to protected data members only

7 –

_____________data isn't accessible by non-member functions or outside classes

Select correct option:

Public

Private

Static

Globally declared

8 –

If we want to allocate memory to an array of 5 integers dynamically, the syntax will be _____________.

Select correct option:

Int*iptr;

Iptr = new int[5]

Integer iptr **;

Iptr = new int[5]

Int iptr ;

Iptr = int[5]

Iptr = new[5]

9 –

In overloading the assignment (=) operator, which object will be passed as an argument(s) in the operator function?

Select correct option:

Left object of the assignment

Right object of the assignment operator

Both objects will be passed

No objects will be passed

10 –

int &i; It means that i is a _________to an integer.

Select correct option:

Pointer

Reference

Data type

None of the given

Quiz Start Time: 12:34 PM

Time Left

79 
sec(s)

Question # 1 of 10 ( Start time: 12:34:39 PM )

Total Marks: 1

Friend classes are used in cases where one class is ____________to another class

Select correct option:





Quiz Start Time: 12:34 PM

Time Left

88 
sec(s)

Question # 2 of 10 ( Start time: 12:35:21 PM )

Total Marks: 1

Friend function declaration can go ___________________ the class

Select correct option:




Quiz Start Time: 12:34 PM

Time Left

87 
sec(s)

Question # 3 of 10 ( Start time: 12:35:40 PM )

Total Marks: 1

Assignment operator is used to initialize a newly declared object from existing object.

Select correct option:




Quiz Start Time: 12:34 PM

Time Left

87 
sec(s)

Question # 4 of 10 ( Start time: 12:35:57 PM )

Total Marks: 1

The _______________ data type always represents an empty set of values in C++

Select correct option:



Quiz Start Time: 12:34 PM

Time Left

87 
sec(s)

Question # 5 of 10 ( Start time: 12:36:15 PM )

Total Marks: 1

When the compiler overload the assignment (=) operator by default then

Select correct option:




Quiz Start Time: 12:34 PM

Time Left

87 
sec(s)

Question # 6 of 10 ( Start time: 12:36:36 PM )

Total Marks: 1

Once an object is declared as a friend, _________________________.

Select correct option:




Quiz Start Time: 12:34 PM

Time Left

79 
sec(s)

Question # 7 of 10 ( Start time: 12:36:46 PM )

Total Marks: 1

_____________data isn't accessible by non-member functions or outside classes

Select correct option:




Quiz Start Time: 12:34 PM

Time Left

78 
sec(s)

Question # 8 of 10 ( Start time: 12:37:03 PM )

Total Marks: 1

If we want to allocate memory to an array of 5 integers dynamically, the syntax will be _____________.

Select correct option:



Quiz Start Time: 12:34 PM

Time Left

83 
sec(s)

Question # 9 of 10 ( Start time: 12:37:20 PM )

Total Marks: 1

In overloading the assignment (=) operator, which object will be passed as an argument(s) in the operator function?

Select correct option:



Quiz Start Time: 12:34 PM

Time Left

82 
sec(s)

Question # 10 of 10 ( Start time: 12:37:40 PM )

Total Marks: 1

int &i; It means that i is a _________to an integer.

Select correct option:

Pointer

Reference

Data type

None of the given

Quiz Start Time: 01:42 PM  Time Left  87 
sec(s)    
 
 
Question # 1 of 10 ( Start time: 01:42:57 PM )  Total Marks: 1  
reference is a thing by which we can create _________of any data type.  
Select correct option:  
 
 copy 
 Synonym 
 Pointer 
 None of the given 
 

     
Answer: 2

-----

 
 

Quiz Start Time: 01:42 PM  Time Left  90 
sec(s)    
 
 
Question # 2 of 10 ( Start time: 01:43:33 PM )  Total Marks: 1  
What is the sequence of event(s) when deallocating memory of an object using delete operator?  
Select correct option:  
 
 Only block of memory is deallocated for object 
 Only destructor is called for object 
 Memory is deallocated first before calling destructor 
 Destructor is called first before deallocating memory 
 

     
Answer: 3

 

 
 

 

Quiz Start Time: 01:42 PM  Time Left  90 
sec(s)    
 
 
Question # 3 of 10 ( Start time: 01:45:03 PM )  Total Marks: 1  
When operator function is implemented as member function then return type of function ________.  
Select correct option:  
 
 Must be an object of same class 
 Must be user-defined data type 
 Must be built-in data type 
 Can be any data type 
 

     
Answer:3


------

 

 

Quiz Start Time: 01:42 PM  Time Left  87 
sec(s)    
 
 
Question # 4 of 10 ( Start time: 01:46:31 PM )  Total Marks: 1  
Overloaded new operator function takes parameter of type size_t and returns  
Select correct option:  
 
 void (nothing) 
 void pointer 
 object pointer 
 int pointer 
 

     
Answer: 3


 
 

 

Quiz Start Time: 01:42 PM  Time Left  87 
sec(s)    
 
 
Question # 5 of 10 ( Start time: 01:48:15 PM )  Total Marks: 1  
This reference to a variable can be obtained by preceding the identifier of a variable with ________________.  
Select correct option:  
 
 dot operator   
 ampersand sign & 
 ^ sign 
 * operator 
 

     
Answer: 2

 


-----

 
 
MC130202766 : Baber Ali

 


 
 
Question # 6 of 10 ( Start time: 01:48:58 PM )  Total Marks: 1  
In overloading the assignment (=) operator, which object(s) will call the operator function?  
Select correct option:  
 
 Left object of the assignment operator 
 Right object of the assignment operator 
 Both objects will call the operator function  
 No object will call the operator function 
 

     
 Answer: 2


 
 
MC130202766 : Baber Ali

 

Quiz Start Time: 01:42 PM  Time Left  87 
sec(s)    
 
 
Question # 7 of 10 ( Start time: 01:49:08 PM )  Total Marks: 1  
We can ________ pointer.  
Select correct option:  
 
 increment 
 decrement  
 reassign 
 all of the given 
 

     
 
Answer: 4

 

 
 

 

Quiz Start Time: 01:42 PM  Time Left  89 
sec(s)    
 
 
Question # 8 of 10 ( Start time: 01:49:21 PM )  Total Marks: 1  
In overloading the assignment (=) operator, which object will be passed as an argument(s) in the operator function?  
Select correct option:  
 
 Left object of the assignment operator 
 Right object of the assignment operator 
 Both objects will be passed  
 No objects will be passed  
 

     
 
Answer: 1

 


 
 
MC130202766 : Baber Ali

 

Quiz Start Time: 01:42 PM  Time Left  88 
sec(s)    
 
 
Question # 9 of 10 ( Start time: 01:49:43 PM )  Total Marks: 1  
It is possible to return an object from function using this pointer.  
Select correct option:  
 
 True 
 False 
 

     
 
Answer: 1


 
 
MC130202766 : Baber Ali

 

Quiz Start Time: 01:42 PM  Time Left  36 
sec(s)    
 
 
Question # 10 of 10 ( Start time: 01:50:26 PM )  Total Marks: 1  
If class A is a friend of class B, and class B is a friend of class C. If class A wants class C to be a friend, __________________  
Select correct option:  
 
 it has to declare, class C as a friend 
 it has to declare, class B as a friend 
 it has to declare , class A as a friend 
 it has to declare, class B and class A as friend classes   

Question # 1 of 10 

The dynamic memory allocation uses ___________ whereas static memory allocation uses _________. 

option: 

heap , stack
stack , lists 
array , stack 
classes , array





Question # 2 of 10 
In a NULL pointer, all zeros are _____________memory addresses 

option: 

valid and constant 
variable 
invalid
None of the above





Question # 3 of 10 

A class is a user defined data type it takes __________________________. 

option: 

4 bytes in memory 
2 bytes in memory 
no space in memory unless we create an object from it. 
No space in memory unless we create constructors





Question # 4 of 10 

Default constructor generated by ______________does ______________for us. 

option: 

compiler , initialization 
compiler, no initialization 
classes , initialization yehdoubtful hy agr kisi ko ata hy tu plz correct kry 
main program, memory management





Question # 5 of 10

void calloc(50,sizeof(int)) will return 

option: 

char pointer 
a memory chunk of 50 integers from heap
a memory chunk of 50 integers from stack. 
a memory chunk with zero pointer





Question # 6 of 10 

The data members of the class are initialized ______________. 

option: 

within main program 
outside the function 
at runtime
at compile time





Question # 7 of 10

A class is _____________. 

option: 

a built in function 
a user defined data type 
an array 
a member function


Question # 8 of 10 

The malloc function takes ___________ argument(s). 

option: 

two 
three 
four 
one

Question # 9 of 10

symbolic constant PI can be defined as: 

option: 

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



Question # 10 of 10

#define CIRCUMFERENCE(X) (2 * PI * R) is a 

option: 

user defined function 
library function 
definition of a macro 
utility function

Question # 1 of 10

What is the sequence of event(s) when deallocating memory of an object using delete operator?

  • Only block of memory is deallocated for object

  • Only destructor is called for object

  • Memory is deallocated first before calling destructor

  • Destructor is called first before deallocating memory

C++ offers ____________ levels of data access control inside a class

An address is a ____________________ , while a pointer is a ________________.

Within the statement obj1=obj2; obj1 will call the assignment operator function and obj2 will be passed as an argument to function.

_______ operators are the ones that require two operands on both sides of the operator.

Assignment operator is used to initialize a newly declared object from existing object.

References cannot be uninitialized. Because it is impossible to _________________

When operator function is implemented as member function then return type of function ________.

  • same type of data member

  • diff type of data member

  • any type of data

    • ek option bholl gaya

    • some text missing

    • 1)To prevent dangling reference the functions returning reference should be used with _______
      local variables
      global variables o
      arrays
      static and global variables

      Q2)What is the function of the following statement to delete an array of 5 objects named ‘arr’ allocated using new operator? delete arr ;
      Deletes only one object of array
      Deletes all the objects of array
      Do not delete any objectResults into syntax error

      Q3)We can ________ pointer.
      increment
      decrement 
      reassign
      all of the given

      Q4)Identify the correct syntax for making a class friend of other class

      class ClassOne
      {
      friend OtherClass ;
      private:
      friend ClassOne
      {
      OtherClass ;
      private:
      //here we write the data members of ClassOne
      };


      ClassOne
      {
      friend OtherClass ;
      private:
      //here we write the data members of ClassOne
      };


      Friend class ClassOne
      {
      friend OtherClass ;
      private:
      //here we write the data members of ClassOne
      };


      Q5)The concept of friend function negates the concept of _________________.

      inheritance

      polymorphism

      persistence

      encapsulation

      Q6)_______ operators are the ones that require only one operator to work.
      Unit
      unary 
      single 
      nono

      Q7)____________data isn't accessible by non-member functions or outside classes

      Public

      private

      Static

      Globally declared

      Q8)Assignment operator is used to initialize a newly declared object from existing object.

      true

      false

      Q9)It is possible to return an object from function using this pointer.

      true

      false

      Q10)If text is a pointer of type String then what will be the functionality of following statement? text = new String [5];

      Creates array of 5 objects statically

      Creates array of 5 objects dynamically


      Creates array of pointers to string

      Creates a string Object

Question # 1 of 10 ( Start time: 06:14:05 AM )  Total Marks: 1 

Pointers are a special type of __________in which a memory address is stored 

Select correct option: 

 

  • variables

 Location

 Characters

 None of the given

 

Question # 2 of 10 ( Start time: 06:14:55 AM )  Total Marks: 1 

If x is declare as an integer, what will be result of the given expression? x = 2 + 3 * 5 % ( 2 + 2 ) / 2 

Select correct option: 

 

 4

 3.5

  • 3

 3.75

 

 

Question # 3 of 10 ( Start time: 06:16:07 AM )  Total Marks: 1 

Which of the following is not a valid variable name in C++? 

Select correct option: 

 

 NameOfStudent

 nameOfStudent

 _studentName

  • @studentName

 

 

Question # 4 of 10 ( Start time: 06:17:11 AM )  Total Marks: 1 

What will be the result of arithmetic expression 6+48/4*3? 

Select correct option: 

 

 10

 40.5

  • 42

 41

 

 

Question # 5 of 10 ( Start time: 06:17:44 AM )  Total Marks: 1 

< , <= , > , >= are called __________ operators. 

Select correct option: 

 

 Arithmetic

 Logical

  • Relational

 Conational

 

 

 

Question # 6 of 10 ( Start time: 06:18:15 AM )  Total Marks: 1 

Pointers work by pointing to a particular___________ 

Select correct option: 

 

 Value

 variable

  • data type

 None of the given

 

Pointers work by pointing to a particular data type

Question # 7 of 10 ( Start time: 06:18:35 AM )  Total Marks: 1 

The most suitable data type for number 325.25 is ______. 

Select correct option: 

 

 char

 int

 short

  • float

 

Question # 8 of 10 ( Start time: 06:19:32 AM )  Total Marks: 1 

How many times the following loop will execute? int j = 3; while(j > 0) { cout "Statements" endl; j -= 2; } 

Select correct option: 

 

 0

  • 1

 2

 3

 

Question # 9 of 10 ( Start time: 06:20:57 AM )  Total Marks: 1 

Loops are _______________ Structure 

Select correct option: 

 

 Decision

 Sequential

  • Repetition

 None of the given options 

 

 

    

Question # 10 of 10 ( Start time: 06:21:58 AM )  Total Marks: 1 

Structures use ________ allocation. 

Select correct option: 

 

 Queue

  • Heap

 Cache

 Stack

 

Dear just cpy n past this in C++ n see the answer ....

#include <iostream>

using namespace std;

main()
{
    double x;
x = 6+48/4*3 ;
coutx;
}


BC100401707 
Question # 1 of 10 ( Start time: 09:47:22 PM )     Total Marks: 1
In functions, that returns reference use ______________.
Select correct option:
    global or local variables
    global or static variables
    ordinary variables
    array

  
Question # 2 of 10 ( Start time: 09:48:47 PM )     Total Marks: 1
Overloaded member operator function is always called by _______
Select correct option:
    Class
    Object
    Compiler
    Primitive data type
   
Question # 3 of 10 ( Start time: 09:49:58 PM )     Total Marks: 1
With user data type variables (Objects) self assignment can produce
Select correct option:
    Syntax error
    Logical error
    Link error
    Run time error

  
Question # 4 of 10 ( Start time: 09:51:15 PM )     Total Marks: 1
If B is designated as friend of A, B can access A’s non-public members
Select correct option:
    B cannot access private member of A
    B cannot access protected member of A
    A can access non-public members of B
    A cannot access B

   
Question # 5 of 10 ( Start time: 09:52:41 PM )     Total Marks: 1
The friend function of a class can have access _________________.
Select correct option:
    to the public data members only
    to the private data members
    to the protected data members
    to the main program
    
Question # 6 of 10 ( Start time: 09:54:29 PM )     Total Marks: 1
If we do not write our own assignment operator then which of the following problem may occur?
Select correct option:
    Memory leak
    Dangling pointer
    NULL pointer
    Unreferenced memory

Question # 7 of 10 ( Start time: 09:55:56 PM )     Total Marks: 1
In C language, the region of memory allocated at runtime is called _______________.
Select correct option:
    stack
    heap
    free store
    available memory

Question # 8 of 10 ( Start time: 09:56:34 PM )     Total Marks: 1
The function will return a reference to the global variable that exists throughout the program and thus there will be no danger of _______________.
Select correct option:
    garbage collection
    dangling reference.
    wastage of memory
    system crash

   
Question # 9 of 10 ( Start time: 09:57:46 PM )     Total Marks: 1
We cannot increment ________________.
Select correct option:
    pointers
    arrays
    references
    variables

  
Question # 10 of 10 ( Start time: 09:58:19 PM )     Total Marks: 1
Functions declared with the _________________ specifier in a class member list are called friend functions of that class.
Select correct option:
    protected
    private
    public
    friend

RSS

© 2020   Created by +M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service

.