Nov

30

MODEL PAPER OF OBJECT ORIENTED PROGRAMMING USING C++ FOR BCA-III SEMESTER (BCA-S201T)

Prepare all questions without any choice. Some of them will definitely be asked in your semester Exam either directly or indirectly.

Nov

03

Click to download File Handling in C++ Sample code dated 03.11.2018
For BCA Students

Do corrections in header files as per C++ Dev Turbo C++ editor

Sep

16

//Multiple Inheritance in C++ Code-1

#include<iostream.h>
class A{
public:
void fun1(){
cout<<“fun1() is called from class A”<<endl;
}
};
class B{
public:
void fun2(){
cout<<“fun2() is called from class B”<<endl;
}
};
class C:public A, public B{
};
void main(){
C c1;
c1.fun1();
c1.fun2();
}

//Multiple Inheritance in C++ Code-2

#include<iostream.h>
class A{
public:
void fun1(){
cout<<“fun1() is called from class A”<<endl;
}
};
class B{
public:
void fun2(){
cout<<“fun2() is called from class B”<<endl;
}
};
class C: A, B{
public:
void fun3(){
fun1();
fun2();
}
};
void main(){
C c1;
/*c1.fun1();
c1.fun2();*/
c1.fun3();
}

//Multiple Inheritance in C++ Code-3

#include<iostream.h>
class A{
public:
int numA;
void getNumA(){
cout<<“Enter Value for numA: “;
cin>>numA;
}
};
class B{
public:
int numB;
void getNumB(){
cout<<“Enter Value for numB: “;
cin>>numB;
}
};
class C: public A, public B{
};
void main(){
C c1;
c1.getNumA();
c1.getNumB();
cout<<c1.numA+c1.numB<<endl;
}

//Multiple Inheritance in C++ Code-4

#include<iostream.h>
class A{
int numA;
public:
void getNumA(){
cout<<“Enter Value for numA: “;
cin>>numA;
}
int returnNumA(){
return(numA);
}
};
class B{
int numB;
public:
void getNumB(){
cout<<“Enter Value for numB: “;
cin>>numB;
}
int returnNumB(){
return(numB);
}
};
class C: public A, public B{
};
void main(){
C c1;
c1.getNumA();
c1.getNumB();
cout<<c1.returnNumA()+c1.returnNumB()<<endl;
}

//Multiple Inheritance in C++ Code-5

#include<iostream.h>
class A{
int numA;
public:
void getNumA(){
cout<<“Enter Value for numA: “;
cin>>numA;
}
int returnNumA(){
return(numA);
}
};
class B{
int numB;
public:
void getNumB(){
cout<<“Enter Value for numB: “;
cin>>numB;
}
int returnNumB(){
return(numB);
}
};
class C: public A, public B{
int numC;
public:
void getNumC(){
cout<<“Enter Value for numC: “;
cin>>numC;
}
int returnNumC(){
return(numC);
}
};
void main(){
C c1;
c1.getNumA();
c1.getNumB();
c1.getNumC();
int result=c1.returnNumA()+c1.returnNumB()+c1.returnNumC();
cout<<result<<endl;
}

Sep

09

#include<iostream.h>
class A{
protected:
int numA;
void inputA(){
cout<<“Enter Value for numA: “;
cin>>numA;
}
};
class B:public A{
protected:
int numB;
void inputB(){
inputA();
cout<<“Enter Value for numB: “;
cin>>numB;
}
};
class C:public B{
protected:
int numC;
public:
void inputC(){
inputB();
cout<<“Enter Value for numC: “;
cin>>numC;
}
void max(){
int temp;
temp=numA>numB?numA:numB;
temp=temp>numC?temp:numC;
cout<<“Greatest Number is: “<<temp<<endl;
}
};
void main(){
C c1;
c1.inputC();
c1.max();
}

Filled Under: C++

Sep

09

#include<iostream.h>
class A{
int numA;
protected:
void inputA(){
cout<<“Enter Value for numA: “;
cin>>numA;
}
void outputA(){
cout<<“numA = “<<numA<<endl;
}
};
class B:public A{
int numB;
protected:
void inputB(){
inputA();
cout<<“Enter Value for numB: “;
cin>>numB;
}
void outputB(){
outputA();
cout<<“numB = “<<numB<<endl;
}
};
class C:public B{
protected:
int numC;
public:
void inputC(){
inputB();
cout<<“Enter Value for numC: “;
cin>>numC;
}
void showData(){
outputB();
cout<<“numC = “<<numC<<endl;
}
};
void main(){
C c1;
c1.inputC();
c1.showData();
}

Filled Under: C++

Sep

09

#include<iostream.h>
class A{
protected:
int numA;
public:
void inputA(){
cout<<“Enter Value for numA: “;
cin>>numA;
}
};
class B:public A{
protected:
int numB;
public:
void inputB(){
inputA();
cout<<“Enter Value for numB: “;
cin>>numB;
}
};
class C:public B{
protected:
int numC;
public:
void inputC(){
inputB();
cout<<“Enter Value for numC: “;
cin>>numC;
}
void showData(){
cout<<“numA = “<<numA<<endl;
cout<<“numB = “<<numB<<endl;
cout<<“numC = “<<numC<<endl;
}
};
void main(){
C c1;
c1.inputC();
c1.showData();
}

Filled Under: C++

Sep

09

#include<iostream.h>
class A{
public:
void fun_A(){
cout<<“fun_A() Called”<<endl;
}
};
class B:public A{
public:
void fun_B(){
fun_A();
cout<<“fun_B() Called”<<endl;
}
};
class C:public B{
public:
void fun_C(){
fun_B();
cout<<“fun_C() Called”<<endl;
}
};
void main(){
C c1;
c1.fun_C();
}

Filled Under: C++

Sep

09

#include<iostream.h>
class A{
public:
void fun_A(){
cout<<“fun_A() Called”<<endl;
}
};
class B:public A{
public:
void fun_B(){
cout<<“fun_B() Called”<<endl;
}
};
class C:public B{
public:
void fun_C(){
fun_A();
fun_B();
cout<<“fun_C() Called”<<endl;
}
};
void main(){
C c1;
c1.fun_C();
}

Filled Under: C++

Sep

09

#include<iostream.h>
class A{
public:
void fun_A(){
cout<<“fun_A() Called”<<endl;
}
};
class B:public A{
public:
void fun_B(){
cout<<“fun_B() Called”<<endl;
}
};
class C:public B{
public:
void fun_C(){
cout<<“fun_C() Called”<<endl;
}
};
void main(){
C c1;
c1.fun_A();
c1.fun_B();
c1.fun_C();
}

Filled Under: C++

Sep

09

#include<iostream.h>
class A{
public:
A(){
cout<<“A() Constructor Called”<<endl;
}
};
class B:public A{
public:
/*B(int n){
cout<<“B(int n) Constructor Called”<<endl;
}*/
B(){
cout<<“B() Constructor Called”<<endl;
}
};
class C:public B{
public:
C(int num){
cout<<“C(int num) Constructor Called”<<endl;
}
};
void main(){
C c1(90);
}

Filled Under: C++

Sep

09

#include<iostream.h>
class A{
public:
A(){
cout<<“A() Constructor Called”<<endl;
}
};
class B:public A{
public:
B(){
cout<<“B() Constructor Called”<<endl;
}
};
class C:public B{
public:
C(){
cout<<“C() Constructor Called”<<endl;
}
};
void main(){
C c1;
}

Filled Under: C++

Sep

08

//——————————– PROGRAM -1 ————————————-

#include<iostream.h>
class A{
public:
void af1(){
cout<<“af1() called from B”;
}
};
/*class B:A{
};*/
/*class B:protected A{
};*/
class B:public A{
};
void main(){
B b1;
b1.af1();
}

//———————————————– PROGARM – 2—————————————

#include<iostream.h>
class A{
protected:
void af1(){
cout<<“af1() called from A”<<endl;
}
};
class B:public A{
public:
void bf1(){
af1();
cout<<“bf1() called from B”<<endl;
}
};
void main(){
B b1;
//b1.A::af1();
b1.bf1();
}

//———————————————– PROGRAM -3 ————————————-

#include<iostream.h>
class A{
protected:
void af1(){
cout<<“af1() called from A”<<endl;
}
};
class B:public A{
public:
void af1(){
A::af1();
cout<<“af1() called from B”<<endl;
}
};
void main(){
B b1;
//b1.A::af1();
b1.af1();
}

//—————————————– PROGRAM – 4—————————————————–

#include<iostream.h>
class A{
public:
/*A(){
cout<<“A() cons called”<<endl;
}*/
};
class B:public A{
public:
B(){
cout<<“B() cons called”<<endl;
}
};
void main(){
B b1;
}

//—————————————- PROGRAM -5 —————————————

#include<iostream.h>
class A{
public:
A(){
cout<<“A()”<<endl;
}
A(int n){
cout<<“A(int n) cons called”<<endl;
}
};
class B:public A{
public:
B(){
A(30);
cout<<“B() cons called”<<endl;
}
};
void main(){
B b1;
}

Aug

10

Campus Commune is a professional network rolled out by TCS for the academic community. It has been acknowledged and appreciated by the student community across India as an effective tool for collaboration. sharing, learning and exploration.

TCS Campus Commune has launched Code Vita (the biggest Coding Contest in India) on 22nd July,13. This contest shall be open to all the students( FY 14,15 and 16 and 17 batches) of your esteemed Institutions. Request you to kindly ask the students from FY 14,15,16 and 17 batch to subscribe to the portal. The process of launching Campus Commune has been attached below. Please share it with all the students at your Institute. The students registering on this portal from a TCS non accredited Institute are called Direct Candidates.

The contest will provide the candidates a competition platform on a national level to test their talents and they will witness a really enriching learning experience.

�The Registration and Team Formation process for Code Vita is open till 12th August,13.

The subscription to TCS Campus Commune is a prerequisite to register and participate in Code Vita. The subscription to Campus Commune is free of cost. Please see the attachment below which needs to be supplemented with the process of launching Campus Commune and sent across to the students.�

FOR MORE DETAILS CLICK THE FOLLOWING URLS:-

Codevita_Participation_Guidelines_For_Direct_Trainees

CodeVita_2013_Registration_and_Team_Formation