Sponsored Links


Results 1 to 1 of 1

Thread: cs304 Object Oriented Programming download the midterm paper fall 2010

  1. #1
    Administrator Xpert's Avatar
    Join Date
    May 2010
    Location
    Jhelum
    Posts
    6,233

    Icon10 cs304 Object Oriented Programming download the midterm paper fall 2010

    Sponsored Links1


    Download the cs304 Object Oriented Programming paper for second semester of MCS for Virtual University of Pakistan.


    MIDTERM EXAMINATION
    Spring 2010
    CS304- Object Oriented Programming (Session - 2)

    Question No: 1 ( Marks: 1 ) - Please choose one
    Which part of an object exhibits its state?
    ► Data


    ► Operations

    ► Any public part

    ► Any private part


    Question No: 2 ( Marks: 1 ) - Please choose one
    Inheritance is a way to





    ► organize data.
    ► pass arguments to objects of classes.
    ► add features to existing classes without rewriting them.
    ► improve data-hiding and encapsulation.

    Question No: 3 ( Marks: 1 ) - Please choose one
    Suppose you have been given the following design,

    "A person has a name, age, address and sex. You are designing a class to represent a type of person called a patient. This kind of person may be given a diagnosis, have a spouse and may be alive".
    Given that the person class has already been created, what of the following would be appropriate to include when you design the patient class?






    ► registration date and diagnosis
    ► age and sex
    ► sex and diagnosis
    ► diagnosis and age

    Question No: 4 ( Marks: 1 ) - Please choose one
    What problem(s) may occur when we copy objects without using deep copy constructor?



    Sponsored Links




    ► Dangling pointer
    ► Memory Leakage
    ► All of the given
    ► System crash

    Question No: 5 ( Marks: 1 ) - Please choose one
    this pointers are not accessible for static member functions.



    ► True
    ► False

    Question No: 6 ( Marks: 1 ) - Please choose one
    A static member function cannot be declared.






    ► Static
    ► Implicit
    ► Explicit
    ► Virtual

    Question No: 7 ( Marks: 1 ) - Please choose one
    _______ remain in memory even when all objects of a class have been destroyed.





    ► Static variables
    ► Instance variable
    ► Primitive variables
    ► None of given

    Question No: 8 ( Marks: 1 ) - Please choose one
    Friend functions are _____________ functions of a class.






    ► None of given
    ► object member
    ► non-member
    ► data member

    Question No: 9 ( 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: 10 ( 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: 11 ( Marks: 1 ) - Please choose one
    Identify which of the following overloaded operator function’s declaration is appropriate for the given call?
    Rational_number_1 + 2.325
    Where Rational_number_1 is an object of user defined class Rational_number.






    ► Rational_number operator+( Rational_number & obj);
    ► Rational_number operator+(double& obj);
    ► Rational_number operator+(Rational_number &obj, double& num);
    ► operator+(double& obj);

    Question No: 12 ( Marks: 1 ) - Please choose one
    Which operator can not be overloaded?






    ► The relation operator ( >= )
    ► Assignment operator ( = )
    ► Script operator ( [] )
    ► Conditional operator (? : )

    Question No: 13 ( Marks: 1 ) - Please choose one
    To convert from a user-defined class to a basic type, you would most likely use





    ► a built-in conversion operator.
    ► a one-argument constructor.
    ► an overloaded = operator.
    ► a conversion operator that’s a member of the class.

    Question No: 14 ( Marks: 1 ) - Please choose one
    The technique in which we visualize our programming problems according to real life’s problems is called
    ----------------
    ► structured programming
    ► object oriented Programming
    ► procedural programming
    ► non of the given

    Question No: 15 ( Marks: 1 ) - Please choose one
    In object orientated programming, a class of objects cans _____________ properties from another class of objects

    ► Utilize
    ► Borrow
    ► Inherit
    ► Adopt

    Question No: 16 ( Marks: 1 ) - Please choose one
    A C++ class is similar to --------------------

    ► Structure
    ► Header File
    ► Library File
    ► None of the given

    Question No: 17 ( Marks: 2 )
    Can we create an array of objects for a class having user defined constructor? Justify your answer.


    Question No: 18 ( Marks: 2 )
    Friend functions increase ‘Programming bugs’. What is your opinion?


    Question No: 19 ( Marks: 2 )
    Explain two benefits of setter functions.


    Question No: 20 ( Marks: 3 )
    What are binary operators? Give an example of binary operators overloading using any class.


    Question No: 21 ( Marks: 3 )
    Give c++ code to overload assignment operator for string class.

    Question No: 22 ( Marks: 5 )
    Writ c++ code to overload subscript[] operator for String class.


    Question No: 23 ( Marks: 5 )
    Detect and correct compile time error(s) in the following code.

    Code:
    class  Exam
    {
          char *ExamName;
          int No_of_paper;
          
    public:
           Exam()
           {
                 ExamName = "Final Term";
                 No_of_paper = 5;
                 }
           
    void setname( char* name)  const
    { 
         ExamName = name;
         }
    void setpaper(int paper)   const
    {
         No_of_paper = paper;
         }
    char* getname()  
    {
          return ExamName;
          }
    int getpaper() 
    {
        return No_of_paper;
    }      
     };
     
    int main()
    {
    const Exam exam1;
    
    cout << " Exam            = "<<exam1.getname()<<endl;
    cout << " Numbe of paper  = " << exam1.getpaper();
      
    getch();
    return 0;
    }
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 4
    Last Post: 07-07-2011, 11:54 PM
  2. Replies: 23
    Last Post: 06-12-2011, 06:20 PM
  3. Replies: 0
    Last Post: 11-09-2010, 04:11 PM
  4. CS304 - Object Oriented Programming new quiz 8th Nov, fall 2010
    By Xpert in forum Virtual University Announcenments
    Replies: 0
    Last Post: 11-07-2010, 12:26 AM
  5. Replies: 2
    Last Post: 08-08-2010, 11:34 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
-: Vuhelp Disclaimer :-
None of the files shown here are hosted or transmitted by this server. The links are provided solely by this site's users. The administrator's or staff of Vuhelp.net cannot be held responsible for what its users post, or any other actions of its users. You may not use this site to distribute or download any material when you do not have the legal rights to do so. It is your own responsibility to adhere to these terms. If you have any doubts about legality of content or you have any suspicions, feel free to contact us.
Online Education | JhelumSoft | Jobs