Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Cs304 mid fall 2010
#1
CS304 MID FALL 2010 Confusedmileys61:

We can get only one unique value which can be used by all the objects of that class by
the use of,

static variables
dynamic variables
instance variables
data members

A member function having the same name as that of a class and a ~ sign with it is called,

Constructor
Getter

Setter

Destructor

Using encapsulation we can achieve

Information hiding

Least interdependencies among modules

Implementation independence

All of given options

Inheritance is a way to

make general classes into more specific classes.
pass arguments to objects of classes.
improve data hiding and encapsulation.
providing class growth through natural selection.

Static variable can be initialized more than once.

True

False

For classes with common behavior, you can save effort by placing the common behavior
in a __________.

Derived Class
Base class
Deprived Class
Named class

Which of the following are an advantage of OOP?

OOP makes it easy to re-use the code
It provides an ability to create one user defined data type by extending the other
It provides the facility of defining Abstract data types through which real world entities
can be defined better
All of the given options

The >= operator can be overloaded.

True
False

A static member function cannot be declared.
Static
Implicit
Explicit
Virtual

Static variables act like a global variable in the context or scope of the class.

True
False

The compiler won’t object if you overload the * operator to perform division.

True
False

We can use "this" pointer in the constructor in the body and even in the initialization list
of any class if we are careful,

TRUE
False

A C++ class is similar to --------------------

Structure
Header File
Library File
None of the given

Which operator can not be overloaded?

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

An overloaded operator always requires one less argument than its number of
operands.

True
False

A generalization-specialization relation between classes are implemented using

data hiding
friend classes
encapsulation
inheritance

In OOP a class is an example of _____
Data Type
Abstract Type
User Defined Type
None of the given

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);

A class can be identified from a statement by -------------
Noun
Pronoun
Verb
Adverb

The members of a class that can be accessed without creating the object of the class is
called

Private member
Data Member
Public Member
Static

Q.
What is difference between simple association and composition?

Q.
Friend functions minimize "Encapsulation", What is your opinion?

Q.
Write three important properties of constructors?
1. Tell the reason why we can not overload the following four operators in c++
. , .* ,
::
,
?:
2. Considering the complex number class can we subtract two complex numbers by
overloading plus “+ “Operator. Justify your answer as well.

Q.
How we resolve the following problems in overloading of assignment operator in string
class, (explain with the help of c++ code)

a. Self referencing
b. Assigning a string value to more than one strings in a single line like,
stringobject1 = string object2 = stringobject3 = stringobject4

Q.
Consider the class given below explain the order in which variables x,y and z will be
initialized after creating object of this class,

class XYZ{
int e;
int f;
int g;
public:
XYZ ();
};

XYZ:: XYZ ():g(30),e(10),f(20)
{
…
}
Reply
#2
nice sharing dear
Reply
#3
bhaye pls upload cs304 mid term ppaers
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Final Term Current Paper MKT501 Marketing Management 12 August 2010 viki 1 3,327 08-20-2020, 08:12 PM
Last Post: Johnnieaunders
  All Current Finalterm Papers Solved & Unsolved Held On 10 August 2010 viki 18 11,591 05-14-2012, 02:24 AM
Last Post: malik zani
  All Current Finalterm Papers Solved & Unsolved Held On 7 & 8 August 2010 viki 4 5,388 01-22-2012, 10:14 PM
Last Post: malika malik
  Final Term Current Paper CS101 Introduction to Computing 12 August 2010 viki 3 4,043 01-03-2012, 05:20 PM
Last Post: Muhammad Shahid hiraj
  Sta301 current paper 14 feb 2011 for fall 2010 Xpert 5 5,220 11-21-2011, 04:21 PM
Last Post: mahira
  Final Term Paper Current MTH101- Calculus And Analytical Geometry 10 August 2010 viki 6 6,308 11-03-2011, 10:59 PM
Last Post: rabeel
  Final Term Current CS401 Computer Architecture and Assembly Language 10 August 2010 viki 2 4,051 07-07-2011, 11:28 PM
Last Post: Xpert
  cs504 8 december fall 2010 Midterm paper Subjective Xpert 2 3,087 05-16-2011, 05:00 AM
Last Post: Xpert
  cs604 operating system current paper objective and subjective fall 2010 on 21-02-2011 Xpert 1 4,080 02-25-2011, 06:13 PM
Last Post: Xpert
  cs502 current paper subjective type fall 2010 on 21-02-2011 Xpert 0 3,288 02-21-2011, 07:22 PM
Last Post: Xpert

Forum Jump:


Users browsing this thread: 1 Guest(s)