Вы находитесь на странице: 1из 1

SRN

PES University, Bengaluru


(Established under Karnataka Act 16 of 2013)

UC14BC203

NOVEMBER 2015 : IN SEMESTER ASSESSMENT (ISA) BCA III SEMESTER


TEST - 2
UC14BC203 FUNDAMENTALS OF OBJECT ORIENTED PROGRAMMING
Time: 1 Hours
1.

Max Marks: 50

a)

What is a constructor? Is it mandatory to use constructors in a class? List the


special properties of the constructor.

b)

Distinguish between the following statements:


Time T2(T1);
Time T2 = T1; where T1 and T2 are objects of Time class.

c)

How do the properties of the following two derived class differ?


Class D1: private B{....}
Class D2: public B{...}

a)

Define operator overloading? List the rules for overloading operators.

b)

Describe how base class member functions can be invoked in a derived class if
the derived class also has a member function with the same name.
Explain how to define and access constructors in derived classes.

Identify the error in the following program


#include <iostream>
using namespace std;
class Room
{
int width, height;
public:
Room()
{ width=height=0; }

c)
3

Answer All Questions

a)

1+1+
3

1+3

Room(int value=8)
{ width=height=8;}

b)

void display()
{ cout<<width<<""<<height; }
};
int main()
{
Room objroom;
objroom.display();
return 0;
}
Define a class String. Use overloaded == operator to compare two strings.

4.

a)

Write a program to overload <<, >>, + and operator on matrix objects.

10

5.

a)

Account on Virtual base class. Write a program to prepare the student mark list
that implements hybrid inheritance and virtual base class.

2+8

Вам также может понравиться