Explore topic-wise InterviewSolutions in .

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

351.

Why was the Lottery committee constituted? What role it played in the development of Calcutta?

Answer»

1. Lottery committee constituted to help the government in carrying out the work of town planning in Calcutta in 1817. 

2. It was named because it raised the funds through the public lotteries. 

3. The government did not provide the necessary funds for the development of town planning. 

4. Its major activities included building roads in the Indian part of the city and cleaning the river bank. 

5. It got a new map of Calcutta made so as to get a comprehensive picture of Calcutta. 

6. It cleared huts to beautify the city. 

7. It also removed all the encroachment from the banks of river Hooghly. 

8. Defence and health were both the factors in projects of town clearance and town planning in Calcutta.

352.

Consider the following statements regarding the establishment of British East India Company in Bengal:I.  The Permanent Settlement had come into operation in 1793. II.  In 1797 there was an auction in Burdwan, during which a number of mahals (estates) held by the Raja of Burdwan were being sold.III.  The estates of those who failed to pay were to be auctioned to recover the revenue.Which of the following statement(s) is/are correct? a.  Only Ib. I and II c.  I and III d.  I, II and III

Answer»

Correct option d. I,II and III 

353.

Indicate which of the following options is NOT correct. People gave evasive answers to the census officials as A. They were suspicious of census operations. B. They thought that enquiries were being conducted to impose new taxes.C. They were not willing to give any information regarding the women of their household.D. They were claiming identities associated with lower status.

Answer»

D.  They were claiming identities associated with lower status.

354.

The Lottery Committee in Calcutta was formed by the British keeping in mind certain objectives. Identify which of the following statements is NOT correct about the Committee.A. The Lottery Committee commissioned a new map of the city so as to get a comprehensive picture of Calcutta.B.  The Committee undertook road building activities in the Indian part of the city.C.  The Committee built houses for the labouring poor.D.  The Committee cleared the river bank of encroachments

Answer»

Correct option C. The committee built houses for the labouring poor.

355.

(i) What is the gap between two neurons called?(ii) How does information travel across the gap? Explain.(iii) Name the part of neuron system which connects central nervous system (CNS) to body parts.

Answer»

(i) Synapse is the gap between two neurons.
(ii) When information reaches neuron terminal, some chemicals are released
which can travel across the gap and start electric signal in dendrite of next neuron.
(iii) Peripheral nervous system connects CNS to body parts.

356.

Write the expression of integrated rate equation for zero order reaction.

Answer»

The mathematical expression for integrated rate law for zero-order reaction is 

kt = [A]0 - [A]t.

357.

Rearrange the following words/phrases to form meaningful sentences. The first one has been done as an example to you. natural/is a/happiness/thing Happiness is a natural thing. (a) know/meaning/should/touch/nature/to/the/have/real/happiness,/of/one/with (b) present,/who/happy/people/in/remain/live (c) do not/about/for/next/saving/day/care/they/the (d) are/enjoying/life/they/always/their

Answer»

(a) For many generations people have relied on dogs./People have relied on dogs for many generations. 

(b) They are very loyal. 

(c) They have been used for hunting and companionship. 

(d) A dog’s nose and ears are very sensitive.

358.

What is the central theme of the poem, The Seven Ages? How does Shakespeare compare life of a person to drama?

Answer»

The central theme of the poem is that the cycle of life from birth to death is inescapable and we should play the roles assigned to us at various stages just like professional actors. Shakespeare compares the world to a stage on which the drama of life is carried out by men at various stages in life, who are actors in the drama. They enter and start acting at birth, the first stage, they finish acting at death, the seventh stage, and exit the stage. In between, they go through the five stages of childhood, youth, working age, maturity and retirement.

359.

Write the Summary of the Poem The Seven Ages

Answer»

Shakespeare considers the world a stage and men and women actors on the stage of life. They play seven roles according to their age. The first stage, as described by the poet, is the infant who is being carried by a nurse. The infant cries and vomits all the time. Later, that infant grows into a schoolboy, not willing to attend school which is the fourth stage of a man‘s life. The third stage is that of a lover who is lost in his thoughts of love. The lover writes poetry in praise of his beloved‘s beauty. In the fourth stage, as he grows older, he joins the army and becomes a soldier. He is physically fit and is aggressive, short-tempered and ambitious in nature. The fifth stage shows that with maturity and wisdom, the family man becomes a judge. He is a fair, healthy man full of wisdom. His look is authoritative and he advises people. The sixth stage is about the man who has grown old and is seen in a pantaloon and spectacles. His authoritative voice has grown weak and his voice trembles as he talks. 

The last stage is about the senile man who loses his teeth, his vision and his hearing. After this, the man‘s part in the play ends and he exits from the stages of his life forever.

360.

‘The understandings of masculinity and feminty are relational in society.’ Elaborate this statement.

Answer»

i. Masculine traits and characteristics have no meaning without feminity these traits are the behavior with which to compose them.

ii. Feature of social institutions and social practices.

iii. Talk of gender is not just talk about women.

iv. Works in relation to each other

361.

Highlight the role of Jawaharlal Nehru the first Prime Minister of India in the formation of India’s foreign policy. 

Answer»

Jawaharlal Nehru was the chief architect of the foreign policy of India as he held both the Prime Minister Office and the Foreign Ministry from 1947 ---1964. 

The three major objectives of Nehru’s foreign policy were to preserve the sovereignty of India, protect India’s territorial integrity and promote India’s rapid economic development. He formed the foundation of the policy of nonalignment. Afro-Asian unity and the establishment of diplomatic relations with other countries after India’s independence.  

362.

Read the passage given below and answer the questions that follow :1. Politeness has been well defined as benevolence in trifles. It is the desire to put those whom we meet perfectly at their ease, and save them from every kind of petty of discomfort and annoyance. The limited part of benevolence called politeness requires only an inclination to make them happy temporarily, while they are in our presence, and when this can be done without any sacrifice on our part or only with a slight sacrifice of personal comfort. 2. Politeness is said to be one of the important characteristics of civilised person. Politeness is the art of choosing among your thoughts. It must be implemented in every walk of life. When we deal with people elder to us we are polite. But, an honest polite person is polite with everyone, people of lower status, workers and even children. Not only with humans but also with animals we must be polite as they are our helpers. 3. Politeness is a skill. Like any other skill, you can master it with practice. The greatest enemy of politeness is ego. To be a polite person, you have to sacrifice your ego. It is difficult for an egoist to be polite. You have to imply politeness in your thinking, speech and actions. Actions work more than words. Polite actions will give fine results. Politeness will reduce your stress and boost you to be productive. Apart from your present benefits, you protect your future. Being polite makes you mentally healthy. In our daily life we come across many incidents with people nearby and ourselves.4. Different rules of behaviour have to be observed, accordingly as we are in the street or in the drawing-room, at home or at school, in the company of friends or of strangers. There is also to be considered the great diversity of social etiquette which distinguishes one country from another. 5. Politeness, besides being a duty that we owe to others, is a valuable possession for ourselves. It costs nothing, and yet may in many cases bring much profit. The great advantage of this excellence of conduct was very clearly expressed by Dr. Johnson, when he said that difference between a well-bred and an ill-bred man is that one immediately attracts your liking, the other your dislike.On the basis of your reading of the passage, answer the following questions in about 30-40 words each : (a) Why is politeness called as limited part of benevolence? (b) List some of the persons we should be polite to? (c) Why is it difficult for an egoist to be polite? (d) What are the benefits of being polite? (e) Which rules of behaviour are to be observed?

Answer»

(a) Politeness is the desire to put those whom we meet perfectly at their ease, and save them from every kind of petty discomfort and annoyance. The limited part of benevolence called politeness requires only an inclination to make them happy temporarily, while they are in our presence. 

(b) People of higher status, people of lower status, workers, children and also animals.

Detailed Answer : 

We should be polite to each and everyone whom me meet. In fact, an honest person should be polite to people who are elder to us, people of lower, children and people of higher status as well. We should even be polite to animals also. 

(c) The greatest enemy of politeness is ego. To be a polite person you have to sacrifice your ego. Egoist cannot be polite. You have to imply politeness in your thinking, speech and actions. 

(d) Polite actions will give fine results. Politeness will reduce your stress and boost you to be productive. Apart from your present benefits, you protect your future. Being polite makes you mentally healthy. 

(e) Different rules as per the situation for eg., when we are in street, at school, in our home or with friend.

Detailed Answer : 

Different rules of behaviour have to be observed when we are in the street or in the drawing room, when we are at home or at school and when we are in the company of friends or of strangers. These rules differ according to the situation we all in.

363.

Read the passage given below :Millions of tons of small waste from plastic bags, bottles and clothes in the world’s oceans present a serious threat to human health and marine environment. This is the stark warning issued by the U.N. in a report on the most dangerous environmental problems facing the world today. Global plastic production has increased considerably in recent years nearly by 3 8%.A poor waste management means when we have finished with our takeaway containers, cigarette butts and party balloons, they are worn down into trillions of even smaller particles by the waves. Therefore, there is a growing presence of these micro plastics in the world’s oceans. It was estimated in 2010 that millions of tons of plastic was washed into the seas and has since shown up in the stomachs of whales, plankton and other marine life. Richard Thompson, professor of marine biology said that in laboratory experiments there is proof that micro plastic can cause harm to organisms. More than a quarter of all fish now contain plastic, according to a recent study which analysed the guts of fish sold in California.Scientists fear that chemicals in plastics and also chemicals which attach themselves to plastic in natural environment could cause poisoning and many disorders in marine life if consumed in huge quantities. Even humans could be adversely affected by the plastic. People could even be breathing in plastic micro particles suspended in the air with the risk of harmful effect on the lungs similar to car fumes. Boyance Slat, a Dutch student has developed a technology that could sift dangerous plastic particles out of the ocean and sell them for profit or re-cycling. Richard Thompson recommended that people avoid using products with micro beads and to make sure they dispose of all plastic products in an appropriate way by re-cycling if possible.Choose the meaning of each of the words given below with the help of options that follow: (a) Stark (i) Serious (ii) Violent (iii) Unpleasant (iv) Angry (b) Huge (i) Impressive (ii) Large (iii) Constant (iv) Standard (c) Micro (i) Mechanical (ii) Dangerous (iii) Very small (iv) Tough (d) Adversely (i) Negatively (ii) Clearly (iii) Poorly (iv) Surely

Answer»

(a) (i) Serious 

(b) (ii) large 

(c) (iii) very small 

(d) (i) negatively

364.

"Human life is built around works". Identify the form of Business Organisation being talked about in the following sentences:- (a)"The one-man control is the best in the world if that man is big enough to manage everything." (b)"Two heads being better than one." (c)"Self-help as well as mutual help system." (d)The birth of this legal person is by law and can be put to death by law only

Answer»

a.Sole proprietorship. 

b.Partnership. 

c.Cooperative. 

d.Company. 

365.

What are ‘fasteners’ in a baby dress?a.  Buttons and zippers b.  Laces and piping c.  Embroidery in a dress d.  Stitching

Answer»

Correct option (a)  Buttons and zippers

366.

In order to supplement your family income, you want to start a business of homemade laundry soaps. What two usual components will you use while making soap at home a.  Alkali like caustic soda, caustic potash & Animal or vegetableb.  Animal or vegetable fat & acetic acid c.  Starch and cellulosed. Alkali & chains of fatty acids

Answer»

Correct option a. Alkali like caustic soda, caustic potash & Animal or vegetable fat

367.

What is the name of first yellow milk that comes out of breast of mother? (a)  Serum (b)  Cholesterol (c) Colostrum (d)  Sterols

Answer»

Correct option  c.  Colostrum

368.

Which are the symptoms of Diabetes Mellitus:1. Frequent urination2. Odema3. High fever 4. Blurred vision 5. Excessive thirst a. 5,4 and 2 b. 1,4 and 5 c. 5,1 and 3 d. 1,2 and 4 

Answer»

Correct option b. 1,4 and 5

369.

Anita has to buy gold for her daughter’s marriage. Which standardized mark she should check on the gold jewellery?a.  Eco markb.  Wool markc.  Hallmarkd.  AG mark 

Answer»

Correct option c. Hallmark 

370.

What happens when(a) a freshly prepared precipitate of Fe(OH)3 is shaken with a small amount of FeCl3 solution ?(b) persistent dialysis of a colloidal solution is carried out ?(c) an emulsion is centrifuged ?

Answer»

(a) Peptisation occurs / Colloidal solution of Fe(OH)3 is formed

(b) Coagulation occurs

(c) Demulsification or breaks into constituent liquids

371.

Which part of the electromagnetic spectrum is used in RADAR ? Give its frequency range. 

Answer»

Micro waves 

Frequency range = 109 to 1012 Hz

372.

If a circle is touching the side BC of △ ABC at P and is touching AB and AC produced at Q and R respectively (see the figure).Prove that AQ = \(\frac12\)​ (perimeter of △ ABC).

Answer»

Given: A circle touching the side BC of △ABC at P and AB,AC produced at Q and R respectively.

Proof: Lengths of tangents drawn from an external point to a circle are equal.

⇒ AQ = AR, BQ = BP, CP = CR.

Perimeter of △ABC = AB + BC + CA

= AB + (BP + PC) + (AR – CR)

= (AB + BQ) + (PC) + (AQ – PC) since [AQ = AR, BQ = BP, CP = CR]

= AQ + AQ

= 2AQ

⇒ AQ = \(\frac12\)​(Perimeter of △ABC)

∴ AQ is the half of the perimeter of △ABC

373.

The length of a rectangular park is 5 metres more than twice its breadth. If the area of the park is 250 sq m, find the length and breadth of the park.

Answer»

Let the breadth of the park is x and the length is 2x + 5.

Area of the park = x \(\times\) (2x + 5) = 250

⇒ 2x+ 5x− 250 = 0

⇒ 2x+ 25x - 20x −250 = 0

⇒ x(2x + 25) -10(2x + 25)=0

⇒ (x - 10) (2x + 25)

⇒ x = 10 or

2x = -25

x = \(\frac{-25}{2} = - 12.5\)

∴ Breadth of the park = 10m 

 Length = 12.5 m

374.

In the views of Niccolo Machiavelli how the princes are able to get praise and condemnation?

Answer»
  • Niccolo Machiavelli's book The Prince allowed him an opportunity to analyze political leaders with their politics.
  • Machiavelli was a controversial thinker whose writings aroused contrasting reactions.
  • Machiavelli lay out the parameters for princes as to how they should rule and conduct themselves in society.
  • For princes, it is better to be selfish than fair and cruel than kind.
  • Princes should choose wise advisors and avoid courtiers.
  • Princes must avoid making themselves hated and scorned.
  • Princes should offer projects for the public to heighten their respect.
375.

How do the observations made during moth collection in pre- and post- industrialized era in England support evolution by Natural Selection ?

Answer»

Industrial melanism is an example of the natural selection of a particular form of an organism in an environment which has changed due to the ill effects of pollution created by industrial activities. The peppered moth Biston betularia is found in Manchester, England. It exists in two forms, one a light patchy white and the other a sooty black. 

Under normal conditions, the majority of the white months survive because the trees they rest on have white bark. The black moths have negligible numbers. Due to the industrial revolution in Manchester, the number of industrial establishments increased manifold, and the soot released from their chimneys started coating the tree trunks nearby, turning them black. The black variety now started getting camouflaged better in these blackened trunks, and their number rose and stabilized' The number of the white variety dwindled due to predation as they started getting easily spotted on the black trunks and get easily picked up by predator. This represents a very clear example of the natural selection.

376.

How does the application of cyanobacteria help improve agriculture output ?

Answer»

Cyanobacteria are free-living or symbiotic blue-green algae which are capable of converting atmospheric molecular nitrogen into soluble forms like nitrites or nitrates. They enrich the nitrogen content of the soil, thus, acting as a natural fertilizer. They replenish the soil with the nitrogenous compounds and hence are useful in agriculture.

377.

Explain the phenomenon that is well represented by Darwin's finches other than natural selection.

Answer»

Darwin,s Finches'illustrated adaptive radiation. In this the species, all deriving from a common ancestor, have over time successfully adapted to their environment via natural selection. Previously, the finches occupied the South American mainland but somehow managed to occupy the Galapagos islands, over 600 miles away. They occupied an ecological niche with little competition. As the population began to flourish in these advantageous conditions, intraspecific competition became a.factor, and resources on tire islands were squeezed and could not sustain the population of the finches for long Due to the mechanisms of natural selection, and changes in the gene pool, that  finches became more adapted to the environment. As competition grew, the finches managed to find new ecological niches, that would present less competition and allow them and their genome to be continued. Thus the finches adapted to take advantage of the various food sources available on the island, which were being used by other species. over the long term, the original finch species may have disappeared but by diversifying, would stand a better chance of survival. All in all, the finches had adapted to their environments via natural selection, which in turn, has allowed the species to survive in the longer term, the prime directive of any species.

378.

Observe the following program very carefully and write the name of those header file(s), which are essentially needed to compile and execute the following program successfully:void main(){char text[20], newText[20];gets(text);strcpy(newText,text);for(int i=0;i<strlen(text);i++)if(text[i]==’A’)text[i]=text[i]+2;puts(text); }

Answer»
  • stdio.h
  • string.h 
379.

Observe the following program very carefully and write the name of those header file(s), which are essentially needed to compile and execute the following program successfully:void main(){char text[20], newText[20];gets(text);strcpy(newText,text);for(int i=0;i<strlen(text);i++)if(text[i]==’A’)text[i]=text[i]+2;puts(text);}

Answer»
  • stdio.h
  • string.h
380.

Explain conditional operator with suitable example?

Answer»

Conditional operator is also known as ternary operator because it requires three operands and can be used to replace simple if-else code. It is used to check the condition and execute first expression if condition is true else execute other.

Syntax:

Conditional expression? Expression 1 : Expression 2;

Explanation:

If the conditional expression is true then expression 1 executes otherwise expression 2 executes.

Example:

int y=10,x;

x=y>10?1:0;

cout<<x;

Output: 0

381.

Rewrite the following program after removing the syntactical errors (if any). Underline each correction.

Answer»

#include<iostream.h>

#include<conio.h>

typdef int Num;     //Typedef should be written as typedef

Num full=100;

Num Calc(int X)

{

full=(X>2)?1:2;

return (full%2);   //; is missing

}

void main()

{

int full=1000;

full=Calc(::full);

cout<<::full<<”::”<<full<<endl;

}

382.

Rewrite the following program after removing any syntactical errors. Underline each correction made. #include&lt;iostream.h&gt;void main( )int A[10];A=[3,2,5,4,7,9,10];for( p = 0; p&lt;=6; p++){ if(A[p]%2=0)int S = S+A[p]; }cout&lt;&lt;S; }

Answer»

#include<iostream.h>

void main( )

{ int A[10] = {3,2,5,4,7,9,10};

int S = 0,p;

for(p = 0; p<=6; p++)

{ if(A[p]%2==0)

S = S+A[p]; }

cout<<S;

}

383.

Rewrite the following code after removing the syntactical errors (if any). Underline each correction.def chksum:x= input ("Enter a number")if (x%2 = 0):for i range (2 * x):print iloop else :print "#"

Answer»

def chksum():

x= input("Enter a number")

if (x%2 == 0):

for i in range(2*x):

print i

else:

print "#"

384.

Which C++ header file(s) are essentially required to be included to run/execute the following C++ code :void main(){char *word1="Hello",*word2="Friends";strcat(word1,word2);cout&lt;&lt;word1;}

Answer»

iostream.h

string.h

385.

Rewrite the following program after removing the syntactical errors (if any). Underline each correction. #include &lt;conio.h&gt;#include &lt;iostream.h&gt;#include &lt;string.h&gt;#include &lt;stdio.h&gt;class product{int product_code, qty, price;char name[20];public:product(){product_code=0; qty=0; price=0; name=NULL;}void entry(){cout&lt;&lt;'\n Enter code, qty, price"';cin&gt;&gt;&gt;product_code&gt;&gt;qty&gt;&gt;price;gets(name);}void tot_price() {return qty*price;} }; void main() { p product;p.entry();cout&lt;&lt;tot_price();}

Answer»

#include <conio.h>

#include <iostream.h>

#include <string.h>

#include <stdio.h>

class product

{

int product_code, qty, price;

char name[20];

public:

product()

{

product_code=0; qty=0; price=0;

strcpy(name, NULL);

}

void entry()

{

cout<<'\n Enter code, qty, price"';

cin>>>product_code>>qty>>price;

gets(name);

}

int tot_price() {return qty*price;}

}; 

void main() 

p product;

p.entry();

cout<<p.tot_price();

}

386.

Rewrite the following program after removing the syntactical errors (if any). Underline each correction.#include&lt;conio.h&gt;#include&lt;iostream.h&gt;#include&lt;string.h&gt;#include&lt;stdio.h&gt;class product{int product_code,qty,price;char name[20];public:product(){product_code=0;qty=0;price=0;name=NULL;}void entry(){cout&lt;&lt;"\n Enter code,qty,price";cin&gt;&gt;product_code&gt;&gt;qty&gt;&gt;price;gets(name);}void tot_price() {return qty*price;}};void main(){p product;p.entry();cout&lt;&lt;tot_price();}

Answer»

#include<conio.h>

#include<iostream.h>

#include<string.h>

#include<stdio.h>

class product

{

int product_code,qty,price;

char name[20];

public:

product(){

product_code=0;qty=0;price=0;

strcpy(name,NULL);

}

void entry()

{

cout<<"\n Enter code,qty,price";

cin>>product_code>>qty>>price;

gets(name);

}

int tot_price() {return qty*price;}

};

void main()

{

product p;

p.entry();

cout<<p.tot_price();

}

387.

Write the output of the following C++ program code:Note: Assume all required header files are already being included in the program.void change(int *s){for(int i=0;i&lt;4;i++){if(*s&lt;40){if(*s%2==0)*s=*s+10;else*s=*s+11;}else{if(*s%2==0)*s=*s-10;else*s=*s-11;}cout&lt;&lt;*s&lt;&lt;" ";s++;}}void main(){int score[]={25,60,35,53};change(score);}

Answer»

The output is:

36 50 46 42

388.

Write the output of the following C++ program code:Note: Assume all required header files are already being included in the program.class seminar{char topic[30];int charges;public:seminar(){strcpy(topic,"Registration");charges=5000;}seminar(char t[]){strcpy(topic,t);charges=5000;}seminar(int c){strcpy(topic,"Registration with Discount");charges=5000-c;}void regis(char t[],int c){strcpy(topic,t);charges=charges+c;}void regis(int c=2000){charges=charges+c;}void subject(char t[],int c){strcpy(topic,t);charges=charges+c;}void show(){cout&lt;&lt;topic&lt;&lt;"@"&lt;&lt;charges&lt;&lt;endl;}};void main(){seminar s1,s2(1000),s3("Genetic Mutation"),s4;s1.show();s2.show();s1.subject("ICT",2000);s1.show();s2.regis("Cyber Crime",2500);s2.show();s3.regis();s3.show();s4=s2;s4.show();getch();}

Answer»

[email protected]

Registration with [email protected]

[email protected]

Cyber [email protected]

Genetic [email protected]

Cyber [email protected]

389.

Which communication channels are suitable for setting up a LAN?

Answer»

Co-axial cable or Optical fiber communication channel(s) is/are suitable for setting up LAN.

390.

What do you understand by function overloading or functional polymorphism? Explain with suitable example.

Answer»

Function Overloading or Functional Polymorphism: 

It is a method of using the same function or method to work using different sets of input. Function overloading is one of the example of polymorphism, where more than one function carring same name behave differently with different set of parameters passed to them. 

Example

int area(int length, int breadth) 

return(length*breadth);

}

float area(int base, float height) 

return(base*height/2); 

}

391.

Observe the following program carefully and attempt the given questions:#include&lt;iostream.h&gt;#include&lt;conio.h&gt;#include&lt;stdlib.h&gt;void main(){clrscr();randomize();char courses[][10]={"M.Tech","MCA","MBA","B.Tech"};int ch;for(int i=1;i&lt;=3;i++){ch=random(i)+1;cout&lt;&lt;courses[ch]&lt;&lt;"\t";}getch();}I. Out of all the four courses stored in the variable courses, which course will never be displayed in the output and which course will always be displayed at first in the output?II. Mention the minimum and the maximum value assigned to the variable ch?

Answer»

I. M.Tech will never be displayed in the output.

MCA will always be displayed at first in the output.

II. Minimum value of ch=1

Maximum value of ch=3

392.

What do you understand by Function overloading or Functional polymorphism? Explain with suitable example.

Answer»

It is a method of using the same function or method to work using different sets of input. Function overloading is one of the example of polymorphism, where more than one function carrying same name behave differently with different set of parameters passed to them.

void show()

{

cout<<”\n Hello World!”;

}

void show(char na[])

{

cout<<”\n Hello World! Its ”<<na;

}

393.

Answer the questions(i) and (ii) after going through the following class:class planet{char name[20];char distance[20];public:planet() //Function 1{strcpy(name, "Venus");strcpy(distance,"38 million km");}void display(char na[],char d[]) //Function 2{cout&lt;&lt;na&lt;&lt;"has "&lt;&lt;d&lt;&lt;" distance from Earth"&lt;&lt;endl;}planet(char na[], char d[]) //Function 3{strcpy(name,na);strcpy(distance,d);}~planet() //Function 4{cout&lt;&lt;"Planetarium time over!!!"&lt;&lt;endl;}};I. What is Function 1 referred as? When will it be executed?II. Write suitable C++ statement to invoke Function 2.

Answer»

I. Constructor

It will be executed at the time of object creation.

II. planet p;

p.display(“Pluto”,”7.5 Billion Km”);

394.

Define a class DanceAcademy in C++ with following description:Private Members Enroll no of type intName of type string Style of type string Fee of type float A member function chkfee() to assign the value of fee variable according to the style entered by the user according to the criteria as given below:Public MembersA function enrollment() to allow users to enter values for Enrollno, Name, Style and call function chkfee() to assign value of fee variable according to the Style entered by the user.A function display() to allow users to view the details of all the data members.

Answer»

class DanceAcademy 

int Enrollno; 

char Name[15]; 

char Style[15]; 

float Fee; 

void chkfee() 

if (strcmpi (Style, "Classical" )==0) 

Fee=10000;

else

if(strcmpi(Style,"Western")==0

Fee = 8000; 

else 

if(strcmpi(Style, "Freestyle")=0)

Fee=11000;

}

public:

void enrollment()

{

cout<<"Please enter enroll no, name and style";

cin>>Enrollno>>Name>>Style;

chkfee();

}

void display()

{

cout<<"\n Entered Enrollno is" <<"\t"<<Enrollno;

cout<<"\n Entered Name is"<<"\t"<<Name;

cout<<"\n Entered Style is:"<<<"\t"<<Style;

cout<<<"\n and Fee is : "<<"\t"<<Free;

}

};

395.

Define a class DanceAcademy in C++ with following description:Private Members● Enrollno of type int● Name of type string● Style of type string● Fee of type float● A member function chkfee( ) to assign the value of fee variable according to the style entered by the user according to the criteria as given below:StyleFeeClassical10000Western8000Freestyle11000Public Members● A function enrollment() to allow users to enter values for Enrollno, Name, Style and call function chkfee() to assign value of fee variable according to the Style entered by the user.● A function display() to allow users to view the details of all the data members.

Answer»

class DanceAcademy

{

int Enrollno;

char Name[20];

char Style[20];

float Fee;

void chkfee()

{

if(strcmpi(Style, "Classical")==0)

Fee=10000;

else if(strcmpi(Style, "Western")==0)

Fee=8000;

else if(strcmpi(Style, "Freestyle")==0)

Fee=11000;

}

public:

void enrollment()

{

cout<<"Please enter Enrollno,Name,Style";

cin>>Enrollno;

gets(Name);

gets(Style);

chkfee();

}

void display()

{

cout<<"\n Entered Enrollno, Name, Style and Fee is: 

"<<Enrollno<<"\t"<<Name<<"\t"<<Style<<"\t"<<Fee;

}

};

396.

Differentiate between a unary, a binary and a ternary operator. Give examples of C++ Operators for each one of them.

Answer»

Unary operators have only one operand (eg) c++. Binary operators have two operands (eg) +, -, Ternary operators have three operands (eg) ? 

397.

What do you understand by local and global scope of variables? How can you access a global variable inside the function, if function has a variable with same name.

Answer»

A global variable is a variable that is accessible globally. A local variable is one that is only accessible to the current scope, such as temporary variables used in a single function definition. 

A variable declared outside of the function or in global scope is known as global variable. This means, global variable can be accessed inside or outside of the function where as local variable can be used only inside of the function. We can access by declaring variable as global A

398.

Answer the questions (i) to (iv) based on the following:class indoor_sports{int i_id;char i_name[20];char i_coach[20];protected:int i_rank,i_fee;void get_ifee();public:indoor_sports();void iEntry();void ishow();};class outdoor_sports{int o_id;char o_name[20];char o_coach[20];protected:int orank,ofee;void get_ofee();public:outdoor_sports();void oEntry();void oshow();};class sports:public indoor_sports,protected outdoor_sports{char rules[20];public:sports();void registration();void showdata();};(i) Name the type of inheritance illustrated in the above C++ code.(ii) Write the names of all the members, which are accessible from the objects belonging to class outdoor_sports.(iii) Write the names of all the member functions, which are accessible from the member function of class sports.(iv) What will be the size of the object belonging to class indoor_sports?

Answer»

(i) Multiple Inheritance

(ii) Data Members: None

Member Functions: oEntry(), oShow()

(iii) registration(), showdata(), oEntry(), oShow(), get_ofee(), iEntry(), iShow(), get_ifee()

(iv) 46 Bytes

399.

Write the definition of a function grace_score (int score [], int size) in C++, which should check all the elements of the array and give an increase of 5 to those scores which are less than 40.Example: if an array of seven integers is as follows:45, 35, 85, 80, 33, 27, 90After executing the function, the array content should be changed as follows:45, 40, 85, 80, 38, 32, 90

Answer»

void grace_score(int score[],int size)

{

for(int i=0;i<size;i++)

{

if(score[i]<40)

score[i]=score[i]+5;

cout<<score[i]<<" ";

}

}

400.

Write the definition of a member function push() for a class Library in C++ to insert a book information in a dynamically allocated stack of books considering the following code is already written as a part of the program:struct book{int bookid;char bookname[20];book *next;};class Library{book *top;public:Library(){top=NULL;}void push();void pop();void disp();~Library();};

Answer»

void Library::push()

{

book *nptr;

nptr=new book;

cout<<"Enter values for bookid and bookname";

cin>>nptr->bookid;

gets(nptr->bookname);

nptr->next=NULL;

if(top==NULL)

top=nptr;

else

{

nptr->next=top;

top=nptr;

}

}