PROMOTE MY BLOG: JUST CLICK BELOW BUTTON

Search Any Paper On This Blog

Saturday, July 23, 2011

Re: ::: vuaskari.com ::: CS401 23rd Paper by Umair Saulat

slaam. bhai cs401 ka jo paper diya ha 23 july ko es k Ans b send krdain plz

On Sat, Jul 23, 2011 at 7:21 AM, mc100403250 Syed M. Umair Saulat <mc100403250@vu.edu.pk> wrote:

CS401

My today's Paper 23rd July 2011, Time 07.30 AM North Nazimabad Campus Karachi by

Umair Saulat

 

 

Most of the MCQs from the past paper. 

 

Qno.41            How cam we improve the spec of the multitasking ?  (2)

Qno.42            What do you mean by data label and code label ?    (2)

Qno.43            What is system descriptor?                                                            (2)

Qno.44            What are device driver, Give your answer in two or three lines        (2)

Qno.45            In what order the parameters are passed to routine in Pascal and C Language    (3)                                                                                                         

Qno.46            What is multitasking                                                                           (3)

Qno.47            Difference between wraparound and physical wraparound and physical wraparounds                                                                                          

Qno.48            What is extended read service INT 3 service                                                 (3)

Qno.49            How to load AND/ OR execute program using INT 21 services         (5)

Qno.50            Describe the formal of interrupt descriptor                                        (5)

Qno.51            Following piece of code is taken from the program of scrolling up the screen write against each instruction what it does  (5)                

                        Mov ax 80

                        Mu byte [bp+4]

Mov si,  ax

Push si

Shl si1

Qno.52            In context of video service write character and attribute at cursor position using INT 10 pick up correct statement given between and put it is proper blank spaces                                                                        

                        AH…………………………………………….

                        AL…………………………………………….

                        BH…………………………………………….

                        BL…………………………………………….

                        CX…………………………………………….                                                        (5)

--
We say, "Be one as Pakistani Nation and grow up for Pakistan's Future". Wish you all the best. Join www.vuaskari.com,
To post to this group, send email to vuaskari_com@googlegroups.com
Visit these groups:
This (Main) Group:http://groups.google.com/group/vuaskari_com?hl=en?hl=en
MIT/MCS Group: http://groups.google.com/group/vu_askarimit?hl=en?hl=en
HRM Group: http://groups.google.com/group/askari_hrm?hl=en?hl=en
Banking Group: http://groups.google.com/group/askari_banking?hl=en?hl=en
Management: https://groups.google.com/group/vuaskari_mgt?hl=en
Marketing: https://groups.google.com/group/vuaskari_mkt?hl=en
MIS Group: http://groups.google.com/group/askari_mis?hl=en

--
We say, "Be one as Pakistani Nation and grow up for Pakistan's Future". Wish you all the best. Join www.vuaskari.com,
To post to this group, send email to vuaskari_com@googlegroups.com
Visit these groups:
This (Main) Group:http://groups.google.com/group/vuaskari_com?hl=en?hl=en
MIT/MCS Group: http://groups.google.com/group/vu_askarimit?hl=en?hl=en
HRM Group: http://groups.google.com/group/askari_hrm?hl=en?hl=en
Banking Group: http://groups.google.com/group/askari_banking?hl=en?hl=en
Management: https://groups.google.com/group/vuaskari_mgt?hl=en
Marketing: https://groups.google.com/group/vuaskari_mkt?hl=en
MIS Group: http://groups.google.com/group/askari_mis?hl=en

CS304 Final Term Solved Papers

www.allvupastpapers.blogspot.com 
AdeelAbbasbk@gmail.com

Re: ::: vuaskari.com ::: FIN623 NEED PAST PAPER

plz hafiz bhai send me mgt501 and mgt402 past papers
regards

--
We say, "Be one as Pakistani Nation and grow up for Pakistan's Future". Wish you all the best. Join www.vuaskari.com,
To post to this group, send email to vuaskari_com@googlegroups.com
Visit these groups:
This (Main) Group:http://groups.google.com/group/vuaskari_com?hl=en?hl=en
MIT/MCS Group: http://groups.google.com/group/vu_askarimit?hl=en?hl=en
HRM Group: http://groups.google.com/group/askari_hrm?hl=en?hl=en
Banking Group: http://groups.google.com/group/askari_banking?hl=en?hl=en
Management: https://groups.google.com/group/vuaskari_mgt?hl=en
Marketing: https://groups.google.com/group/vuaskari_mkt?hl=en
MIS Group: http://groups.google.com/group/askari_mis?hl=en

CS304 Solved FinalTerm Paper 2


FINALTERM  EXAMINATION
CS304- Object Oriented Programming (Session - 3)
Time: 120 min
    
Question No: 1    ( Marks: 1 )    - Please choose one
 Which of the following causes run time binding?

       ► Declaring object of abstract class
       ► Declaring pointer of abstract class
       ► Declaring overridden methods as non-virtual
       ► None of the given
   
Question No: 2    ( Marks: 1 )    - Please choose one
Which of the following is the best approach if it is required to have more than one functions having exactly same functionality and implemented on different data types?

       ► Templates
       ► Overloading
       ► Data hiding
       ► Encapsulation
   
Question No: 3    ( Marks: 1 )    - Please choose one
A copy constructor is invoked when






       a function do not returns by value.
       an argument is passed by value.
       a function returns by reference.
       an argument is passed by reference.
   
Question No: 4    ( Marks: 1 )    - Please choose one
 Like template functions, a class template may not handle all the types successfully.

       ► True
       ► False

   
Question No: 5    ( Marks: 1 )    - Please choose one
   
Question No: 6    ( Marks: 1 )    - Please choose one
 A class template may inherit from another class template.




       ► True
       ► False
   
Question No: 7    ( Marks: 1 )    - Please choose one
By default the vector data items are initialized to ____
       ► 0
       ► 0.0
       ► 1
       ► null

   
Question No: 8    ( Marks: 1 )    - Please choose one
In Private --------------  only member functions and friend classes or functions of a derived class can convert pointer or reference of derived object to that of parent object

       ► specialization
       ► inheritance
       ► abstraction
       ► composition

 
Question No: 9    ( Marks: 1 )    - Please choose one
Which of the following is/are advantage[s] of generic programming?
       ► Reusability
       ► Writability
       ► Maintainability
       ► All of given
   
Question No: 10    ( Marks: 1 )    - Please choose one
Template functions use _________ than ordinary functions.

       ► Greater Memory
       ► Lesser Memory
       ► Equal Memory
       ► None of the given options

Question No: 11    ( Marks: 1 )    - Please choose one
Non Template Friend functions of a class are friends of ________instance/s of that class.

       ► All
       ► One specific
       ► All instances of one date type
       ► None of the given options
 
Question No: 12    ( Marks: 1 )    - Please choose one
A copy constructor is invoked when
       ► a function do not returns by value.
       ► an argument is passed by value.
       ► a function returns by reference.
       ► an argument is passed by reference.
   
Question No: 13    ( Marks: 1 )    - Please choose one
A pointer to a base class can point to objects of a derived class.

       ► True
       ► False

Question No: 14    ( Marks: 1 )    - Please choose one
A template argument is preceded by the keyword ________.
       vector
       class
       template
       type*
Question No: 15    ( Marks: 1 )    - Please choose one
Which one of the following terms must relate to polymorphism?
       Static allocation

       Static typing
       ► Dynamic binding
       Dynamic allocation
    
Question No: 16    ( Marks: 1 )    - Please choose one
Multiple inheritance can be of type

       ► Public
       ► Private
       ► Protected
       ► All of the given

Question No: 17    ( Marks: 1 )    - Please choose one
Assume a class Derv that is privately derived from class Base. An object of class Derv located in main() can access
       ► public members of Derv.
       ► protected members of Derv.
       ► private members of Derv.
       ► protected members of Base.

Question No: 18    ( Marks: 1 )    - Please choose one
A copy constructor is invoked when
       ► a function do not returns by value.
       ► an argument is passed by value.
       ► a function returns by reference.
       ► an argument is passed by reference.

Question No: 19    ( Marks: 1 )    - Please choose one
A function call is resolved at run-time in___________
       non-virtual member function.
       virtual member function.
       Both non-virtual member and virtual member function.
       None of given

Question No: 20    ( Marks: 1 )    - Please choose one
Two important STL associative containers are _______ and _______.

       ► set,map
       ► sequence,mapping
       ► setmet,multipule
       ► sit,mat

Question No: 21    ( Marks: 1 )    - Please choose one
An abstract class is useful when,

       ► We do not derive any class from it.
       ► There are multiple paths from one derived class to another.
       ► We do not want to instantiate its object.
       ► You want to defer the declaration of the class.

Question No: 22    ( Marks: 1 )    - Please choose one
Which of the following is/are advantage[s] of generic programming?

       ► Reusability
       ► Writability
       ► Maintainability
       ► All of given
   
Question No: 23    ( Marks: 1 )    - Please choose one
By default the vector data items are initialized to ____
       ► 0
       ► 0.0
       ► 1
       ► null

Question No: 24    ( Marks: 1 )    - Please choose one
 Suppose you create an uninitialized vector as follows:

vector<int> evec;
After adding the statment,
evec.push_back(21);
what will happen?
       ► The following statement will add an element to the start (the back) of evec and will initialize it with the value 21.
       ► The following statement will add an element to the center of evec and will reinitialize it with the value 21.
       ► The following statement will delete an element to the end (the back) of evec and will reinitialize it with the value 21.
       ► The following statement will add an element to the end (the back) of evec and initialize it with the value 21.
  
Question No: 25    ( Marks: 1 )    - Please choose one
Default constructor is such constructor which either has no ---------or if it has some parameters these have -------- values
       Parameter, temporary
       ► Null, Parameter
       ► Parameter, default
       ► non of the given
 
Question No: 26    ( Marks: 1 )    - Please choose one
Which of the following is the best approach if it is required to have more than one functions having exactly same functionality and implemented on different data types?
       ► Templates
       ► Overloading
       ► Data hiding
       ► Encapsulation

Question No: 27    ( Marks: 1 )
Describe the way to declare a template class as a friend of any class.

   
Question No: 28    ( Marks: 1 )
Classes like TwoDimensionalShape and ThreeDimensionalShape would normally be concrete, while classes like Sphere and Cube would normally be abstract.
       ► True
       ► False

Question No: 29    ( Marks: 1 )
In order to define a class template, the first line of definition must be:

       ► template <typename T>
       ► typename <template T>
       ► Template Class <ClassName>
       ► Class <Template T>
Question No: 30    ( Marks: 1 )
In case of multiple inheritance a derived class inherits,
Only the public member functions of its base classes
Only the public data members of its base classes
Both public data members and member functions of all its base classes
Data members and member functions of any two base classes
  
Question No: 31    ( Marks: 1 )
In Private --------------  only member functions and friend classes or functions of a derived class can convert pointer or reference of derived object to that of parent object

       ► specialization
       ► inheritance
       ► abstraction
       ► composition

   
Question No: 32    ( Marks: 1 )

Which of the following is the best approach if it is required to have more than one functions having exactly same functionality and implemented on different data types?
       ► Templates

       ► Overloading

       ► Data hiding

       ► Encapsulation

Question No: 33    ( Marks: 1 )
If we declare a function as friend of a template class will it be a friend for a particular data type or for all data types of that class.
Question No: 34    ( Marks: 1 )
Question No: 35    ( Marks: 1 )
Question No: 36    ( Marks: 1 )
Question No: 37    ( Marks: 2 )
Write three important features of virtual functions.
Question No: 38    ( Marks: 5 )
There are some errors in the code given below, you have to Indicate the line no. with error/s
Give the reason for error/s
Correct the error/s.

1.      #include <iostream>   
2.      #include <stdlib.h>

3.      using namespace std;
4.      template <typename T>
5.      class MyClass{
6.      public:
7.      MyClass(){
8.      cout<<"This is class1"<<endl;
9.      }
10. };
11. template <typename T>   
12. class MyClass<int*>{
13. public:
14. MyClass(){
15. cout<<"This is class2"<<endl;
16. }
17. };
18. int main(int argc, char *argv[])
19. {
20. MyClass<int> c1;
21. MyClass<int*> c2;
22. system("PAUSE");   
23. return 0;
24. }
Question No: 39    ( Marks: 5 )
What is random iterator? What is its relation with vectors?



By : ADEEL ABBAS 
www.allvupastpapers.blogspot.com 
AdeelAbbasbk@gmail.com

CS304 Unsolved Final Paper 2


FINALTERM  EXAMINATION
Spring 2010
CS304- Object Oriented Programming (Session - 4)




Question No: 1    ( Marks: 1 )    - Please choose one
 Classes like TwoDimensionalShape and ThreeDimensionalShape would normally be concrete, while classes like Sphere and Cube would normally be abstract.
       ► True
       ► False
   
Question No: 2    ( Marks: 1 )    - Please choose one
 Virtual functions allow you to




       ► create an array of type pointer-to-base class that can hold pointers to derived classes.
       ► create functions that can never be accessed.
       ► group objects of different classes so they can all be accessed by the same function code.
       ► use the same function call to execute member functions of objects from different classes
   
Question No: 3    ( Marks: 1 )    - Please choose one
 A pointer to a base class can point to objects of a derived class.
           



       ► True
       ► False
   
Question No: 4    ( Marks: 1 )    - Please choose one
 A copy constructor is invoked when






       ► a function do not returns by value.
       ► an argument is passed by value.
       ► a function returns by reference.
       ► an argument is passed by reference.
   
Question No: 5    ( Marks: 1 )    - Please choose one
 Each try block can have ______ no. of catch blocks.

       ► 1
       ► 2
       ► 3
       ► As many as necessary.

 
Question No: 6    ( Marks: 1 )    - Please choose one
 Non Template Friend functions of a class are friends of ________instance/s of that class.

       ► All
       ► One specific
       ► All instances of one date type
       ► None of the given options

   
Question No: 7    ( Marks: 1 )    - Please choose one
 Template functions use _________ than ordinary functions.

       ► Greater Memory
       ► Lesser Memory
       ► Equal Memory
       ► None of the given options
           
   
Question No: 8    ( Marks: 1 )    - Please choose one
 The find() algorithm




       ► finds matching sequences of elements in two containers.
       ► finds a container that matches a specified container.
       ► takes iterators as its first two arguments.
       ► takes container elements as its first two arguments.
   
Question No: 9    ( Marks: 1 )    - Please choose one
 The copy() algorithm returns an iterator to





       ► the last element copied from.
       ► the last element copied to.
       ► the element one past the last element copied from.
       ► the element one past the last element copied to.
   
Question No: 10    ( Marks: 1 )    - Please choose one
 If you define a vector v with the default constructor, and define another vector w with a one-argument constructor to a size of 11, and insert 3 elements into each of these vectors with push_back(), then the size() member function will return ______ for v and _____ for w.

         11 for v and 3 for w.


       ► 0 for v and 0 for w.
       ► 0 for v and 3 for w.
         3 for v and 11 for w.
   
Question No: 11    ( Marks: 1 )    - Please choose one
 Which is not the Advantage of inheritance?





       ► providing class growth through natural selection.
       ► facilitating class libraries.
       ► avoiding the rewriting of code.
       ► providing a useful conceptual framework.

   
Question No: 12    ( Marks: 1 )    - Please choose one
 class DocElement
{
public:
      virtual void Print() { cout << "Generic element"; }
};
class Heading : public DocElement
{
public:
      void Print() { cout << "Heading element"; }
};
class Paragraph : public DocElement
{
public:
      void Print() { cout << "Paragraph element"; }
};
void main()
{
      DocElement * p = new Paragraph();

      p->Print();
}

When you run this program, it will print out a single line to the console output.

What will be in that line?

Select one correct answer from the following list:

       ► Generic element

       ► Heading element

       ► Paragraph element

       ► Nothing will be printed.
   
Question No: 13    ( Marks: 1 )    - Please choose one
 Which type of inheritance is being represented by the following statement,
class X : public A, public B { ... ... };






       ► Single inheritance
       ► Multiple inheritance
       ► Double inheritance
       ► None of the given options
   
Question No: 14    ( Marks: 1 )    - Please choose one
 When we write a class template the first line must be:




       template < class class_name>
       template < class data_type>
       template < class T >
Here T can be replaced with any name but it is preferable.
       class class-name()
class template<class_name>


   
Question No: 15    ( Marks: 1 )    - Please choose one
 Function templates should be used where code and behavior must be identical.


       ► True
       ► False
   
Question No: 16    ( Marks: 1 )    - Please choose one
 Which of the following is/are advantage[s] of generic programming?









       ► Reusability
       ► Writability
       ► Maintainability
       ► All of given
   
Question No: 17    ( Marks: 1 )    - Please choose one
 The specialization pattern <T*> after the name says that this specialization is to be used for every,





       ► data type
       ► meta type

       ► virtual type
       ► pointer type
   
Question No: 18    ( Marks: 1 )    - Please choose one
 A range is often supplied to an algorithm by two _______ values.





       ► italic
       ► iteration
       ► iterator
       ► None of given
   
Question No: 19    ( Marks: 1 )    - Please choose one
 Which of the following is an integral part of an object?




       ► State

       ► Behavior
       ► Unique identity
       ► All of the given
   
Question No: 20    ( Marks: 1 )    - Please choose one
 Consider the following statement

Cupboard has books

What is the relationship between Cupboard and books?






       ► Composition
       ► Aggregation
       ► Inheritance
       ► None of the given options
   
Question No: 21    ( Marks: 1 )    - Please choose one
 Which sentence clearly defines an object?







       ► one instance of a class.
       ► another word for a class.
       ► a class with static methods.
       ► a method that accesses class attributes.
   
Question No: 22    ( Marks: 1 )    - Please choose one
 ___________, which means if A declares B as its friend it does NOT mean that A can access private data of B. It only means that B can access all data of A.






       ► Friendship is one way only
       ► Friendship is two way only
       ► NO Friendship between classes
       ► Any kind of friendship
   
Question No: 23    ( Marks: 1 )    - Please choose one
 The statement objA=objB; will cause a compiler error if the objects are of different classes.

       ► True
       ► False
   
Question No: 24    ( Marks: 1 )    - Please choose one
 Consider the call given below of an overloaded operator "+",
Rational_number_1 + Rational_number_2
Where Rational_number_1 and Rational_number_2 are the two objects of Rational_number class (a user defined class). Identify which of the above two objects will be passed as an argument to the overloaded operator function?








       ► Rational_number_1
       ► Rational_number_2
       ► Both Rational_number_1 & Rational_number_2
       ► any of the two objects, randomly
   
Question No: 25    ( Marks: 1 )    - Please choose one
 If a class D has been derived using protected inheritance from class B (If B is a protected base and D is derived class) then public and protected members of B -------- accessed by member functions and friends of class D and classes derived from D
       ► can be
       ► cannot be
       ► does restirct to be
       ► not given
   
Question No: 26    ( Marks: 1 )    - Please choose one
 In Private --------------  only member functions and friend classes or functions of a derived class can convert pointer or reference of derived object to that of parent object

       ► specialization
       ► inheritance
       ► abstraction
       ► composition
   
Question No: 27    ( Marks: 2 )
 Give two uses of a destructor.

   
Question No: 28    ( Marks: 2 )
 Describe the way to declare a template class as a friend class of any other class.

   
Question No: 29    ( Marks: 2 )
 Give the name of two basic types of containers collectively called First class containers?

   
Question No: 30    ( Marks: 2 )
 State any conflict that may rise due to multiple inheritance?
   
Question No: 31    ( Marks: 3 )
 What will be the output after executing the following code?

class c1{
public:
virtual void function(){
cout<<”I am in c1”<<endl;
}


};
class c2: public c1{
public:
void function(){
cout<<”I am in c2”<<endl;

}

};
class c3: public c1 {
public:
void function(){
cout<<”I am in c3”<<endl;
}

};

int main(){

c1 * test1 = new c2();
c1 * test2 = new c3();
test1->function();
test2->function();
system(“PAUSE”);
return 0;
}


   
Question No: 32    ( Marks: 3 )
 If we declare a function as friend of a template class will it be a friend for a particular data type or for all data types of that class.

   
Question No: 33    ( Marks: 3 )
 Tell the logical error/s in the code given below with reference to resource management; also describe how we can correct that error/s.

class Test{

public:
int function1(){
                        try{
                                FILE *fileptr = fopen(“filename.txt”,“w”);
                                 throw exception();
                                 fclose(fileptr);
                                 return 0;
                                 }
                                 catch(Exception e){
                                 ...
                                 }
}
};
   
Question No: 34    ( Marks: 5 )
 What is the output produced by the following program?

#include<iostream.h>

void sample_function(double test) throw (int);

int main()
{
            try
            {
                        cout <<”Trying.\n”;
                        sample_function(98.6);
                        cout << “Trying after call.\n”;
            }
            catch(int)
            {
                        cout << “Catching.\n”;
            }
           
            cout << “End program.\n”;
            return 0;
}
void sample_function(double test) throw (int)
{
            cout << “Starting sample_function.\n”;
            if(test < 100)
               throw 42;
}

   
Question No: 35    ( Marks: 5 )
 The code given below has one template function as a friend of a template class,
1.      You have to identify any error/s in this code and describe the reason for error/s.
2.      Give the correct code after removing the error/s.

template<typename U>
void Test(U);
template< class T >

class B {
            int data;
            public:
            friend void Test<>( T );
};

template<typename U>
void Test(U u){
    B < int> b1;
    b1.data = 7;
    }
int main(int argc, char *argv[])
{
    char i;
    Test(i);
    system("PAUSE");           
    return 0;
}

   
Question No: 36    ( Marks: 5 )
 Consider the following class,
class Base
{
            char * p;
public:
            Base() { p = new char[10]; }

            ~Base() { delete [] p; }
};
class Derived : public Base
{
            char * q;
public:
            Derived() { q = new char[20]; }

            ~Derived() { delete [] q; }
};
void foo()
{
            Base* p = new Derived();

            delete p;
}

With this program, every time function foo is called, some memory will leak.
Explain why memory will leak. Also, explain how to fix this problem.

By : ADEEL ABBAS 
www.allvupastpapers.blogspot.com 
AdeelAbbasbk@gmail.com