11th Standard Syllabus & Materials
11th Standard
TN 11th Tamil இயற்கை வேளாண்மை,சுற்றுச்சூழல் -செய்யுள் - மனோன்மணீயம் Important Questions And Answers Study Material - QB365 Set A
NEW11th Standard
TN 11th Tamil என்னுயிர் என்பேன் -துணைப்பாடம் - இசைத்தமிழர் இருவர் Important Questions And Answers Study Material - QB365 Set A
NEW11th Standard
TN 11th Tamil மொழி கலை -செய்யுள் - ஒவ்வொரு புல்லையும் Important Questions And Answers Study Material - QB365 Set A
NEW11th Standard
TN 11th Tamil பீடு பெற நில் - இலக்கணம் - பகுபத உறுப்புகள் Important Questions And Answers Study Material - QB365 Set A
NEW11th Standard
TN 11th Tamil பீடு பெற நில் - துணைப்பாடம் - வாடிவாசல் Important Questions And Answers Study Material - QB365 Set A
NEW11th Standard
TN 11th Tamil பீடு பெற நில் - செய்யுள் - குறுந்தொகை Important Questions And Answers Study Material - QB365 Set A

Published on: 13/05/2022
QB365 provides detailed and simple solution for every Creative Questions in class 11 Computer Science Subject. It will helps to get more idea about question pattern in every Creative questions with solution.
latest Creative QuestionsDownload Tamil Nadu 11th Standard Computer Science question papers, model tests, one-mark questions, important questions, and public exam papers in PDF format. Free study materials and answer keys for TN State Board students.
Questions + Answers key
Take MCQ Computer Science Test

1.
What are the ways to create an object using parameterized constructor with an example?
2.
Write the output of the following program.
#include < iostream >
using namespcae std;
class simple
{
private:
int a,b;
public:
simple(int m, int n)
{
a=m;
b=n;
cout << "\nParameterized Constructor of classsimple" << endl;
}
void putdata( )
{
cout << "\nThe two integers are ..." << a <<"\t << b << endl;
cout << "\nThe sum of the variables " << a << " + " << b << "=" << a+b;
}
};
int main( )
{
simple s1(10,20),s2(30,45);//Created two objects with different values created
cout << "\n\t\tObject 1\n";
s 1.putdata( );
cout << "\n\t\tObject 2\n";
s2.putdata( );
return 0;
}
3.
Explain how the objects can be passed in pass reference method.
4.
Explain the scope resolution operator with an example.
5.
Write a C++ program example of creating global and local object
1.
There are two ways to create an object using parameterized constructor
1. Implicit call: In this method, the parameterized constructor is invoked automatically whenever an object is created. For example simple s1(10,20); in this for creating the object s1 parameterized constructor is automatically invoked.
2. Explicit call: in this method, the name of the constructor is explicitly given to invoke the parameterized constructor so that the object can be created and initialized.
#include< iostream >
using namespace std
class simple
{
private:
int a, b;
public:
simple(int m,int n)
{
a=m;
b=n;
cout << "\n Constructor of class-simple invoked for implicit and explicit call" < < endl;
}
void putdata ( )
{
cout < < "\nThe two integers are ..." < < a < < '\t' < < b < < endl;
cout < < "\n The sum of the variables"< < a < < "+"< < b < < "=" < <a+b;
}
};
int mai ( )
{
simple s1(10,20); //implicit call
simple s2=simple(30,45); //explicitcall
cout < < "\n\t\tObject 1\n";
s1.putdata ( );
s2.putdata ( );
return 0;
}
Output:
Constructor of class-simple invoked for implicit and explicit call
Constructor of class-simple invoked for implicit and explicit call
Object 1
The two integers are ... 10 20
The sum of the variables 10 + 20 = 30
Object 2
The two integers are ... 3045
The sum of the variables 30 + 45 = 75
2.
Output:
Parameterized Constructor of class-simple
Parameterized Constructor of class-simple
Object 1
The two integers are ..10 20
The sum of the variables 10 + 20 = 30
Object 2
The two integers are ..30 45
The sum of the variables 30 + 45 = 75
3.
When an object is passed by reference, its memory address is passed to the function so the called function works directly on the original object used in the function call. So any changes made to the object inside the function definition are reflected in original object.
Example: C++ program to illustrate how the pass by reference method work
#include< iostream >
using namespace std;
class Sample
{
private:
int num;
public:
void set (int x)
{
nurn=x;
}
void pass(Sample &obj 1, Sample &obj2)
{
obj 1.num= 100;
obj 2.nurn=200;
cout << "\n\n changed value of object 1" << obj 1.num;
cout << "\n\n changed value of object 2" << obj 2.num;
}
void print ( )
{
cout << num;
}
};
int main( )
{
clrscr( );
Sample s1;
Sample s2;
Sample s3;
s1.set(10);
s2.set(20);
cout << "\n\t\t\Eaxmple program for pass by reference\n\n\n";
cout << "\n\nValue of object 1 before passing?;
s1.print( );
cout << "\n\nValue of object 2 before passing";
s2.print( );
s3.pass(s1,s2);
cout << "\n\nValue of object 1 after passing";
s1.print( );
count << "\n\nValue of object 2 after passing";
s2.print( );
return 0;
}
Output:
Example program for PASS BY REFERENCE
Value of object 1 before passing 10
Value of object 2 before passing 20
Changed value of object 1 100
Changed value of object 2 200
Value of object 1 after passing 100
Value of object 2 after passing 200
4.
If there are multiple variables with the same name defined in separate block as then: :(Scope resolution) operator will reveal the hidden file scope(global) variable.
Example:
#include < iostream >
using namespaces std;
int a=100;
class A
{
int a;
public:
void fun ( )
{
a=20;
a+=::a; //using global variable value
cout << a;
}
};
int main ( )
{
clrscr ( );
A a1;
a1.fun ( );
return 0;
}
Output:
120
In the program the class data member and the global variable have same name. To use the global variable :: used.
5.
#include< iostream >
#include< conio >
using namespace std
class add //Global class
{
int a,b;
public;
int sum;
void getdata( )
{
a=5;
b=10;
sum=a+b;
}
} a1; //global object
add a2; //global object
int main ( )
{
add a3; //Local object for a global class
a1.getdata( );
a2.getdata( );
a3.getdata( );
cout << a1.sum; //public data member accessed from outside the class
cout << a2.sum;
cout << a3.sum;
return 0;
}
Output:
151515
11th Standard Syllabus & Materials
11th Standard
TN 11th Tamil பீடு பெற நில் - செய்யுள் - காவடிச்சிந்து Important Questions And Answers Study Material - QB365 Set A
NEW11th Standard
TN 11th Tamil பீடு பெற நில் - உரைநடை - மலை இடப்பெயர்கள் : ஓர் ஆய்வு Important Questions And Answers Study Material - QB365 Set A
NEW11th Standard
TN 11th Tamil மாமழை போற்றுதும் - துணைப்பாடம் - யானை டாக்டர் Important Questions And Answers Study Material - QB365 Set A
NEW11th Standard
TN 11th Tamil மாமழை போற்றுதும் - செய்யுள் - ஐங்குறுநூறு Important Questions And Answers Study Material - QB365 Set A
Tamilnadu Stateboard 11th Standard Subjects

Maths

Commerce

Economics

Biology

Business Maths and Statistics

Accountancy

Computer Science

Physics

Chemistry

Maths

Biology

Economics

Physics

Chemistry

History

Business Maths and Statistics

Computer Science

Accountancy

Computer Applications

History

Computer Technology

Commerce

Computer Applications

Computer Technology

Tamil

English

French
Tamilnadu Stateboard Standards