Explore topic-wise InterviewSolutions in Current Affairs.

This section includes 7 InterviewSolutions, each offering curated multiple-choice questions to sharpen your Current Affairs knowledge and support exam preparation. Choose a topic below to get started.

1.

What are the set difference and set intersection operations? How are they different?

Answer»

The set difference operation, denoted by – (minus) allows us to find tuples that are in one relation but not in another. The expression A – B results in a relation containing those tuples in A but not in B. The set intersection operation finds tuples that are common to the two operands relations. The set intersection operation is denoted by  . That means A  B will yield a relation having tuples common to A and B. The difference between these two is that in set difference operation the result will contain those tuples which are in one operand but not in other.

Whereas in set intersection operation result will contain those tuples which are common in both the operands. 

2.

What is an attribute?

Answer»

It is a particular property, which describes the entity.

3.

Write a letter to the Editor, The Hindu, about accidents caused by rash driving of vehicles in your town.

Answer»

Ramachandra

“Priyadarshini”

2nd Block, Jayanagar

Bengaluru.

27 July 2019

The Editor 

The Hindu 

Bengaluru

Dear Sir,

Enclosed please find my views on the rash driving of vehicles in Bengaluru. I am of the opinion that there should be awareness programmes regarding this and as the first measure towards this I have put down my views. I request you to publish the same in your esteemed daily.

Thank you!

Yours faithfully, 

Ramachandra

4.

What is Weak Entity set?

Answer»

An entity set may not have sufficient attributes to form a primary key, and its primary key compromises of its partial key and primary key of its parent entity, then it is said to be Weak Entity set.

5.

Give the following relationsEMPL ( FirstName, LastName, Workdept, Empno, Educlevel, Jobcode, Salary, Bonus, hiredate)Dept (Deptno, Deptname, Mgrno, Adurdept)Statement for creating above table :1. Give employee names outside manufacturing systems.2. List employee names and their departments for employee numbers between 100 and 3003. List employee numbers, names and educational levels for three educational 16, 18, and 20. 

Answer»

1.  SELECT FirstName from EMPL WHERE Workdept NOT IN (‘Menufacture’);

2. SELECT EmpName, DeptName from EMPL WHERE Empno BETWEEN 100 and 300;

3. SELECT Empno, FirstName, Educlevel from EMPL WHERE Educlevel IN (16, 18, 20); 

6.

Give the following relationsEMPL ( FirstName, LastName, Workdept, Empno, Educlevel, Jobcode, Salary, Bonus, hiredate)Dept (Deptno, Deptname, Mgrno, Adurdept)Statement for creating above table :1.  List employees’ first and last names.2. Give all information on employees in manufacturing system.3.  Just give employee names in manufacturing systems.

Answer»

1.   SELECT FirstName, LastName from EMPL;

2.  SELECT * from EMPL WHERE Workdept = “Menufacture”;

3.  Just give employee names in manufacturing systems.

7.

What is an Extension of entity type?

Answer»

The collections of entities of a particular entity type are grouped together into an entity set.

8.

Give the following relationsEMPL ( FirstName, LastName, Workdept, Empno, Educlevel, Jobcode, Salary, Bonus, hiredate)Dept (Deptno, Deptname, Mgrno, Adurdept)Statement for creating above table :1. List employee numbers and name in manufacturing system for job code 54. 2.  Same request as above with educational level below 15.3. List those employees’ last name and monthly salary plus bonus, whose job code is at least three tmes their educational level and whose annual basic salary plus bonus exceed 100000.

Answer»

1. SELECT Empno, FirstName from EMPL WHERE Workdept = ‘Menufacture’ AND Jobcode = 54; 

2. SELECT Empno, FirstName from EMPL WHERE Workdept = ‘Menufacture’ AND Jobcode =< 15;

3. SELECT LastName, Salary+Bonus from EMPL WHERE Jobcode = (Educlevel * 3) AND ((Salary * 12) + Bonus) > 100000;

9.

What is an Entity set?

Answer»

It is a collection of all entities of particular entity type in the database.

10.

What is an Entity type?

Answer»

It is a collection (set) of entities that have same attributes.

11.

What is Object Oriented model?

Answer»

This model is based on collection of objects. An object contains values stored in instance variables with in the object. An object also contains bodies of code that operate on the object. These bodies of code are called methods. Objects that contain same types of values and the same methods are grouped together into classes.

12.

What is E-R model?

Answer»

This data model is based on real world that consists of basic objects called entities and of relationship among these objects. Entities are described in a database by a set of attributes.

13.

What is Data Model?

Answer»

A collection of conceptual tools for describing data, data relationships data semantics and constraints.

14.

What is a view? How it is related to data independence?

Answer»

A view may be thought of as a virtual table, that is, a table that does not really exist in its own right but is instead derived from one or more underlying base table. In other words, there is no stored file that direct represents the view instead a definition of view is stored in data dictionary.

Growth and restructuring of base tables is not reflected in views. Thus the view can insulate users from the effects of restructuring and growth in the database. Hence accounts for logical data independence.

15.

This morning, Saheb is on his way to the milk booth. In his hand is a steel canister. I now work in a tea stall down the road,‖ he says, pointing in the distance. I am paid 800 rupees and all my meals.‖ Does he like the job? I ask. His face, I see, has lost the carefree look. The steel canister seems heavier than the plastic bag he would carry so lightly over his shoulder. The bag was his. The canister belongs to the man who owns the tea shop. Saheb is no longer his own master!1. His face, I see, has lost the carefree look.‖ This means as per the assumption of the author, in his looks, Saheb is …….. a) not burdened with responsibility b) burdened with responsibility c) Burdened but without any responsibility d) Not burdened but feels responsible2. Choose the appropriate statements for ― Saheb is no longer his own master!‖(i) Saheb carries his bag for rag picking. (ii) Saheb works in a tea stall. (iii) Saheb is paid 800 rupees. (iv)Saheb carries canister.a) (i)(ii)&amp;(iii) b) (i)(ii)&amp;(iv) c) (i)(iii)&amp;(iv) d) (ii)(iii)&amp;(iv)3. Read the statements given below. Choose the correct statement to analyse the mental condition of Saheb-eAlam. a) He seems to be dignified working at the tea-stall. b) He seems to be proud collecting milk from the milk booth. c) He seems to be responsible carrying the steel canister. d) He seems to be enjoying his freewheel at the tea-stall.4. Select the option/options that does NOT explain Saheb‘s nature of thinking in his new job at the tea stall. (i) He thinks collecting milk is a part of his new job. (ii) Canister is heavy, but he thinks he should carry it for survival. (iii) He is earning 800 rupees and all meals, so he should justify the job. (iv) He is a servant now, he can have a carefree life.a) Only option (iii) b) Both options (ii)&amp;(iv) c) Both options (i)&amp;(iv) d) Only option (iv)5. Choose the option that most appropriately fills in the blanks, for the following description of the given extract.People migrate from villages to cities in search of a better life. They want to earn money so that they can lead a good life and (i)_______their children in a better way. As cities have more (ii)________for work, this makes them migrate from the villages to these big cities. (iii)___all miseries and challenges of life at young age, Saheb even finds a job in a tea stall, shifting from rag picking to (iv)_________his struggle for survival.a) (i)give; (ii) scope; (iii) controlling; (iv) continue b) (i) rare; (ii) opportunities; (iii) Accepting; (iv) provec) (i) provide; (ii) jobs; (iii) Denying; (iv) stop d) (i) leave; (ii) chances; (iii) Chasing; (iv) deal

Answer»

1. b) burdened with responsibility 

2. d) (ii)(iii)&(iv)

3. c) He seems to be responsible carrying the steel canister. 

4. d) Only option (iv)

5. b) (i) rare; (ii) opportunities; (iii) Accepting; (iv) prove

16.

What is Data Independence?

Answer»

Data independence means that "the application is independent of the storage structure and access strategy of data". In other words, The ability to modify the schema definition in one level should not affect the schema definition in the next higher level.

Two types of Data Independence:

1. Physical Data Independence: Modification in physical level should not affect the logical level. 

2. Logical Data Independence: Modification in logical level should affect the view level.

NOTE: Logical Data Independence is more difficult to achieve

17.

Savita, a young girl in a drab pink dress, sits alongside an elderly woman, soldering pieces of glass. As her hands move mechanically like the tongs of a machine, I wonder if she knows the sanctity of the bangles she helps make. It symbolises an Indian woman‘s suhaag, auspiciousness in marriage. It will dawn on her suddenly one day when her head is draped with a red veil, her hands dyed red with henna, and red bangles rolled onto her wrists. She will then become a bride. Like the old woman beside her who became one many years ago. She still has bangles on her wrist, but no light in her eyes. ―Ek waqt ser bhar khana bhi nahin khaya,‖ she says, in a voice drained of joy. She has not enjoyed even one full meal in her entire lifetime — that‘s what she has reaped! Her husband, an old man with a flowing beard, says, ―I know nothing except bangles. All I have done is make a house for the family to live in.‖ Hearing him, one wonders if he has achieved what many have failed in their lifetime. He has a roof over his head!1. I know nothing except bangles. Which one of the following best speaks about the character of the old man. a) (i) Cunning; (ii) wise; (iii) soft; (iv) obedient b) (i) Intelligent; (ii) irresponsible; (iii)caring; (iv) simple c) (i) Innocent; (ii)foresight (iii)responsible; iv)caring d) (i) Impeccable; (ii) honest; (iii) rude; (iv) simple2. Which option best indicates that the old woman too has sacrificed something in her life for the sake of her family. (i) The old woman has bangles on her wrist, but she can‘t see them. (ii) She has not even enjoyed one full meal in her life time. (iii) She never supported her husband in bangle making in her life. (iv) She knows nothing expect making bangles which symbolise an Indian woman‘s suhaag.a) (i)&amp;(iv) b) (ii)&amp;((iii) c) (iii)&amp;(iv) d) (i)&amp;(ii)3. ―Ek waqt ser bhar khana bhi nahin khaya,‖ the grand mother says. Her voice indicates that she is ………. a) Undergoing an emotion of great happiness. b) Going through an emotion which lacks happiness. c) Undergoing an emotion of anger and frustration. d) Experiencing an emotion which reflects her fear and anxiety.4. Which of these statements is TRUE about the husband of the elderly woman? a) He says he knows nothing about making bangles in Firozabad. b) He did not enjoy even one full meal in his entire life for the sake of his family. c) He says he knows only bangle making and nothing else in his life. d) All he has done in his life for the sake of his wife is making bangles for her.5. I wonder if she knows the sanctity of the bangles she helps make.‖ In this statement, I wonder‖ reflects the author‘s …….. a) Curiosity b) Anxiety c) Embarrassment d) Restlessness

Answer»

1. c) (i) Innocent; (ii)foresight (iii)responsible; iv)caring 

2. d) (i)&(ii)

3. b) Going through an emotion which lacks happiness. 

4. c) He says he knows only bangle making and nothing else in his life. 

5. a) Curiosity 

18.

Assertion : The children of Seemapuri are living a life of exploitation. Reason : Extreme poverty forces them to lead such a life. a) Both A and R are true and R is the correct explanation of A. b) Both A and R are true and R is not the correct explanation of A. c) A is true but R is false. d) A is false but R is true. e) Both A and R are false.

Answer»

a) Both A and R are true and R is the correct explanation of A. 

19.

Configuration management can be divided into two subsystems: reconfiguration and __________(a) Documentation(b) Information(c) Servers(d) Entity

Answer» Right option is (a) Documentation

To explain I would say: The documentation subsystem of configuration management handles the log making and reporting functions of the configuration management. It also reports the errors in the network caused by the configuration’s failure.
20.

How is the data structure of System R different from the relational structure?

Answer»

Unlike Relational systems in System R 

1. Domains are not supported 

2. Enforcement of candidate key uniqueness is optional 

3. Enforcement of entity integrity is optional 

4. Referential integrity is not enforced

21.

1. The narrator asks Saheb to go to school. What is the intension of the narrator here? a) Narrator wants Saheb to enjoy in the school. b) Narrator wants Saheb to go for rag picking and school as well. c) Narrator wants Saheb to go to school instead of rag picking. d) Narrator seriously encourages him to go to school.2. It takes longer to build a school‖ says the narrator to Saheb. What does the narrator really mean here? a) There is a possibility to build a school. b) It takes very long time to build a school. c) There is a way to build a school. d) There is no intention to build a school.3. After months of knowing him, I ask him his name. ―Saheb-e-Alam,‖ he announces. He does not know what it means. If he knew its meaning — lord of the universe — Saheb would have a hard time believing it‖ because ……. ………… a) He was too poor to bear such a big name. b) He was not suitable to bear such a big name. c) His name was opposite to his life. d) His life was quite suitable to his name.4. I like the game‖, he hums, ―content to watch it standing behind the fence‖. The above sentence refers that Saheb …… a) Is not satisfied with watching the game standing by the fence of club. b) Is satisfied with watching the game standing by the fence of the club. c) Wants to watch the game standing inside the fence of the club. d) Is not allowed to watch the game even from the fence of the club.5. His dream looms like a mirage amidst the dust of streets that fill his town Firozabad, famous for its bangles‖. For Anees Jung, the dream of Mukesh appears as it is far away from reality. As per the circumstances, she thinks Mukesh would ………….. a) Gradually be adjusted with the demands of his family. b) Gradually be satisfied with his family profession. c) Gradually be influenced by the societal pressures. d) All the above.6. It is his karam, his destiny,‖ says Mukesh‘s grandmother, who has watched her own husband go blind with the dust from polishing the glass of bangles. Which one of the following statements appropriately suits to the mind-set or lookout of Mukesh‘s grandmother. a) She doesn‘t like her family members in the business of bangle making. b) She wants her grandson, Mukesh to find his own destiny. c) She thinks that her husband has gone blind due to his fate. d) She doesn‘t believe in karam and destiny which play a major role in the lives of bangle makers.7. I want to be a motor mechanic,‖ Mukesh repeats. Which one of the following best speaks about his repetition. a) He is thinking to become a motor mechanic if everything is comfortable for him. b) He wants to be a motor mechanic if his parents permit him. c) He is strong in his decision of becoming a motor mechanic. d) He wants to become a motor mechanic to impress the author.8. The author asks, Do you know anything about car driving? Mukesh answers, I will learn to drive a car.‖ Choose the best efforts from the following which can help Mukesh materialise his dream of becoming a car driver. a) His dedication and readiness to learn about car driving from the garage. b) His mental state of uncertainty and lack of conviction to dream of cars.c) His determination to walk to the garage which is a long way from his home. d) All the above except (b)

Answer»

1. c) Narrator wants Saheb to go to school instead of rag picking. 

2. d) There is no intention to build a school.

3. c) His name was opposite to his life. 

4. b) Is satisfied with watching the game standing by the fence of the club. 

5. d) All the above.

6. c) She thinks that her husband has gone blind due to his fate. 

7. c) He is strong in his decision of becoming a motor mechanic. 

8. d) All the above except (b)

22.

What is System R? What are its two major subsystems?

Answer»

System R was designed and developed over a period of 1974-79 at IBM San Jose Research Center. It is a prototype and its purpose was to demonstrate that it is possible to build a Relational System that can be used in a real life environment to solve real life problems, with performance at least comparable to that of existing system. 

Its two subsystems are:

1. Research Storage 

2. System Relational Data System.

23.

I ______ to get on the bus when the doors closed and I was left behind. A) was going B) had gone C) would go D) was gone

Answer»

Correct option is A) was going

24.

Ali has been with us _____ three years. A) since B) while C) during D) for

Answer»

Correct option is D) for

25.

What is extension and intension?

Answer»

1. Extension: It is the number of tuples present in a table at any instance. This is time dependent. 

2. Intension: It is a constant value that gives the name, structure of table and the constraints laid on it.

26.

What is relation? What is the difference between a tuple and an attribute?

Answer»

A relation is a two-dimensional table. It contains number of rows (tuples) and columns (attributes). This is the horizontal part of the relation. One row represents one record of the relation. The rows of a relation are also called tuples.

27.

What is relation? Define the properties of a relation.

Answer»

A relation is a two-dimensional table. It contains number of rows (tuples) and columns (attributes). A relation has following properties :

(a). In any given column of the table, all items are of the same kind whereas items in different columns may not be of the same kind.

(b). For a row, each coloums must have an atomic value and also for a row, a columns cannot more than one value.

(c). All of a relations are distinct. That is, a relation does not contain two rows which are identical in every column. That is, each row of the relation can be uniquely identified by its contents.

(d). The ordering of two within a relation is immaterial. That is, we cannot retrieved any thing by saying that from row number 5, column name is to be accessed. Thee is no order maintained for rows inside a relation.

(e). The columns of a relation are assigned distinct names and the ordering of these columns is immaterial. 

28.

He’s already about _____ his father. A) so tall than B) as tall as C) as tall thanD) so tall as

Answer»

Correct option is B) as tall as

29.

Name the different data models available for database system. Which of them is the most preferred one ? 

Answer»

There are generally three data models available as following : 

(i)  Relational Model

(ii) Network Model

(iii) Hierarchical Model

Among these three level relational level is the most preferred one because it does not use pointers or links. Instead, it relates records by the values they contain.

30.

Define the following terms :(i) Integrated database:(ii) Shared database:(iii) View:(iv) Database system:(v) Data security:(vi) Data integrity:

Answer»

(i) Integrated database: Integrated database means union of several otherwise distinct data files, with any redundancy among those files partially or wholly eliminated.

(ii) Shared database: Sharing of data means that individual pieces of data in the database may be shared among several different users, in the sense that each of those users may have access to the same piece of data and each of them may use it for different purpose. The database which contains this type of data is called shared database.

(iii)  View: A view is a pseudo-table or virtual table. It displays the data. The data is derived from one or more base tables.

(iv) Database system:  A database is a collection of interrelated data and a database system is basically a computer base recordkeeping system.

(v) Data security:  Data security refers to protection of data against accidental or intentional disclosure to unauthorized persons, or unauthorized modification or destruction.

(vi) Data integrity:  Data integrity refers to maintaining and assuring the accuracy and consistency of data over its entire life cycle

31.

He’s already about ________ his father. A) so tall than B) as tall than C) as tall as D) so tall as

Answer»

Correct option is C) as tall as

32.

What are the two types of data independence? How they different?

Answer»

There are two levels of data independence: Physical and Logical. Physical Data Independence modifies the scheme followed at the physical level without affecting the scheme followed at the conceptual level.

Whereas Logical Data Independence modifies the conceptual scheme without causing any changes in the schemes followed at view levels.

33.

What are the similarities and differences between network and hierarchical data models ?

Answer»

The network model and hierarchical model are similar in the sense that data and relationships among data are represented by records and links respectively. The difference between these two is that in network model records are organized as collection of arbitrary graphs and in hierarchical model records are organized as collection of trees.

34.

What is meant by functional dependency? Give example of functional dependence .

Answer»

A functional dependency occurs when one attribute in a relation uniquely determines another attribute. This can be written A -> B which would be the same as stating "B is functionally dependent upon A."

Examples:

In a table listing employee characteristics including Social Security Number (SSN) and name, it can be said that name is functionally dependent upon SSN (or SSN -> name) because an employee's name can be uniquely determined from their SSN. However, the reverse statement (name -> SSN) is not true because more than one employee can have the same name but different SSNs.

35.

1.What are polymers?2. Basic safety requirements for polymers used in medicine3. Classification and properties of polymers used in medicinePolymer glue (therapeutic effect, medical application)4. Polymer medical electret – polymedal (therapeutic effect, medical application)

Answer»

1. A polymer is a large molecule or a macromolecule which essentially is a combination of many subunits. The term polymer in Greek means ‘many parts’. Polymers can be found all around us. From the strand of our DNA which is a naturally occurring biopolymer to polypropylene which is used throughout the world as plastic.

36.

The definition of a prime number is a number that is divisible by only one and itself

Answer»

Definition of a Prime Number: Any whole number greater than 1 that is divisible only by 1 and itself, is defined as a prime number.

37.

What is Data Type? Explain various data types in C.

Answer»

Data type is an attribute associated with a piece of data that tells a computer system how to interpret its value. Understanding data types ensures that data is collected in the preferred format and the value of each property is as expected.

Data types in C Language 

Data types specify how we enter data into our programs and what type of data we enter. C language has some predefined set of data types to handle various kinds of data that we can use in our program. These datatypes have different storage capacities.

C language supports 2 different type of data types:

1. Primary data types:  

These are fundamental data types in C namely integer(int), floating point(float), character(char) and void.   

2. Derived data types:  Derived data types are nothing but primary datatypes but a little twisted or grouped together like array, stucture, union and pointer. These are discussed in details later.   

Data type determines the type of data a variable will hold. If a variable x is declared as int. it means x can hold only integer values. Every variable which is used in the program must be declared as what data-type it is.

38.

The definition of a prime number is a number that is divisible by only one and itsel

Answer»

Definition of a Prime Number: Any whole number greater than 1 that is divisible only by 1 and itself, is defined as a prime number.

39.

Define algorithm. What are the key features of algorithms with an example.

Answer»

The word Algorithm means “a process or set of rules to be followed in calculations or other problem-solving operations”. Therefore Algorithm refers to a set of rules/instructions that step-by-step define how a work is to be executed upon in order to get the expected results.

In other words,

Algorithm is a step by step procedure, which defines a set of instructions to be executed in certain order to get the desired output.
Algorithms are generally created independent of underlying languages.

Key features of algorithm

From data structure point of view, following are some important categories of algorithms −

  • Search − Algorithm to search an item in a data-structure.

  • Sort − Algorithm to sort items in certain order

  • Insert − Algorithm to insert item in a data-structure

  • Update − Algorithm to update an existing item in a data-structure

  • Delete − Algorithm to delete an existing item from a data-structure

40.

Explain the Basic Structure of C program in detail.

Answer»

Basically structure of the C program is divided into six different sections,

1. Documentation section: The Documentation section consists of a set of comment lines.

2. Link section: The link section provides instruction to the compiler to link the header files or functions from the system library.

3. Definition section: The definition section defines all symbolic constants such by using the #define directive.

4. Global declaration section: There are some variables that are used in more than one function, such variables are called global variables.

In C there are two types of variable declaration,

Local variable declaration: Variables that are declared inside the main function.

Global variable declaration: Variables that are declared outside the main function.

5. Main function section: Every C-program should have one main() function.
This section contains two parts:

Declaration part

Executable part

6. Sub-program section: If the program is a multi-function program, then the subprogram section contains all user-defined functions that are called in the main() function.

41.

Design a flow chart that accept three numbers and (I) Add the three numbers and assign to variable sum

Answer»
A flowchart is pictoriel or graphical representation of an algorithm 
42.

Choose the odd one out among the following. public void main static

Answer»

The answer is : void

43.

The step by step procedure to solve a problem is known as ...........

Answer»

The step by step procedure to solve a problem is known as Algorithm.

44.

Explain the role of a default constructor? When is it considered equivalent to a parameterized constructor? Support your answer with examples.

Answer»

A default constructor is the one that takes no argument. It is automatically invoked when an object is created without providing any initial values. In case, the programmer has not defined a default constructor, the compiler automatically generates it.

For example,

class A {...........};

A ob1;  // uses default constructor for creating ob1.

A parameterized constructor with default argument is equivalent to a default constructor.

For example,

class A { int i;

float j;

public:

A(int a = 0,float b = 1000.0); //constructor with default argument };

A::A(int a,float b) //constructor definition

{ i = a; j = b;

}

int main()

{

A o1(23,27.50); // argument value passed for o

 A o2; // takes default argument to o2(0,1000.0)

}

45.

Identify the error(s) in the following code and correct the code, explaining every change being introduced: #include &lt;iostream&gt;class code{ int no;char branch;static int count;code (it i=0,char b);public: code(code A){   no=A.no;branch=A.branch;}~code(){ cout&lt;&lt;"Destroying Object"&lt;&lt;--count&lt;&lt;"\n";}};code(int i,char b){no = i; branch = b;}int main(){code X,Y;:return 0;}

Answer»

#include

class code

{

int no;

char branch;

static int count;

public:

code(int i=0,char b);

code(code &A)

{  

no=A.no;

branch=A.branch;

}

~code()

{

//count=0;

cout<<"Destroying Object"<<--count<<"\n";

}

};

int code::count=0;

code::code(int i,char b)

no = i;

branch = b;

}

int main()

{  code X,Y;

return 0;

}

Changes being introduced are as following:

i. Constructor definition should be public so that it can be accessed outside the class.

ii. There should be a use of ‘&’ operator in copy constructor.

iii. There should be a definition of the static variable outside the class definition.

iv. There is a invalid use of ‘:’ expression.

46.

List some of the special properties of the constructor functions.

Answer»

Constructor functions are invoked automatically when the objects are created.

No return type can be specified for a constructor.

A constructor may not be static.

They cannot be inherited, though a derived class can call the base class constructor.

It is not possible to take the address of a constructors.

47.

Consider the following code:class ci{int l;public: ci(int j) { l=j; }ci(ci &amp;rv) { l=rv.l; }void initialize() { l=0; }};main() {ci original(1);ci X1(original);ci X2=original;}Referring to the sample code above, what initializes the object X1?i. Initialize() functionii. The default constructoriii. The copy constructoriv. The default copy constructorJustify your answer.

Answer»

The default constructor initializes the object X1 as constructor is invoked as soon as the object is created.

48.

What is a parameterized constructor? How is it useful?

Answer»

A constructor that accepts parameters for its invocation is known as parameterized constructor. This helps you to assign initial value to an object at the time of its creation. For example,

class Test {

int ant; 

public:

Test(int i) // constructor with argument

{ ant = i;

}

 };

int main()

Test ob1(45); //argument value provided

}

}

49.

Answer the question (i) and (ii) after going through the following class:class Interview{int Month;public:Interview(int y) { Month=y; }  //Constructor 1 Interview(Interview &amp;t); //Constructor 2 };(i) Create an object, such that it invokes constructor 1.(ii) Write complete definition for Constructor 2.

Answer»

(i) Interview obj1(3);

(ii) Interview(Interview &t)

{  Month=t.Month;  }

50.

What is a copy constructor? What is its significance? Which situation is it invoked in? Support your answer with examples.

Answer»

The copy constructor is a constructor which creates an object by initializing it with an object of the same class, which has been created previously. The copy constructor is used to: Initialize one object from another of the same type. Copy an object to pass it as an argument to a function. Copy an object to return it from a function.

#include<iostream.h>

#include<conio.h>

class Example

{

int a,b;

 public:

 Example(int x,int y){ //Constructor with Argument

 a=x;

 b=y;

 cout<<"\nParameterized Constructor";

 }

 void Display(){

 cout<<"\nValues :"<<a<<"\t"<<b;

 }

};

void main ()

{

Example Object(10,20);

Example Object2 = Object; //Copy Constructor Object.Display(); // Constructor invoked. Object2.Display();

getch();

}