TN Board 12th Commerce Important Questions Chapter 4 Introduction to Financial Markets

TN State Board Kalvi 12th Commerce Notes Chapter 4 Introduction to Financial Markets

Question 1.
What are the components of organized sectors?
Answer:

  1. Regulations
  2. Financial Institutions
  3. Financial Markets
  4. Financial Services

Question 2.
Write a note on financial market.
Answer:
A market where in financial instruments such as financial claims, assets and securities are traded is known as a “Financial Market”. [OR]
A financial market is an institution or arrangement that facilitates the exchange of financial instruments (equity shares, preference shares, debentures corporate stocks and bonds).

Samacheer Kalvi TN State Board 12th Commerce Notes Chapter 4 Introduction to Financial Markets

Question 3.
What is equity market?
Answer:

  1. It is the type of financial market on the basis of financial claim.
  2. It is a market for trading in Equity Shares of companies.

Question 4.
What is debt market?
Answer:

  1. It is type of financial market on the basis of financial claim.
  2. A market for trading in Debt Instrument. That is Government Bonds or Securities, Corporate Debentures or Bonds.

Question 5.
How is prize decided in a secondary market?
Answer:
Price will be decided in a secondary market based on the interaction of buyers and sellers. It fluctuates depends on the demand and supply force in the market.

Samacheer Kalvi TN State Board 12th Commerce Notes Chapter 4 Introduction to Financial Markets

Question 6.
Give the meaning and definition of financial market.
Answer:
Meaning:
A market where in financial instruments such as financial claims, assets and securities are traded is known as a “Financial Market”.

A Financial Market is an institution or arrangement that facilitates the exchange of financial instruments such as equity shares, preference shares, debentures corporate stocks and bonds. ‘

Definitions:
According to Brigham, Eugene F, “The place where people and organizations wanting to borrow money are bought together with those having surplus funds is called a financial market.

Question 7.
Differentiate Spot Market from Futures Market.
Answer:
Spot Market:
It is a market where the delivery of the financial instrument and payment of cash occurs immediately.
Forward or Futures Market: It is a market where the delivery of assets and payment of cash takes place at a pre-determined time (Future).

Question 8.
Write a note on Secondary Market.
Answer:

  1. It is the market for securities that are already issued or the place where formerly issued securities are traded is known as Secondary Market.
  2. Securities can be sold multiple times.
  3. Price will be fluctuates and it will depends on the demand and supply force in one market.
  4. Stock Exchange is an important institution in the secondary market.

Samacheer Kalvi TN State Board 12th Commerce Notes Chapter 4 Introduction to Financial Markets

Question 9.
Bring out the scope of financial market in India.
Answer:

  1. The Financial Market provides financial assistance to individuals, agricultural sectors, industrial sectors.
  2. It is also provide financial assistance to financial institutions like banks, insurance sectors, Provident Funds and the Government.
  3. The institutions get their short term as well as long term financial assistance through financial market.
  4. Individuals, institutions and the Government can get their required funds in time.
  5. It leads to the overall economic development.

Question 10.
Distinguish between new issue market and secondary market.
Answer:

TN State Board 12th Commerce Important Questions Chapter 4 Introduction to Financial Markets 1

Samacheer Kalvi TN State Board 12th Commerce Notes Chapter 4 Introduction to Financial Markets

Question 11.
Enumerate the different kinds of financial markets.
Answer:
Financial markets can be classified in different ways.

Stock Market:
The stock market trades shares of ownership of public companies. Each shares comes with a price and investors make money with the stock when they perform well in the market.

Bond Market:
The Bond Market offers opportunities for companies and the Government to secure money to finance a project or investment. Investors buy bonds from a company. The company returns the amount of the bonds within an agreed period plus interest.

Commodity Market:
The Commodity market is where traders and investors buy and sell natural resources or commodities such as com, oil, meat and gold. A specific market is created for such resources because their price is unpredictable.

Derivatives Market:
Such a market involves derivatives or contracts whose value is based on the market value of the asset being traded.

Samacheer Kalvi TN State Board 12th Commerce Notes Chapter 4 Introduction to Financial Markets

Question 12.
Discuss the role of financial market.
Answer:
A financial market is of great use for a country as it helps the economy in the following manner.
(i) Savings Mobilization:
Obtaining funds from the savers or surplus units. (Business firms, Public Sector Units household individuals and the Government).

(ii) Investment:
Financial Market plays a key role in arranging the investment of funds to collected funds from those units which are in need of the same.

(iii) National Growth:
To attain national growth by ensuring the flow of surplus funds to deficit units. Flow of funds for productive purposes is also made possible.

(iv) Entrepreneurship Growth:
Financial markets contribute to the development of entrepreneurial class for arranging available necessary financial resources.

(v) Industrial Development:
The different components of financial markets help an accelerated growth industrial development. It leads to overall economic development of a country.

Samacheer Kalvi TN State Board 12th Commerce Notes Chapter 4 Introduction to Financial Markets

Question 13.
What are the functions of Financial Markets?
Answer:
Intermediary Functions:
(i) Transfer of Resources:
To transfer of real economic resource from lenders to ultimate borrowers.

(ii) Enhancing Income:
Financial Markets allow lenders to earn interest/ dividend on their surplus investible funds.

(iii) Productive Usage:
Financial Markets allow to use the funds borrowed and enhancing the income and the gross national production.

(iv) Capital formation:
Financial markets provide a channel to save funds. New saving funds flow to aid capital formation of a country.

(v) Price Determination:
Interaction of Buyers and Sellers to determine the price of the traded financial assets. Allocation of funds in the economy based on demand and supply (price mechanism).

(vi) In Sale Mechanism:
For selling of a financial assets by an investor to offer the benefit of marketability and liquidity of such assets.

(vii) Information:
To know the various segments of the markets so as to reduce the cost of transaction of financial assets.

Financial Functions:
(i) Providing the borrowers with funds so as to enable them to carry out the investment plan.
(ii) Providing liquidity in the market so as to facilitate trading of funds.

Samacheer Kalvi TN State Board 12th Commerce Notes Chapter 4 Introduction to Financial Markets

Question 14.
Discuss the various types of Financial markets.
Answer:
Financial Markets can be classified in different ways. They are as follows.

(a) On the basis of Type of Financial claim:
(i) Debt Market: Trading in Debt Instrument, Government Bonds or Securities Corporate Debentures or Bonds.
(ii) Equity Market: It is the financial market for trading in equity shares of companies.

(b) On the basis of Maturity of Financial Claim:
(i) Money Market: It is the market for short term financial claim (one year or less). Eg: Treasury Bills, Commercial Paper
(ii) Capital Market: Market for long term financial claim (More than a year). Eg: Shares, Debentures

(c) On the basis of Time of Issue of Financial Claim:
(i) Primary Market: Sale of securities for the first time by the issuers (companies). The money from investors goes directly to the issuers.
(ii) Secondary Market: The market for securities that are already issued. (Stock Exchange) Securities can be sold by multiple times in the market.

(d) On the basis of Timing of Delivery of Financial Claim:
(i) Cash / Spot Market: A market where the delivery of financial instrument and payment of cash occurs immediately.
(ii) Forward or Future Market: A market where the delivery of assets and payment of cash take place at a pre-determined time (Future).

(e) On the basis of the Organizational Structure of the Financial Market:
(i) Exchange Traded Market: It is a centralized organization with standardized procedures (Stock Exchange).
(ii) Over-the-counter Market: It is a decentralized market with customized procedures (Outside the Stock Exchange).

Samacheer Kalvi TN State Board 12th Commerce Notes Chapter 4 Introduction to Financial Markets

Choose the correct answer:

Question 1.
Financial market facilitates business firms:
(a) To rise funds
(b) To recruit workers
(c) To make more sales
(d) To minimize fund requirement
Answer:
(a) To rise funds

Question 2.
Capital market is a market for:
(a) Short Term Finance
(b) Medium Term Finance
(c) Long Term Finance
(d) Both Short Term and Medium Term Finance
Answer:
(c) Long Term Finance

Question 3.
Primary market is also called as:
(a) Secondary market
(b) Money market
(c) New Issue Market
(d) Indirect Market
Answer:
(c) New Issue Market

Samacheer Kalvi TN State Board 12th Commerce Notes Chapter 4 Introduction to Financial Markets

Question 4.
Spot Market is a market where the delivery of the financial instrument and payment of cash occurs:
(a) Immediately
(b) In the future
(c) Uncertain
(d) After one month
Answer:
(a) Immediately

Question 5.
How many times a security can be sold in a secondary market?
(a) Only one time
(b) Two time
(c) Three times
(d) Multiple times
Answer:
(d) Multiple times

TN Board 12th Commerce Important Questions

TN Board 12th Commerce Important Questions Chapter 3 Management By Objectives (MBO) and Management By Exception (MBE)

TN State Board Kalvi 12th Commerce Notes Chapter 3 Management By Objectives (MBO) and Management By Exception (MBE)

Question 1.
Define MBO.
Answer:
Prof. Reddin defines MBO as “The establishment of effective standards for managerial positions and the periodic conversion ofthose into measurable time bound objectives linked vertically and horizontally and with future planning”.

Question 2.
What are the objectives of MBO?
Answer:

  1. To measure and judge performance.
  2. To relate individual performance to organizational goals.
  3. To foster the increasing competence and growth of the subordinates.
  4. To enhance communications between superiors and subordinates.
  5. To stimulate the subordinate’s motivation.
  6. To serve as a device for organizational control and integration.

Samacheer Kalvi TN State Board 12th Commerce Notes Chapter 3 Management By Objectives (MBO) and Management By Exception (MBE)

Question 3.
Bring out the meaning of MBE.
Answer:

  1. Management by exception is an important principle of managerial control suggested by the classical writers on management.
  2. Management by exception is a style of business management that focuses on identifying and handling cases that deviate from the norm.

Question 4.
Mention any two advantages of MBO.
Answer:

  1. MBO process helps the managers to understand their role in the total organization.
  2. MBO provides a foundation for participative management. Subordinates are also involved in goal setting.

Question 5.
Wrtie any two importance of MBE.
Answer:

  1. Easy determination of responsibility
  2. Saves time
  3. Optimum utilization of abilities
  4. Increases productivity
  5. Enhances research and development
  6. Develops subordinates

Samacheer Kalvi TN State Board 12th Commerce Notes Chapter 3 Management By Objectives (MBO) and Management By Exception (MBE)

Question 6.
What is known as KRA?
Answer:

  1. Key Result Areas are fixed on the basis of organizational objectives premises.
  2. KRA are arranged on a priority basis.
  3. KRA indicates the strength of an organization. Eg: KRA are profitably, market standing, innovation.

Question 7.
Write the features of MBO.
Answer:

  1. MBO tries to combine the long run goals of organization with short run goals.
  2. Management tries to relate the organization goal with society goals.
  3. MBO’s emphasis is not only on goals but also an effective performance.
  4. It increases the organizational capability of achieving goals at all levels.
  5. A high degree of motivation and satisfaction is available to employees through MBO.
  6. Encourages a climate of trust, goodwill and a will to perform.

Samacheer Kalvi TN State Board 12th Commerce Notes Chapter 3 Management By Objectives (MBO) and Management By Exception (MBE)

Question 8.
What are the process involved in MBO?
Answer:
The MBO process is characterized by the balance of objectives of the organization and individual.
Defining organizational objectives:
(i) It is framed by the top level employees of an organization.
(ii) First longterm objectives are frames. Then short term objectives are framed taking into account the feasibility of achieving the long term objectives.

Goals of each section:
Objectives for each section, department or division are framed on the basis of overall objectives of the organization. Period within which these objectives should be achieved is also fixed.

Fixing key result areas:
(i) KRA are arranged on a priority basis.
(ii) KRA indicates the strength of an organization.
Eg: Profitability, Innovation.

Matching Resources with objective:
The objectives are framed on the basis of availability of resources. If certain resources are not adequately available. So there is a need for matching resources with objective. Available resources should be properly allocated and utilized.

Question 9.
What are the Process of MBE?
Answer:

  1. It is necessary to set objectives or norms with predictable or estimated results.
  2. These performances are assessed and get equated to the actual performance.
  3. With an insignificant or no deviation, no action, is required and senior managers can concentrate on other matters.
  4. If actual performances deviates significantly, the issue needs to be passed to the senior managers as an “exception has occurred”.
  5. Finally the aim is to solve this “exception” immediately.

Samacheer Kalvi TN State Board 12th Commerce Notes Chapter 3 Management By Objectives (MBO) and Management By Exception (MBE)

Question 10.
List out any Four process of MBO.
Answer:

  1. Defining organizational objectives
  2. Fixing key result areas
  3. Setting subordinate objectives or targets
  4. Periodical review meetings tong answer questions:

Question 11.
What are the major advantages of MBO?
Answer:

  1. Managers are involved in objectives setting at various levels of management under MBO and this commitment ensures hard work to achieve them.
  2. MBO process helps the managers to understand their role in the total organization.
  3. MBO provides a foundation for participative management, subordinates are also involved in goal setting.
  4. Systematic evaluation of performance is made with the help of MBO.
  5. Delegation of authority is easily done with the help of MBO.
  6. MBO gives the criteria of performance. It helps to take corrective action.
  7. MBO motivates the workers by job enrichment and makes the job meaningful.
  8. The responsibility of a Worker is fixed through MBO.
  9. Decision is taken by the management very quickly.
  10. Manager recognizes the need for planning and appreciates the planning.

Samacheer Kalvi TN State Board 12th Commerce Notes Chapter 3 Management By Objectives (MBO) and Management By Exception (MBE)

Question 12.
What are the advantages of MBE?
Answer:
Management by exception provides the following benefits:

  1. It saves the time of managers because they deal only with exceptional matters. Routine problems are left to subordinates.
  2. It focuses managerial attention on major problems. As a result, there is better utilization of managerial talent and energy.
  3. It facilitates delegation of authority TOP management concentrates on strategic decisions and operational decisions are left to the lower levels.
  4. It forces managers to review past history and study related to business data for identifying deviations. There is better use of knowledge of trends, history and available business data. ‘
  5. MBE keeps management alert to opportunities and threats by identifying critical problems.
  6. Management by exception provides better yardsticks forjudging results. It is helpful in objective performance appraisal.

Question 13.
Explain the various disadvantages of MBO.
Answer:

  1. MBO fails to explain the philosophy; most of the executives do not know how MBO works? And how participants can benefit by MBO?
  2. MBO is a time consuming process much time is needed by senior people for framing the MBO. It leads to heavy expenditure and also requires heavy paper work.
  3.  MBO emphasis only on short-term objectives and does not consider the long term objectives.
  4. The status of subordinates is necessary for proper objectives settings. But this is not possible in the process of MBO.
  5. MBO is rigid one objectives should be changed according to the changed circumstances, external or internal. If it is not done, the planned results cannot be obtained.

Samacheer Kalvi TN State Board 12th Commerce Notes Chapter 3 Management By Objectives (MBO) and Management By Exception (MBE)

Question 14.
Discuss the disadvantages of MBE.
Answer:
Management by exception is a style of business management that focuses on identifying and handling cases that deviate from the norm.

  1. The main disadvantage of MBE is only managers have the power over really important decisions, which can be demotivating for employees at a lower level.
  2. Further more, it takes time to pass the issues to managers.
  3. Managing employees who deviate from the normal procedures. Because of compliance failures are considered difficult to manage and typically find themselves with limited job duties and ultimately dismissed/ terminated.

Choose the correct answer:

Question 1.
_______ System gives full Scope to the Individual Strength and Responsibility.
(a) MBO
(b) MBE
(c) MBM
(d) MBA
Answer:
(a) MBO

Question 2.
Which is the First step,in Process of MBO?
(a) Fixing Key Result Area
(b) Appraisal of Activities
(c) Matching Resources with Activities
(d) Defining Organisational Objectives
Answer:
(d) Defining Organisational Objectives

Samacheer Kalvi TN State Board 12th Commerce Notes Chapter 3 Management By Objectives (MBO) and Management By Exception (MBE)

Question 3.
_______ keeps Management Alert to Opportunities and Threats by Identifying Critical Problems.
(a) MBA
(b) MBE
(c) MBM
(d) MBO
Answer:
(b) MBE

Question 4.
Delegation of Authority is Easily Done with the Help of:
(a) MBM
(b) MBE
(c) MBO
(d) MBA
Answer:
(c) MBO

TN Board 12th Commerce Important Questions

TN Board 12th Commerce Important Questions Chapter 2 Functions of Management

TN State Board Kalvi 12th Commerce Notes Chapter 2 Functions of Management

Question 1.
Write a short note about Planning.
Answer:

  1. Planning is the primary function of management.
  2. Nothing can be performed without planning. Eg: writing a book starts with planning.
  3. Planning is a constructive reviewing of future needs so that present actions can be adjusted in view of the established goal.

Question 2.
What is meant by Motivation?
Answer:

  1. The goals are achieved with the help of motivation.
  2. Motivation includes increasing the speed of performance of a work and developing a willingness on the part of workers. This is done by a resourceful leader.

Samacheer Kalvi TN State Board 12th Commerce Notes Chapter 2 Functions of Management

Question 3.
What is meant by Controlling?
Answer:

  1. Controlling is performed to evaluate the performance of employees and deciding increments and promotion decisions.
  2. The control function helps in identifying underperformers and arranging remedial training for them.

Question 4.
How do you coordinate your classroom with peace?
Answer:

  1. To create positive atmosphere.
  2.  Active listening technique.
  3. Engage in activities to develop or to get knowledge.
  4. Opportunity for students to participate in classroom activities.
  5. Promoting self confidence and respect to others and themselves.

Question 5.
What is meant by Innovation?
Answer:

  1. Innovation refers to the preparation of personnel and organization to face the changes made in the business world.
  2. Continuous changes are being made in the business.
  3. Innovation includes developing new material, new products, new techniques in production and cost reduction.

Samacheer Kalvi TN State Board 12th Commerce Notes Chapter 2 Functions of Management

Question 6.
List out the main functions of management?
Answer:

  1. Planning
  2. Organising
  3. Staffing
  4. Motivating
  5. Directing
  6. Controlling and
  7. Co-ordination.

Question 7.
State the importance of staffing.
Answer:

  1. Staffing refers to placement of right persons in the right jobs.
  2. Staffing includes selection of right persons.
    (a) Promotion of best persons
    (b) Retirement of old persons
    (c) Performance appraisal
    (d) Training – needy persons
  3. The success of any enterprise depends upon the successful performance of
    staffing function.

Samacheer Kalvi TN State Board 12th Commerce Notes Chapter 2 Functions of Management

Question 8.
Bring out the subsidiary functions of management.
Answer:

  1. Innovation,
  2. Representation,
  3. Decision making and
  4. Communication are the subsidiary functions of management.

Question 9.
State the importance of Motivation.
Answer:
Motivation is important because it allows management to meet the company’s goals. Motivated employees can lead to increase productivity and allow an organization to achieve higher levels of output. The process of motivation plays a very important role in any organization, profit or non-profit that ensures organizational efficiency. Motivated people accept changes enthusiastically and improve their work performance.

Question 10.
What are the main duties of a manager?
Answer:
Duties of a Manager:

  1. The Manger is responsible for planning and maintaining work systems, procedures and policies that enable and encourage the optimum performance of its people and other resources.
  2. Entrusted with a leadership role, a manager is responsible for overseeing a department or group of employees within a specific organization or company.
  3. Manager contribute to business in significant ways which are reflected in company profits, organization and over all work place morale.
  4. Manager is an accomplishment because it reveals a professionals ability to successfully lead, multiple business operations manage stress and effectively communicate with co-workers.

Samacheer Kalvi TN State Board 12th Commerce Notes Chapter 2 Functions of Management

Question 11.
Explain the various functions of management.
Answer:
Planning, organizing, staffing, directing, motivating, controlling and co-ordination are the main functions of management.
(i) Planning:
Planning is the primary function of management. Nothing can be performed without planning. Planning is a constructive reviewing of future needs so that present actions can be adjusted in view of the establishing goal.

(ii) Organizing:
Organizing is the process of establishing harmonious relationship among the members of an organization. Organizing function work is assigned to employees who are given authority to carry out the work assigned and made accountable for it.

(iii) Staffing:
Staffing refers to placement of right persons in the right jobs. Staffing includes selection of right persons, training to those needy persons, performance of appraisal and adequate remuneration of personnel.

(iv) Directing:
Directing denotes motivating, leading guiding and communicating with sub-ordinates on an ongoing basis inorder to accomplish preset goals.

(v) Motivating:
The goals are achieved with the help of motivation. Motivation includes increasing the speed of performance of a work and developing willingness on the part of workers. This is done by a resourceful leader.

(vi) Controlling:
Controlling is performed to evaluate the performance of employees and deciding increments and promotion decisions.

(vii) Co-ordination:
Co-ordination is the integration of the actions of all individuals, working in the enterprise in different capacities. Co-ordination is included in every managerial functions. Eg: planning and co-ordination.

Samacheer Kalvi TN State Board 12th Commerce Notes Chapter 2 Functions of Management

Choose the correct answer:

Question 1.
Which is the primary function of management?
(a) Innovating
(b) Controlling
(c) Planning
(d) Decision-making
Answer:
(c) Planning

Question 2.
Which of the following is not a main function?
(a) Decision-making
(b) Planning
(c) Organising
(d) Staffing
Answer:
(a) Decision-making

Question 3.
Distribution of work in groupwise or sectionwise is called as:
(a) Co-ordinating
(b) Controlling
(c) Staffing
(d) Organising
Answer:
(d) Organising

Samacheer Kalvi TN State Board 12th Commerce Notes Chapter 2 Functions of Management

Question 4.
Which of the following is verification function?
(a) Planning
(b) Organising
(c) Staffing
(d) Controlling
Answer:
(d) Controlling

TN Board 12th Commerce Important Questions

TN Board 11th Computer Science Important Questions Chapter 18 Tamil Computing

TN State Board 11th Computer Science Important Questions 18 Tamil Computing

Question 1.
What do you mean by e-Governance?
Answer:
e-Govemance is getting Government services through internet. Govt, of Tamilnadu is giving its services through internet. Users can communicate with Govt, of Tamilnadu – from any comer of the state and get important announcements, government orders and government welfare schemes from the web portal.

Question 2.
What is Thamizpori?
Answer:
Thamizpori (தமிழ்பொறி) is a Tamil translation application having more than 30000 Tamil words equivalent to English words. In this, user can translate small english sentences into Tamil. Google also gives an online translation facility, using this users can translate from Tamil to any other language vice versa.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 18 Tamil Computing

Question 3.
What is ISCII?
Answer:
ISCII (Indian Script Code for Information Interchange) is an encoding scheme specially designed for Indian languages including Tamil. It was unified with Unicode.

Question 4.
What is called Tamil Language Council?
Answer:
The council of Tamil Language was formed by the ministry of Information Communications and Arts, Govt, of Singapore with the objectives of promoting the awareness and greater use of Tamil among the Singaporeans, in 2001. The council is called as “வளர்தமிழ் இயக்கம்”.

Question 5.
What is the use of Madurai project?
Answer:
Project Madurai is an open and voluntary initiative to collect and publish free electronic editions of ancient Tamil literary classics. Thismeans either typing-in or scanning old books and archiving the text in one of the most readily accessible formats for use on all popular computer platforms.
Website: http: //www.proj ectmadurai. org/

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 18 Tamil Computing

Question 5.
List out the Familiar Tamil Keyboard Interface and layouts?
Answer:

  1. NHM Writer, E-Kalappai and Lippikar – are familiar Tamil keyboard interfaces software that is used for Tamil typing which works on Tamil Unicode, using phonetics.
  2. Sellinam and Ponmadal – are familiar Tamil keyboard layouts that works on Android operating system in Smart phone using phonetics.

Question 6.
Write a note on Tamil Office Automation Application.
Answer:
Microsoft Office, Open Office etc., are the famous Office automation softwares that provides complete Tamil interface facility. These softwares are downloadable and installed in computer. After installation, office automation software environment will completely changed to Tamil.

Menu bars, names of icons, dialog boxes will be shown in Tamil. Moreover, user can save files with Tamil names and create folders with Tamil names. Tamil Libra Office, Tamil Open Office, Azhagi Unicode Editor, Ponmozhi, Menthamiz, Kamban, Vani are office automation software working exclusively for Tamil. These applications are designed to work completely in Tamil.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 18 Tamil Computing

Question 7.
Write a note on Tamil operating system.
Answer:
An operating system is needed to access electronic systems such as computer and smart phone. Microsoft Windows is very popular operating system for personal computers. Linux is another popular open source operating system. Operating systems are used to access a computer easily.

An operating system should be easy to work and its environment should be in understandable form. Thus, all operating systems used in computers and smart phones offered environment in Tamil. Windows Tamil Environment interface should be downloading and install from internet. It shows all windows elements such as Taskbar, desktop elements, names of icons, commands in Tamil.

Question 8.
What do you mean by Unicode?
Answer:
Unicode is an encoding system, designed to handle various world languages, including Tamil. The first version 1.0.0 was introduced on October 1991 was able to handle nearly 23 languages including Tamil. Unicode is the suitable encoding scheme to handle Tamil.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 18 Tamil Computing

Question 9.
List out the web address of E-Governance through Tamil.
Answer:

TN State Board 11th Computer Science Important Questions Chapter 18 Tamil Computing 1

 

Question 10.
List out the web address of E-Governance through Tamil.
Answer:

TN State Board 11th Computer Science Important Questions Chapter 18 Tamil Computing 2

TN State Board 11th Computer Science Important Questions Chapter 18 Tamil Computing 3

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 18 Tamil Computing

Question 11.
Explain Tamil Information Interchange coding systems.
Answer:
TSCII (Tamil Script Code for Information Interchange):
Computers handle data and information as binary system. Every data should be converted into binary while it is feed into a computer system. Computers use ASCII encoding system to handle data and information. The ASCII encoding system is applicable only for handling English language.

Therefore, TSCII (Tamil Script Code for Information Interchange) is the first coding system to handle Tamil language in an analysis of an encoding scheme that is easily handled in electronic devices, including non English computers. This encoding scheme was registered in IANA (Internet Assigned Numbers Authority) unit of ICANN.

ISCII (Indian Script Code for Information Interchange):
This is one of the encoding schemes specially designed for Indian languages including Tamil. It was unified with Unicode.

Unicode:
Unicode is an encoding system, designed to handle various world languages, including Tamil. The first version 1.0.0 was introduced on October 1991 was able to handle nearly 23 languages including Tamil. Unicode is the suitable encoding scheme to handle Tamil.

Question 12.
List of the search engines supporting Tamil.
Answer:
Google and Bing are the search engines supporting Tamil. In this, user can search everything through Tamil. A google search engine gives you an in built Tamil Virtual keyboard.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 18 Tamil Computing

Question 13.
What are the keyboard layouts used in Android?
Answer:
Sellinam and Ponmadal are the familiar Tamil keyboard layouts that works on Android operating system in Smart phone using phonetics.

Question 14.
Write a short note about Tamili Programming Language.
Answer:
The first Tamil programming language “Ezhil” (எழில்) is designed based on Python programming language. With the help of this programming language, user can write simple programs in Tamil.

Question 15.
What TSCII?
Answer:
TSCII (Tamil Script Code for Information Interchange) is the first coding system to handle Tamil language in an analysis of an encoding scheme that is easily handled in electronic devices, including non-English computers. This encoding scheme was registered in IANA (Internet Assigned Numbers Authority) unit of ICANN.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 18 Tamil Computing

Question 16.
Write a short note on Tamil Virtual Academy.
Answer:
Tamil Virtual University was established on 17th February 2001 by the Govt, of Tamilnadu to spread Tamil to the entire world through internet. This organisation is functioning in the name of “Tamil virtual Academy”. It offers different courses regarding Tamil language, Culture, heritage etc., from kindergarten to under graduation level.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 18 Tamil Computing

Choose the correct answer:

Question 1.
By the end of 2016, ________ are using internet in Tamil in India.
(a) 30%
(b) 50%
(c) 80%
(d) 42%
Answer:
(d) 42%

Question 2.
_______ Internet users consider local language digital content to be more reliable than English.
(a) 70%
(b) 100%
(c) 58%
(d) 68%
Answer:
(d) 68%

Question 3.
In 2021 onwards ________ of people in India will access internet using Tamil.
(a) 64%
(b) 42%
(c) 74%
(d) 94%
Answer:
(c) 74%

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 18 Tamil Computing

Question 4.
By 2021, the number of _______ internet users will be more than English users.
(a) Hindi
(b) Tamil
(c) Malayalam
(d) Bengali
Answer:
(a) Hindi

Question 5.
Marathi, Bengali, Tamil and Telugu internet users are expected to form ______ of the total Indian language internet user base.
(a) 40%
(b) 30%
(c) 20%
(d) 50%
Answer:
(b) 30%

Question 6.
________ are used to search any information from the cyber space.
(a) Word processor
(b) Spreadsheet
(c) Data base
(d) Search Engines
Answer:
(d) Search Engines

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 18 Tamil Computing

Question 7.
________ provide searching facilities in Tamil.
(a) Google and Playstore
(b) Google and Bing
(c) Google and rediff
(d) rediff and Bing
Answer:
(b) Google and Bing

Question 8.
_______ search engine gives us an inbuilt Tamil virtual keyboard.
(a) Google
(b) Yahoo
(c) Gmail
(d) Yahoomail
Answer:
(a) Google

Question 9.
Government services through internet is known as:
(a) e-commerce
(b) e-Governance
(c) e-mail
(d) website
Answer:
(b) e-Governance

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 18 Tamil Computing

Question 10.
Official Website of Govt, of Tamilnadu:
(a) http://www.tnhealth.org/
(b) http://www.tn.gov.in/ta
(c) http://www.tnrd.gov.in/
(d) http://www.tnhrce.org/
Answer:
(b) http://www.tn.gov.in/ta

Question 11.
Tamilnadu Forest Department website is:
(a) https://www.gov.lk/index.php
(b) http://www.tnrd.gov.in/
(c) http://www.dge.tn.nic.in/
(d) https://www.forests.tn.gov.in/
Answer:
(d) https://www.forests.tn.gov.in/

Question 12. The website for Directorate of Govt. Examinations:
(a) http://www.tn.gov.in/ta
(b) http://www.tnrd.gov.in/
(c) http://www.tnhrce.org/
(d) http://www.dge.tn.nic.in/
Answer:
(d) http://www.dge.tn.nic.in/

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 18 Tamil Computing

Question 13.
http://www.tnpsc.gov.in/ is an official website for:
(a) Department of Agricultural Engineering
(b) Backward, Most Backward and Minorities Welfare Department
(c) Tamil Nadu Public Service Commission
(d) Official Website of Govt, of Srilanka
Answer:
(c) Tamil Nadu Public Service Commission

Question 14.
The web address of Rural Development and Panchayat Raj Department is:
(a) http://www.tnrdprd.gov.in/
(b) http://www.tnhrce.org/
(c) http://www.tnrd.gov.in/
(d) http://www.bcmbcmw.tn.gov.in/
Answer:
(c) http://www.tnrd.gov.in/

Question 15.
http://www.bcmbcmw.tn.gdv.in/ is web address for:
(a) Backward, Most Backward and Minorities Welfare Department
(b) Tamil Nadu Public Service Commission
(c) Official Website of Govt, of Srilanka
(d) TamilNadu Health Department
Answer:
(a) Backward, Most Backward and Minorities Welfare Department

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 18 Tamil Computing

Question 16.
E-Libraries are portal or website of collection of:
(a) e-commerce
(b) e-books
(c) e-libraries
(d) e-chat
Answer:
(b) e-books

Question 17.
_______ is a Tamil translation application.
(a) Thamizpori
(b) E-Kalappai
(c) Lippikar
(d) Ponmadal
Answer:
(a) Thamizpori

Question 18.
The first Tamil Programming language designed based on Python programming language is:
(a) Kamban
(b) Ezhil
(c) Vani
(d) Amudham
Answer:
(b) Ezhil

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 18 Tamil Computing

Question 19.
The abbreviation of TSCII is:
(a) Tamil Script Code for Information Interchange
(b) Tamil Script Code for Internet Interchange
(c) Tamil Script Code for Internet Information
(d) Tamil Script Code for Ip Information
Answer:
(a) Tamil Script Code for Information Interchange

Question 20.
________ is the first coding system to handle Tamil language.
(a) ICANN
(b) ISO
(c) ASCII
(d) TSCII
Answer:
(d) TSCII

Question 21.
The expansion of IANA:
(a) Institute Assigned Numbers Authority
(b) Internet Assigned Numbers Authority
(c) Information Assigned Numbers Authority
(d) Indian Assigned Numbers Authority
Answer:
(b) Internet Assigned Numbers Authority

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 18 Tamil Computing

Question 22.
The expansion for ISCII:
(a) Indian Script Code for Information Interchange
(b) Internet Script Code for Information Interchange
(c) Indus Script Code for Internet Information
(d) Individual Script Code for Internet Information
Answer:
(a) Indian Script Code for Information Interchange

Question 23.
_________ encoding system is designed to handle various world languages.
(a) Unicode
(b) Bhamini
(c) Arial
(d) Symbol
Answer:
(a) Unicode

Question 24.
The first version of Unicode was introduced on:
(a) November 1991
(b) October 1991
(c) October 1995
(d) December 1991
Answer:
(b) October 1991

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 18 Tamil Computing

Question 25.
The first version of Unicode can handle nearly ______ languages.
(a) 50
(b) 23
(c) 40
(d) 30
Answer:
(b) 23

Question 26.
___________ is very popular operating system for personal computers.
(a) Linux
(b) Unix
(c) Microsoft Windows
(d) Android
Answer:
(c) Microsoft Windows

Question 27.
Tamil Virtual University was established on:
(a) 17th February 2003
(b) 17th February 2001
(c) 17th February 2005
(d) 17th February 2007
Answer:
(b) 17th February 2001

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 18 Tamil Computing

Question 28.
________ is a open source encyclopedia.
(a) Wikipedia
(b) e-book
(c) e-mail
(d) Chat
Answer:
(a) Wikipedia

Question 29.
Identify the incorrect pair:

Column – I

 Column – II

(a) Google Search Engine
(b) E – Libraries Collection of e – books
(c) NHM writer Tamil keyboard interfaces
(d) Ezhil The first English programming language

Answer:
(d)

Question 30.
Identify the correct statement.
(a) Getting Government services through internet is known as e-leaming.
(b) The portal or website of collection of e-books are called e-commerce.
(c) Sellinam and ponmadal – are familiar Tamil keyboard layouts.
(d) ISCII is one of the encoding system to handle various world languages.
Answer:
(c) Sellinam and ponmadal – are familiar Tamil keyboard layouts.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 18 Tamil Computing

Question 31.
Choose the odd man out:
(a) NHM writer
(b) E-Kalappai
(c) Lippikar
(d) Ezhil
Answer:
(d) Ezhil

Question 32.
Choose the odd man out:
(a) Thamizpori
(b) Ponmozhi
(c) Menthamiz
(d) Kamban
Answer:
(a) Thamizpori

TN Board 11th Computer Science Important Questions

TN Board 11th Computer Science Important Questions Chapter 17 Computer Ethics and Cyber Security

TN State Board 11th Computer Science Important Questions Chapter 17 Computer Ethics and Cyber Security

Question 1.
Define Ethics.
Answer:
Ethics means “What is wrong and What is Right”. It is a set of moral principles that rule the behaviour of individuals who use computers.

Question 2.
Write the standards that are followed in the cyber world.
Answer:
The standards followed in cyberworld are:

  1. Do not use pirated software
  2. Do not use unauthorized user accounts
  3. Do not steal others passwords
  4. Do not hack

Question 3.
Define computer ethics.
Answer:
Computer ethics deals with the procedures, values and practices that govern the process of consuming computer technology and its related disciplines without damaging or violating the moral values and beliefs of any individual, organization or entity.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 17 Computer Ethics and Cyber Security

Question 4.
What is cyber crime?
Answer:
Cyber crime is an intellectual, white-collar crime. Those who commit such crimes generally manipulate the computer system in an intelligent manner.
Eg: illegal money transfer via internet.

Question 5.
What is cyber attack?
Answer:
Cyber attacks are launched primarily for causing significant damage to a computer system or for stealing important information from an individual or from an organization.

Question 6.
What do you mean by cyber security?
Answer:
Cyber security is a collection of various technologies, processes and measures that reduces the risk of cyber attacks and protects organizations and individuals from computer based threats.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 17 Computer Ethics and Cyber Security

Question 7.
Define Malware.
Answer:
Malware is a type of software designed through which the criminals gain illegal access to software and cause damage.

Question 8.
What are the two types of encryption?
Answer:
The two types of encryption schemes are:

  1. Symmetric Key encryption
  2. Public Key encryption

Question 9.
What do you mean by Digital signature?
Answer:
Digital signatures are based on asymmetric cryptography and can provide assurances of evidence to origin, identity and status of an electronic document, transaction or message, as well as acknowledging informed by the signer.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 17 Computer Ethics and Cyber Security

Question 10.
What is cyber law?
Answer:
“Cyber law or Internet law is a term that encapsulates the legal issues related to use of the Internet.

Question 11.
Write the types of cyber-crimes.
Answer:

TN State Board 11th Computer Science Important Questions Chapter 17 Computer Ethics and Cyber Security 1

Question 12.
Write a short note on unauthorized Access.
Answer:
Unauthorized access is when someone gains access to a website, program, server, service, or other system by breaking into a legitimate user account. For example, if someone tries guessing a password or username for an account that was not theirs until they gained access, it is considered an unauthorized access.

To prevent unauthorized access, Firewalls, Intrusion Detection Systems (IDS), Virus and Content Scanners, Patches and Hot fixes are used.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 17 Computer Ethics and Cyber Security

Question 13.
What is Hacking? Give the diagrammatic representation of hacking.
Answer:
Hacking is intruding into a computer system to steal personal data without the owner’s permission or knowledge (like to steal a password). It is also gaining unauthorized access to a computer system and altering its contents. It may be done in pursuit of a criminal activity or it may be a hobby.

Hacking may be harmless if the hacker is only enjoying the challenge of breaking systems defenses, but such ethical hacking should be practiced only as controlled experiments. Figure below shows a diagrammatic representation of Hacking.

TN State Board 11th Computer Science Important Questions Chapter 17 Computer Ethics and Cyber Security 2

Question 14.
State some reasons why websites use cookies.
Answer:
Websites typically use cookies for the following reasons:

  1. To collect demographic information about who has visited the Website.
  2. Sites often use this information to track how often visitors comfe to the site and how long they remain on the site.
  3. It helps to personalize the user’s experience on the Web site.
  4. Cookies can help store personal information about users so that when a user subsequently returns to the site, a more personalized experience is provided.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 17 Computer Ethics and Cyber Security

Question 15.
Write a lote on public key encryption.
Answer:
Public key encryption is also called Asymmetric encryption. It uses the concept of a key value pair, a different key is used for the encryption and decryption process. One of the keys is typically known as the private key and the other is known as the public key.

The private key is kept secret by the owner and the public key is either shared amongst authorized recipients or made available to the public at large.

The data encrypted with the recipient’s public key can only be decrypted with the corresponding private key. Figure below shows the public key encryption.

TN State Board 11th Computer Science Important Questions Chapter 17 Computer Ethics and Cyber Security 3

Question 16.
Write a short note on Asymmetric encryption in Digital certificate.
Answer:
A digital certificate in a client-server model of communication is an example of Asymmetric Encryption. A certificate is a package of information that identifies a user and a server. It contains information such as an organization’s name, the organization that issued the certificate, the user’s email address and country and user’s public key.

When a server and a client require a secure encrypted communication, they send a query over the network to the other party, which sends back a copy of the certificate. The other party’s public key can be extracted from the certificate. A certificate can also be used to uniquely identify the holder.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 17 Computer Ethics and Cyber Security

Question 17.
What do you mean by Information Technology Act?
Answer:
In the 21st century, Computer, Internet and ICT or e-revolution has changed the life style of the people. Today
paper based communication has been substituted by e-communication. Accordingly we have new terminologies like cyber world, e-transaction, e-banking, e-retum and e-contracts.

Apart from positive side of e-revolution there is also negative side of computer, that is, the internet and ICT in the hands of criminals which has become a weapon of offence. Accordingly a new panel of members emerged to tackle the problems of cyber crimes in cyber space i.e., Cyber Law or Cyber Space Law or Information Technology Law or Internet Law.

In India Cyber law and IT Act 2000, modified in 2008 are being articulated to prevent computer crimes. IT Act 2000 is an act to provide legal recognition for transactions carried out by means of Electronic Data Interchange (EDI) and other means of electronic communication. It is the primary law in India dealing with cybercrime and electronic commerce (e-commerce). e-Commerce is electronic data exchange or electronic filing of information.

Question 18.
Explain in detail about the cyber security threats in detail.
Answer:
Most of the individuals and enterprises are facing problems due to the weaknesses inherent in security systems and compromised organizational infrastructures. Different types of Cyber Security Threats are categorized as below:

Social engineering:
A misuse of an individual’s weakness, achieved by making them to click malicious links or by physically accessing the computer through tricks.
Eg: Phishing and pharming.

Phishing:
Phishing is a type of computer crime used to attack, steal user data, including login name, password and credit card numbers. It occurs when an attacker targets a victim into opening an e-mail or an instant text message. The attacker uses phishing to distribute malicious links or attachments that can perform a variety of functions, including the extraction of sensitive login credentials from victims.

TN State Board 11th Computer Science Important Questions Chapter 17 Computer Ethics and Cyber Security 4

Pharming:
Pharming is a scamming practice in which malicious code is installed on a personal computer or server, misdirecting users to fraudulent websites without their knowledge or permission. Pharming has been called “phishing without a trap”. It is another way hackers attempt to manipulate users on the Internet. It is a cyber-attack intended to redirect a website’s traffic to a fake site.

TN State Board 11th Computer Science Important Questions Chapter 17 Computer Ethics and Cyber Security 5

Man In The Middle (MITM):
Man-in-the- middle attack (MITM; also Janus attack) is an attack where the attacker secretly relays and possibly alters the communication between two parties who believe they are directly communicating with each other.

Eg: Suppose Alice wishes to communicate with Bob. Meanwhile, Mallory wishes to intercept the conversation to overhear and optionally to deliver a false message to Bob.

TN State Board 11th Computer Science Important Questions Chapter 17 Computer Ethics and Cyber Security 6

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 17 Computer Ethics and Cyber Security

Question 19.
What are cookies? Why cookies are used in websites? Explain with example.
Answer:
A cookie is a small piece of data sent from a website and stored on the user’s computer memory (Hard drive) by the user’s web browser while the user is browsing internet. It is also called HTTP cookie, web cookie, Internet cookie, browser cookie, or simply cookie. Websites use cookies for the following reasons:

  1. To collect demographic information about who has visited the Website.
  2. Sites often use this information to track how often visitors come to the site and how long they remain on the site.
  3. It helps to personalize the user’s experience on the Website.
  4. Cookies can help store personal information about users so that when a user subsequently returns to the site, a more personalized experience is provided.

Some online shopping sites will make recommendations to users based on their previous purchases. It helps to monitor advertisements. Cookies do not act maliciously on computer system. They are merely text files that can be deleted at any time.

Cookies cannot be used to spread viruses and they cannot access your hard drive. Any personal information that you provide to a Website, including credit card information, will most likely be stored in a cookie unless the cookie feature is explicitly turned off in your browser. This is the way in which cookies threaten privacy.

Question 20.
Explain the working of
(i) Firewall
(ii) Proxy servers
Answer:
(i) Firewall:
It is a computer network security based system that monitors and controls incoming and outgoing network traffic based on predefined security rules. A firewall establishes a block between a trusted internal computer network and entrusted computer outside the network.

They are categorized as network-based or host-based. Network based firewalls are positioned on the gateway computers of LANs [Local Area Network], WANs [Wide Area Network] and intranets. Host-based firewalls are positioned on the network node itself. The host-based firewall may be a service as a part of the operating system or an agent application such as endpoint security or protection.

Each has advantages and disadvantages. However, each has a role in layered security. Firewalls also vary in type depending on where communication originates, where it is intercepted, and the state of communication being traced.

TN State Board 11th Computer Science Important Questions Chapter 17 Computer Ethics and Cyber Security 7

Proxy servers:
A proxy server acts as an intermediary between the end users and a web server. A client connects to the proxy server, requesting some service, such as a file, connection, web page or other resources available from a different server. The proxy server examines the request, checks authenticity and grants the request based on that. Proxy servers typically keep the frequently visited site addresses in its cache which leads to improved response time.

TN State Board 11th Computer Science Important Questions Chapter 17 Computer Ethics and Cyber Security 8

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 17 Computer Ethics and Cyber Security

Question 21.
Explain the function of Digital signature.
Answer:
Digital signatures are based on asymmetric cryptography and can provide assurances of evidence to origin, identity and status of an electronic document, transaction or message, as well as acknowledging informed by the signer.

To create a digital signature, signing software (email) creates a one-way hash of the electronic data to be signed. The user’s private key to encrypt the hash, returning a value that is unique to the hashed data. The encrypted hash, along with other information such as the hashing algorithm, forms the digital signature.

Any change in the data, even to a single bit, results in a different hash value. This attribute enables others to validate the integrity of the data by using the signer’s public key to decrypt the hash. If the decrypted hash matches a second computed hash of the same data, it proves that the data hasn’t changed since it was signed.

If the two hashes don’t match, the data has either been tampered with in some way (indicating a failure of integrity) or the signature was created with a private key that doesn’t correspond to the public key presented by the signer (indicating a failure of authentication). Figure below shows the function of a digital signature.

TN State Board 11th Computer Science Important Questions Chapter 17 Computer Ethics and Cyber Security 9

Question 22.
Explain in detail about cracking.
Answer:
Cracking is where someone edits a program source so that the code can be exploited or modified. A cracker (also called a black hat or dark side hacker) is a malicious or criminal hacker. “Cracking” means trying to get into computer systems in order to steal, corrupt or illegitimately view data.

A cracker is someone who breaks into someone else’s computer system, often on a network, bypassing passwords or licenses in computer programs. Software cracking is the most often used type of cracking which is nothing but removing the encoded copyprotection. There is another type of cracking called password cracking. This is mainly used to crack the passwords. Password cracking can be performed either by using an automated program or can be manually realized.

Interesting fact about cracking is social engineering. It is a method of getting passwords and information using human weakness. These crackers trick people, not software. They can use just the phone forgetting information, they can pretend being your friend and talk to you on Internet Relay Chat (IRC) or by Instant messenger, e-mail can also be a source for them. They may send official e-mail requesting some sensitive information. It may look like a legitimate e-mail from bank or other official institution.

The other method that uses social engineering crackers is password guessing. They find your personal information from some personal data/facts and try to guess a password. Usually a cracker maintains knowledge of the vulnerabilities he or she finds and exploits them for personal advantage, not revealing them to either to the general public or to the manufacturer.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 17 Computer Ethics and Cyber Security

Question 23.
What is harvesting?
Answer:
A person or program collects login and password information from a legitimate user to illegally gain access to others account(s).

Question 24.
What are Warez?
Answer:
Commercial programs that are made available to the public illegally are called warez.

Question 25.
Write a short note on cracking.
Answer:
“Cracking” means trying to get into computer systems in order to steal, corrupt or illegitimately view data.

Question 26.
Write two types of cyber attacks.
Answer:
Worms:
They are self-repeating and do not require a computer program to attach themselves. Worms continually look for vulnerabilities and report back to the author of the worm when weaknesses are discovered.

Spyware:
It can be installed automatically on the computer when the attachments are open, by clicking on links or by downloading infected software.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 17 Computer Ethics and Cyber Security

Question 27.
What is a Cookie?
Answer:
A cookie is a small piece of data sent from a website and stored on the user’s computer memory (Hard drive) by the user’s web browser while the user is browsing internet.

Question 28.
What is the role of firewalls?
Answer:
A firewall is a computer network security based system that monitors and controls incoming and outgoing network traffic based on predefined security rules. A firewall commonly establishes a block between a trusted internal computer network and entrusted computer outside the network.

They are generally categorized as network- based or host-based. Network based firewalls are positioned on the gateway computers of LANs [Local Area Network], WANs [Wide Area Network] and intranets. Host-based firewalls are positioned on the network node itself. The host-based firewall may be a service as a part of the operating system or an agent application such as endpoint security or protection.

Each has advantages and disadvantages. However, each has a role in layered security. Firewalls also vary in type depending on where communication originates, where it is intercepted and the state of communication being traced.

Question 29.
Write about encryption and decryption.
Answer:
Encryption and decryption are processes that ensure confidentiality that only authorized persons can access the information.
Encryption is the process of translating the plain text data (plaintext) into random and mangled data (called cipher-text).
Decryption is the reverse process of converting the cipher-text back to plaintext. Encryption and decryption are done by cryptography.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 17 Computer Ethics and Cyber Security

Question 30.
Explain symmetric key encryption.
Answer:
Symmetric encryption is a technique to use the same key for both encryption and decryption. The main disadvantage of the symmetric key encryption is that all authorized users involved, have to exchange the key used to encrypt the data before they can decrypt it.

If any user intercepts the key information, they may read all messages. The working of symmetric key encryption:

TN State Board 11th Computer Science Important Questions Chapter 17 Computer Ethics and Cyber Security 10

Question 31.
What are the guidelines to be followed by any computer user?
Answer:
The following guidelines should be observed by computer users:

  1. Honesty: Users should be truthful while using the internet.
  2. Confidentiality: Users should not share any important information with unauthorized people.
  3. Respect: Each user should respect the privacy of other users.
  4. Professionalism: Each user should maintain professional conduct.
  5. Obey The Law: Users should strictly obey the cyber law in computer usage.
  6. Responsibility: Each user should take ownership andresponsibility for their actions.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 17 Computer Ethics and Cyber Security

Question 32.
What are ethical issues? Name some.
Answer:
An Ethical issue is a problem or issue that requires a person or organization to choose between alternatives that must be evaluated as right (ethical) or wrong (unethical). These issues must be addressed and resolved to have a positive influence in society.

Some of the common ethical issues are:

  1. Cybercrime
  2. Software Piracy
  3. Unauthorized Access
  4. Hacking
  5. Use of computers to commit fraud
  6. Sabotage in the form of viruses
  7. Making false claims using computers.

Question 33.
What are the various crimes happening using computer?
Answer:

TN State Board 11th Computer Science Important Questions Chapter 17 Computer Ethics and Cyber Security 11

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 17 Computer Ethics and Cyber Security

Question 34.
What is piracy? Mention the types of piracy. How can it be prevented?
Answer:
Piracy is “unauthorized copying of software”. Figure below shows a diagrammatical representation of software piracy.

TN State Board 11th Computer Science Important Questions Chapter 17 Computer Ethics and Cyber Security 12

Most of the commercial software is licensed for use at a single computer site or for use by only one user at any time.When a user buys any software, he becomes a licensed user for that software. He is allowed to make copies of the program for backup purposes, but it is against the law to distribute duplicate copies to others. Such illegal copying and distribution of commercial software should not be practiced.

An entirely different approach to software piracy is called shareware, acknowledges the futility of trying to stop people from copying software and instead relies on people’s honesty. Shareware publishers encourage users to give copies of programs to friends and colleagues but ask everyone who uses that program regularly to pay a registration fee to the program’s author directly.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 17 Computer Ethics and Cyber Security

Question 35.
Write the different types of cyber attacks.
Answer:
Cyber Attacks and Functions:

Virus:

  1. A virus is a small piece of computer code that can repeat itself and spreads from one computer to another by attaching itself to another computer file. One of the most common virus is Trojan.
  2.  Trojan virus is a program that appears to perform one function (for example, virus removal) but actually performs malicious activity when executed.

Worms:

  1. Worms are self- repeating and do not require a computer program to attach themselves.
  2. Worms continually look for vulnerabilities and report back to the author of the worm when weaknesses are discovered.

Spyware:
Spyware can be installed on the computer automatically when the attachments are open, by clicking on links or by downloading infected software.

Ransomware:

  1. Ransomware is a type of malicious program that demands payment after launching a cyber-attack @n a computer system.
  2. This type of malware has become increasingly popular among criminals and costs the organizations millions each year.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 17 Computer Ethics and Cyber Security

Choose the correct answer:

Question 1.
________ is a communication media which is easily accessible and open to all.
(a) Mobile
(b) TV
(c) Computer
(d) Internet
Answer:
(d) Internet

Question 2.
______ is wide spread through computers, mobile phones and internet.
(a) Information Technology
(b) Intranet
(c) LAN
(d) WAN
Answer:
(a) Information Technology

Question 3.
_____ play an important role in the daily lives of individuals and business.
(a) Computer
(b) Smart Phones
(c) Internet
(d) Tablets
Answer:
(a) Computer

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 17 Computer Ethics and Cyber Security

Question 4.
A ________ is a crime which involves computer and network.
(a) network crime
(b) system crime
(c) firewall
(d) cyber-crime
Answer:
(d) cyber-crime

Question 5.
__________ poses threats to the integrity, safety and survival of most business systems.
(a) Cyber-crime
(b) Cookies
(c) Firewall
(d) System crime
Answer:
(a) Cyber-crime

Question 6.
Ethics means:
(a) What is Right alone
(b) What is wrong and What is Right
(c) What is wrong alone
(d) None
Answer:
(b) What is wrong and What is Right

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 17 Computer Ethics and Cyber Security

Question 7.
__________ is becoming very popular among business as it helps them to reach a wide range of customers faster.
(a) e-commerce
(b) Hacking
(c) e-shopping
(d) Electronic mail
Answer:
(a) e-commerce

Question 8.
_________ users should not share any important information with unauthorized people.
(a) Confidentiality
(b) Professionalism
(c) Responsibility
(d) Honesty
Answer:
(a) Confidentiality

Question 9.
________ is an ethical issue.
(a) Data protection
(b) Data hiding
(c) Hacking
(d) Web application
Answer:
(c) Hacking

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 17 Computer Ethics and Cyber Security

Question 10.
Cyber crime is an ______ crime.
(a) Green-collar
(b) Red-collar
(c) Blue-collar
(d) White-collar
Answer:
(d) White-collar

Question 11.
_________ is an example for cyber crime.
(a) Legal money transfer in internet
(b) Chatting
(c) e-shopping
(d) Illegal money transfer in internet
Answer:
(d) Illegal money transfer in internet

Question 12.
______ is a set of moral principles that govern the behaviour of an individual in a society.
(a) Ethics
(b) Crime
(c) DPA
(d) Computer ethics
Answer:
(a) Ethics

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 17 Computer Ethics and Cyber Security

Question 13.
______ is a set of moral principles that regulate the use of computers by users.
(a) Trolling
(b) Computer ethics
(c) Computer crime
(d) Hacking
Answer:
(b) Computer ethics

Question 14.
Hacking, threats and blackmailing towards a business or a person is a:
(a) IT literacy
(b) Internet access
(c) Crime function
(d) Privacy
Answer:
(c) Crime function

Question 15.
Tricking people into that is not true is believing something that is not true is:
(a) scan
(b) scam
(c) share
(d) internet trolls
Answer:
(b) scam

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 17 Computer Ethics and Cyber Security

Question 16.
Distributing unwanted e-mail to a large number of internet users is:
(a) scam
(b) spam
(c) scan
(d) service
Answer:
(b) spam

Question 17.
_______ is a malicious practice in which communication is send from unknown source disguised as a source known to the receiver.
(a) Spoofing
(b) Spooling
(c) Copy righted
(d) Public-domain
Answer:
(a) Spoofing

Question 18.
Overloading a system with fake requests so that it cannot serve normal legitimate requests is:
(a) Denial of service attack
(b) Intellectual property theft
(c) Harvesting
(d) Cyber stalking
Answer:
(a) Denial of service attack

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 17 Computer Ethics and Cyber Security

Question 19.
Harassing through online is:
(a) Cyber taking
(b) Cyber stalking
(c) Computer crime
(d) Identity theft
Answer:
(b) Cyber stalking

Question 20.
Stealing tiny amounts of money from each transaction is:
(a) Salami slicing
(b) Spoofing
(c) Harvesting
(d) Malware
Answer:
(a) Salami slicing

Question 21.
Stealing practical or conceptual information developed by another person or company is:
(a) Denial of service attack
(b) Intellectual property theft
(c) Identity theft
(d) Fraud
Answer:
(b) Intellectual property theft

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 17 Computer Ethics and Cyber Security

Question 22.
Manipulating data, like changing the banking records to transfer money to an unauthorized account is:
(a) Stealing
(b) Fraud
(c) Harmful
(d) Theft
Answer:
(b) Fraud

Question 23.
________ is unauthorized copying of software.
(a) Crime function
(b) Cyber stalking
(c) Salami slicing
(d) Piracy
Answer:
(d) Piracy

Question 24.
________ acknowledges the futility of trying to stop people from copying software and instead relies on people’s honesty.
(a) Spyware
(b) Shareware
(c) Copyware
(d) Freeware
Answer:
(b) Shareware

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 17 Computer Ethics and Cyber Security

Question 25.
The expansion of IDS is:
(a) Intrusion Detection Systems
(b) Intrusion Data Systems
(c) Interaction Data Systems
(d) Intermediate Detection Systems
Answer:
(a) Intrusion Detection Systems

Question 26.
The expansion of IRC is:
(a) Interact Relay Chat
(b) Internet Relay Chat
(c) Internet Replay Chat
(d) Interact Replay Chat
Answer:
(b) Internet Relay Chat

Question 27.
A ________ is someone who breaks into someone else computer system, often on a network.
(a) cracker
(b) cyber attack
(c) virus
(d) hacking
Answer:
(a) cracker

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 17 Computer Ethics and Cyber Security

Question 28.
_______ can be installed on the computer automatically when the attachments are opened. .
(a) Spyware
(b) Ransomware
(c) Virus
(d) Worms
Answer:
(a) Spyware

Question 29.
______ is a type of malware that has become increasingly popular among criminals.
(a) Virus
(b) Worms
(c) Ransomware
(d) Spyware
Answer:
(c) Ransomware

Question 30.
__________ is a type of software designed through which the criminals gain illegal access to software and cause damage.
(a) Freeware
(b) Spyware
(c) Malware
(d) Ransomware
Answer:
(c) Malware

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 17 Computer Ethics and Cyber Security

Question 31.
Phishing and pharming are examples of:
(a) computer engineering
(b) network engineering
(c) software engineering
(d) social engineering
Answer:
(d) social engineering

Question 32.
_______ computer crime used to attack, steal user data, including login name, password and credit card numbers.
(a) Farming
(b) Phishing
(c) Crimes
(d) Trojan
Answer:
(b) Phishing

Question 33.
__________ is a scamming practice in which malicious code is installed on a personal computer or server.
(a) Phishing
(b) Pharming
(c) Scam
(d) Scanning
Answer:
(b) Pharming

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 17 Computer Ethics and Cyber Security

Question 34.
______ has been called “Phishing without a trap”.
(a) Cookie
(b) Pharming
(c) MITM
(d) Firewall
Answer:
(b) Pharming

Question 35.
The expansion of MITM:
(a) Money-in-the-middle
(b) Man-in-the-middle
(c) Middle-in-the-man
(d) Middle-in-the-money
Answer:
(b) Man-in-the-middle

Question 36.
The expansion of LAN is:
(a) Local Area Network
(b) Local Air Network
(c) Local Area Node
(d) List Area Network
Answer:
(a) Local Area Network

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 17 Computer Ethics and Cyber Security

Question 37.
The expansion of WAN is:
(a) Wide Area Network
(b) World Area Network
(c) Wide Area Node
(d) World Area Node
Answer:
(a) Wide Area Network

Question 38.
A _________ establishes a block between a trusted internal computer network and entrusted computer outside the network.
(a) cookies
(b) browsers
(c) firewall
(d) scam
Answer:
(c) firewall

Question 39.
A _________ server acts as an intermediary between the end users and a web server.
(a) client
(b) proxy
(c) firewalls
(d) cookies
Answer:
(b) proxy

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 17 Computer Ethics and Cyber Security

Question 40.
_______ typically keep the frequently visited site addresses in its cache which leads to improved response time.
(a) Client servers
(b) MITM
(c) Pharming
(d) Proxy servers
Answer:
(d) Proxy servers

Question 41.
________ is the process of translating the plain text data into random and mangled data.
(a) Encryption
(b) Decryption
(c) Translator
(d) Compiler
Answer:
(a) Encryption

Question 42.
Akey is a piece of information that determines the functional output of a cryptographic algorithm in:
(a) Cryptography
(b) Parameter
(c) Encryption
(d) Filters
Answer:
(a) Cryptography

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 17 Computer Ethics and Cyber Security

Question 43.
There are _________ types of encryption.
(a) two
(b) three
(c) four
(d) five
Answer:
(a) two

Question 44.
_______ encryption uses the same key for both encryption and decryption.
(a) Asymmetric key
(b) Symmetric key
(c) Public key
(d) Private key
Answer:
(b) Symmetric key

Question 45.
_________ key encryption is also called Asymmetric encryption.
(a) Auto
(b) Private
(c) Protected
(d) Public
Answer:
(d) Public

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 17 Computer Ethics and Cyber Security

Question 46.
The _______ key is kept secret by the owner.
(a) symmetric
(b) private
(c) protected
(d) cryptography
Answer:
(b) private

Question 47.
_________ key is either shared amongst authorized recipients.
(a) Public
(b) Protected
(c) Decrypted
(d) Encrypted
Answer:
(a) Public

Question 48.
A __________ in a client-server model of communication is one of the example of Asymmetric Encryption.
(a) digital certificate
(b) client certificate
(c) server certificate
(d) client-server certificate
Answer:
(a) digital certificate

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 17 Computer Ethics and Cyber Security

Question 49.
________ provides assurances of evidence to origin, identity and status of an electronic document.
(a) Hand signature
(b) Cyber signature
(c) Digital signature
(d) Key signature
Answer:
(c) Digital signature

Question 50.
The expansion for EDI is:
(a) Electrical Data Interchange
(b) Electronic Data Interchange
(c) Electrical Data Internet
(d) Electronic Data Internet
Answer:
(b) Electronic Data Interchange

Question 51.
Match the following:

(i) Ethics (a) Electronic data exchange.
(ii) Cyber crime (b) Asymmetric encryption.
(iii) Public key (c) White collar crime
(iv) e commerce (d) What is wrong and what is right.

(a) (i) – (a); (ii) – (b); (iii) – (d); (iv) – (c)
(b) (i) – (b); (ii) – (c); (iii) – (a); (iv) – (d)
(c) (i) – (d); (ii) – (c); (iii) – (b); (iv) – (a)
(d) (i) – (a); (ii) – (c); (iii) – (b)- (iv) – (d)
Answer:
(c) (i) – (d); (ii) – (c); (iii) – (b); (iv) – (a)

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 17 Computer Ethics and Cyber Security

Question 52.
Choose the odd man out:
(a) Honesty
(b) Confidentiality
(c) Responsibility
(d) Hacking
Answer:
(d) Hacking

Question 53.
Choose the correct statement about guidelines of ethics:
(a) Users should not be truthful while using the internet.
(b) Users should share any important information with unauthorised people.
(c) User should not maintain professional conduct.
(d) User should strictly obey the cyber law in computer usage.
Answer:
(d) User should strictly obey the cyber law in computer usage.

Question 54.
Choose the incorrect statement about ethics:
(a) Do not use unauthorised user accounts.
(b) Use pirated software only.
(c) Do not steel other’s passwords.
(d) Do not hack.
Answer:
(b) Use pirated software only.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 17 Computer Ethics and Cyber Security

Question 55.
Assertion (A):
Encryption and decryption are processes that ensure confidentiality that only authorized persons can access the information.
Reason (R):
Encryption is the process of converting the cipher- text back to plain text.
(a) Both A and R are true and R is the correct explanation for A.
(b) Both A and R are true, but R is not the correct explanation for A.
(c) A is true, but R is false.
(d) A is false, but R is true.
Answer:
(c) A is true, but R is false.

Question 56.
Which of the following deals with procedures, practices and values?
(a) Piracy
(b) Programs
(c) Virus
(d) Computer ethics
Answer:
(d) Computer ethics

Question 57.
Commercial programs made available to the public illegally are known as:
(a) freeware
(b) warez
(c) free software
(d) software
Answer:
(b) warez

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 17 Computer Ethics and Cyber Security

Question 58.
Which one of the following are self-repeating and do not require a computer program to attach themselves?
(a) Viruses
(b) Worms
(c) Spyware
(d) Trojans
Answer:
(b) Worms

Question 59.
Which one of the following tracks a user visits a website?
(a) Spyware
(b) Cookies
(b) Cookies
(d) Trojans
Answer:
(b) Cookies

Question 60.
Which of the following is not a malicious program on computer systems?
(a) Worms
(b) Trojans
(c) Spyware
(d) Cookies
Answer:
(d) Cookies

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 17 Computer Ethics and Cyber Security

Question 61.
A computer network security that monitors and controls incoming and outgoing traffic is:
(a) Cookies
(b) Virus
(c) Firewall
(d) Worms
Answer:
(c) Firewall

Question 62.
The process of converting cipher text to plain text is called:
(a) Encryption
(b) Decryption
(c) Key
(d) Proxy server
Answer:
(b) Decryption

Question 63.
e-commerce means:
(a) electronic commerce
(b) electronic data exchange
(c) electric data exchange
(d) electronic commercialization.
Answer:
(a) electronic commerce

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 17 Computer Ethics and Cyber Security

Question 64.
Distributing unwanted e-mail to others is called:
(a) scam
(b) spam
(c) fraud
(d) spoofing
Answer:
(b) spam

Question 65.
Legal recognition for transactions are carried out by:
(a) Electronic Data Interchange
(b) Electronic Data Exchange
(c) Electronic Data Transfer
(d) Electrical Data Interchange
Answer:
(a) Electronic Data Interchange

TN Board 11th Computer Science Important Questions

TN Board 11th Computer Science Important Questions Chapter 16 Inheritance

TN State Board 11th Computer Science Important Questions Chapter 16 Inheritance

Question 1.
What is derived class?
Answer:
A class that inherits from a superclass is called a subclass or derived class

Question 2.
Write the advantages of inheritance.
Answer:
The main advantages of inheritance are:

  1. It represents real world relationships well
  2. It provides reusability of code (Hi) It supports transitivity

Question 3.
What are the different types of inheritance?
Answer:
The different types of inheritance are Single Inheritance, Multiple inheritance, Multilevel inheritance, hybrid inheritance and Hierarchical inheritance.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 16 Inheritance

Question 4.
What is Hybrid inheritance?
Answer:
When there is a combination of more than one type of inheritance, it is known as hybrid inheritance. Hence, it may be a combination of Multilevel and Multiple inheritance or Hierarchical and Multilevel inheritance or Hierarchical, Multilevel and Multiple inheritance.

Question 5.
What is the use of ‘this’ pointer?
Answer:
‘this’ pointer is a constant pointer that holds the memory address of the current object. It identifies the currently calling object. It is useful when the argument variable name in the member function and the data member name are same. To identify the data member it will be given as this→data member name.

Question 6.
Give the use of scope resolution operator in derived class with example.
Answer:
In inheritance the member function of the base class and derived classes have the same name. If the derived class object calls
t1.1oo( );
t2.1oo( );
}
Output:
5 5
5 5

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 16 Inheritance

Question 7.
Give the example for executing the order of constructors and destructors.
Answer:
When an object of the derived class is created, the compiler first calls the base class constructor and then the constructor of the derived class. This is because the derived class is built up on the members of the base class. When the object of a derived class expires first the derived class destructor is invoked followed by the base class destructor.
The order of constructors and destructors.
#include<iostream>
using namespace std;
class base
{
public:
base ( )
{
cout<<“:\nConstructor of base class . . .”;
}
~ base ( )
{
cout<<“\nDestructor of base class . . .”;
}
};
class derived:public base
{
public :
derived( )
{
cout<<“\nConstructor of derived . . .”;
}
~ derived( )
{
cout<<“\nDestructor of derived . . .”;
}
};
class derived1 :public derived
{
public :
derived1( )
{
cout<<“\nConstructor of derived1 . . .”;
}
~ derived1( )
{
cout<<“\nDestructor of derived1 . . .”;
}
};
int main( )
{
derived1 x;
return 0;
}
Output:
Constructor of base class…
Constructor of derived …
Constructor of derived1 …
Destructor of derived1 …
Destructor of derived …
Destructor of base class….

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 16 Inheritance

Question 8.
What is single inheritance? Give example.
Answer:
When derived class inherits only from one base class, it is known as single inheritance. Though the derived class inherits all the members of base class, it has access privillege only to non-private members of the base class.

TN State Board 11th Computer Science Important Questions Chapter 16 Inheritance 1

Program to illustrate single inheritance:
#include<iostream>
using namespace std;
class student //base class
{
private :
char name[20];
int rno;
public:
void acceptname( )
{
cout<<“\n Enter roll no and name . . .”;
cin>>rno>>name;
}
void displayname( )
{
cout«”\n Roll no :-“<<rno;
cout<<“\n Name : -“<<name<<endl;
}
};
class exam : public student
//derived class with single base class
{
public:
int mark1, mark2, mark3, mark4, mark5, mark6, total;
void acceptmark( )
{
cout<<“\n Enter lang, eng, phy, che, esc, mat marks . .”;
cin>>markl>>mark2>>mark3>>mark4> >mark5>>mark6 ;
}
void displaymark( )
{
cout<<“\n\t\t Marks Obtained”;
cout<<“\n Language..”<<mark1;
cout<<“\n English..”<<mark2;
cout<<“\n Physics..”<<mark3;
cout<<“\n Chemistry. ,”<<mark4;
cout<<“\n Comp . sci . . “<<mark5;
cout<<“{\n Maths..”<<mark6;
}
};
int main( )
{
exam e1;
e1.acceptname( ); //calling base class function using derived class object el.acceptmark( ) ;
e1.displayname( ); //calling base class function using derived class object el.displaymark( ) ;
return 0;
}
Output:
Enter roll no and name.. 1201 KANNAN
Enter lang, eng, phy, che, esc, mat marks.. 100 100 100 100 100 100
Roll no:- 1201
Name:- KANNAN
Marks Obtained Language.. 100
English .. 100
Physics .. 100
Chemistry.. 100
Comp.sci.. 100
Maths .. 100

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 16 Inheritance

Question 9.
What is Multiple Inheritance? Give example.
Answer:
When a derived class inherits from multiple base classes it is known as multiple inheritance.
Program to illustrate Multiple inheritance:
The order of inheritance by derived class to inherit the base class is left to right

TN State Board 11th Computer Science Important Questions Chapter 16 Inheritance 2

#include<iostream>
using namespace std;
class student //base class
{
private:
char name[20];
int rno;
public:
void acceptname( )
{
cout<<“\n Enter roll no and name . .”;
cin>>rno>>name;
}
void displayname( )
{
cout<<“\n Roll no :-“<<rno;
cout<<“\n Name :-“<<name<<endl;
;
}
};
class detail //Base class
{
int dd, mm, yy;
char cl [4];
public:
void acceptdob( )
{
cout<<“\n Enter date,month,year in digits and class . .”;
cin>>dd>>mm>>yy>>cl;
}
void displaydob( )
{
cout<<“\n class :-“<<cl;
cout<<“\t\t DOB: “<<dd<<“-” <<mm<<“-“<<yy<<endl;
}
};
class exam : public student, public detail
//derived class with multiple base class
{
public:
int mark1, mark2, mark3, mark4, mark5, mark6, total;
void acceptmark( )
{
cout<<“\n Enter lang, eng, phy, che, esc, mat marks..”;
cin>>mark1>>mark2>>mark3>>mark4>>mark5>>mark6;
}
void displaymark( )
{
cout<<“\n\t\t Marks Obtained”;
cout<<“\n Language..”<<mark1;
cout<<“\n English .. “<<mark2 ;
cout<<“\n Physics . . “<<mark3;
cout<<“\n Chemistry..”<<mark4;
cout<<“\n Comp.sci..”<<mark5;
cout<<“\n Maths..”<<mark6;
}
};
int main( )
{
exam e1;
e1.acceptname( ); //calling base class function using derived class object
e1.acceptdob( ); //calling base
class function using derived class object el.acceptmark( );
e1.displayname( ); //calling base class function using derived class object
e1.displaydob( ); //calling base class function using derived class object
e1.displaymark( );
return 0;
}
Output:
Enter roll no and name .. 1201 MEENA
Enter date,month,year in digits and class..7 12 2001 XII
Enter lang,eng,phy,che,esc,mat marks.. 96 98 100 100 100 100
Roll no :-1201
Name :- MEENA
class :-XII
DOB : 7-12-2001
Marks Obtained
Language.. 96
English .. 98
Physics .. 100
Chemistry.. 100
Comp.sci.. 100
Maths .. 100

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 16 Inheritance

Question 10.
Differentiate Inheritance and polymorphism.
Answer:

Inheritance

 Polymorphism

Inheritance is creating a class that derives its feature from an already existing class. Polymorphism is an interface that can be defined in multiple forms.
It is implemented on the classes. It is implemented on methods/functions.
As inheritance allows a derived class to use the elements and methods defined in the base class, the derived class does not need to define those elements or method it again, So it increases the code reusability and hence, reduce the length of the code. Polymorphism makes it possible for an object to decide what form of the method it wants to invoke at both compile time and run time.
It can be classified as single inheritance, multiple inheritance, multi level inheritance, hierarchical inheritance and hybrid inheritance. It is classified as overloading and overriding.

Question 11.
Consider the following C++ code and answer the question from (i) to (iv).
Answer:
class shop
{
int Id;
char Name[20]
protected:
float Qty;
public:
shop( );
void Enter_details( );
void View_details();
};
class salesman
{
int Dcode;
protected:
char Manager[20]
public:
sale( );
salesman( );
void Enter_details( );
void View_details( );
};
class sale : public shop, private salesman
{ .
char Name[20], Location[20];
public:
sale( );
void Enter_All( );
void View_All( );
};
(i) Which type of inheritance out of the following is illustrated in the above example?
(ii) Write the names of all the data members, which are directly accessible from the member functions class sale().
(iii) Write the names of all the member functions, which are directly accessible by an object of class sale.
(iv) Which will be the order of execution of the constructors, when an object ©f class sale is declared?
Answer:
(i) Multiple Inheritance
(ii) Name, Location, Manager, Qty
(iii) Enter_MI( ),View_MI( ),Enter_Dttails( ), View_Details( )
(iv) shop( ), salesman( ), sale( ).

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 16 Inheritance

Question 12.
Explain the significance of different visibility mode for the program given below.
//Implementation of Single Inheritance using public visibility mode
#include <iostream>
using namespace std;
class Shape
{
private:
int count;
protected:
int width;
int height;
public:
void setWidth(int w)
{
width = w;
}
void setHeight(int h)
{
height = h;
} };
class Rectangle: publicShape
{
public:
int getArea( )
{
return (width * height);
}
};
int main( )
{
Rectangle Rect;
Rect.setWidth(5);
Rect.setHeight(7);
// Print the area of theobject.
cout<< “Total area:”<<Rect.getArea( )<<endl;
return 0;
}
Output:
Total area: 35
The following table contains the members defined inside each class before inheritance.

TN State Board 11th Computer Science Important Questions Chapter 16 Inheritance 3

The following table contains the details of members defined after inheritance.

TN State Board 11th Computer Science Important Questions Chapter 16 Inheritance 4

Suppose the class rectangle is derived with protected visibility then the properties of class rectangle will change as follows:

TN State Board 11th Computer Science Important Questions Chapter 16 Inheritance 5

In case the class rectangle is derived with private visibility mode from its base class shape then the property of class rectangle will change as follows:

TN State Board 11th Computer Science Important Questions Chapter 16 Inheritance 6

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 16 Inheritance

Question 13.
Explain the concept of hybrid inheritance with example.
Answer:
Program to illustrate hybrid inheritance:

TN State Board 11th Computer Science Important Questions Chapter 16 Inheritance 7

#include<iostream>
using namespace std;
class student //base class
{
private:
char Name [20];
int rno;
public:
void acceptname( )
{
cout<<“\n Enter roll no and name . . . “;
cin>>rno>>name;
}
void displacement( )
{
cout«”\n Roll no :-“«rno;
Cout<C’\n Name :-“«name«endl;
class exam : public student I/derived class with single base class
public:
mt markl,mark2,mark3,mark4,
mark5, mark6;
void acceptmark( )
cout<<”\n Enter lang,eng,phy,che,csc,mat marks. .“;
cin>>mark1>>mark2>>mark3>>mark4>>mark5>>mark6;
void displaymark( ) {
cout<<’\n\t\t Marks Obtained”;
cout<<”\n Language. .“<<markl;
cout<<’\n English. .“<<mark2;
cout<<”\n Physics. . “<<mark3;
cout<<”\n Chemistry. . “<<mark4;
cout<C’\n Comp.sci. .“<<markS;
cout<<”\n Maths. . “<<mark6;
}
};
class detail //base class 2
irit dd, mm, yy;
char cl[4];
public:
void acceptdob( )
{
cout<<”\n Enter date,month,year in digits and class. .“;
cin>>dd>>mm>>yy>>cl;
}
void diplaydob( )
{
cout<<”\n class:—”<<cl;
coutc<<”\t\t DOB: “<<dd<<”—”<<mm<<”-”<<yy<<endl;
}
};
class result : public exam,public detail I/inherits from exam ,which itself is a //derived class and also from class detail
{
int total;
public:
void showresult( )
{
total=mark1+mark2+mark3+mark4+mark5+mark6;
cout<<” \nTOTAL MARK SCORED: “<<total ;
}
};
int main( )
{
result r1;
r1.acceptname( ); //calling base class function using derived class object
r1.acceptmark( ); //calling base class which itself is a derived class function using its derived class object •
r1.acceptdob( );
cout<<“\n\n\t\t MARKS STATEMENT”;
r1.displayname( ); //calling base class function using derived class object
r1.displaydob( );
r1.displaymark( ); //calling base class which itself is a derived class function using its derived class object r1.showresult( ); //calling the child class function return 0;
}
Output:
Enter roll no and name.. 1201 RAGU
Enter lang,eng,phy,che,esc,mat marks..96 98 100 100 100 100
Enter date,month,year in digits and class.. 7 12 2001 XII MARKS STATEMENT
Roll no :-1201
Name :-RAGU
class :-XII
DOB : 7-12-2001
Marks Obtained
Language.. 96
English .. 98
Physics .. 100
Chemistry.. 100
Comp.sci.. 100
Maths .. 100
TOTAL MARK SCORED : 594
In the above program the derived class “result” has acquired the properties of class “detail” and class “exam” which is derived from “student”. So this inheritance is a combination of multi level and multiple inheritance and so it is called hybrid inheritance.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 16 Inheritance

Question 14.
Explain the concept of hierarchical inheritance.
Answer:
Program to illustrate Hierarchical inheritance:

TN State Board 11th Computer Science Important Questions Chapter 16 Inheritance 8

#include<iostream>
using namespace std;
class student //base class
{
private:
char name[20];
int rno;
public:
void acceptname( )
{
cout<<“\n Enter roll no and name . . .”;
cin>>rno>>name;
}
void displayname( )
{
cout<<“\n Roll no:-“<<rno;
cout<<“\n Name: -“<<name<<endl;
} .
};
class qexam : public student //derived class with single base class
{
public:
int mark1, mark2, mark3, mark4, mark5, mark6;
void acceptmark( )
{
cout<<“\n Enter lang, eng, phy, che, esc, mat marks for quarterly exam..”; cin>>mark1>>mark2>>mark3>>mark4>>mark5>>mark6;
}
void displaymark( )
{
cout<<“\n\t\t Marks Obtained in quarterly”;
cout<<“\n Language. . “<<mark1;
cout<<“\n English ..”<<mark2;
cout<<“\n Physics ..”<<mark3;
cout<<“\n Chemistry.. “<<mark4;
cout<<“\n Comp. sci . . “<<mark5;
cout<<“\n Maths..”<<mark6;
}
};
class exam : public student //derived class with single base class
{
public:
int mark1, mark2, mark3, mark4, mark5, mark6;
void acceptmark( )
{
cout<<“\n Enter lang, eng, phy, che, esc, mat marks for halfyearly exam..”; cin>>mark1>>mark2>>mark3>>mark4>>mark5>>mark6;
}
void displaymark( )
{
cout<<“\n\t\t Marks Obtained in Halfyearly”;
cout<<“\n Language.. “<<mark1;
cout<<“\n English.. “<<mark2;
cout<<“\n Physics..”<<mark3;
cout<<“\n Chemistry.. “<<mark4;
cout<<“\n Comp. sci .. “4<mark5;
};
int main( )
{
qexam q1;
hexam h1;
ql.acceptname ( ); //calling base class function using derived class object
ql.acceptmark( ); //calling base class function
hi.acceptname( ); //calling base class function using derived class object
hi.displayname( );//calling base class function using derived class object .
hi.acceptmark( ) ;
hi.displaymark( ); //calling base class function using its //derived class object
return 0;
}
Output:
Enter roll no and name .. 1201 KANNAN
Enter lang,eng,phy,che,esc,mat marks for quarterly exam.. 95 96 100 98 100 99
Roll no :-1201
Name :-KANNAN
Marks Obtained in quarterly
Language.. 95
English .. 96
Physics .. 100
Chemistry.. 98
Comp.sci.. 100
Maths .. 99
Enter roll no and name .. 1201 KANNAN
Enter lang,eng,phy,che,esc,mat marks for halfyearly exam..
96 98 100 100 100 100 Roll no :-1201
Name:- KANNAN .
Marks Obtained in Halfyearly
Language.. 96
English .. 98
Physics .. 100
Chemistry.. 100
Comp.sci.. 100
Maths .. 100
In the above program, the class “qexam” and “hexam” are derived from class “student”. Here for single base class more than one derived class. So this comes under hierarchical inheritance.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 16 Inheritance

Question 15.
Explain the concept of multilevel inheritance. Illustrate with an example.
Answer:
In multilevel inheritance, the level of inheritance can be extended to any number of level depending upon the relation. Multilevel inheritance is similar to relation between Grand Father, Father and child.
Program to illustrate multilevel inheritance:

TN State Board 11th Computer Science Important Questions Chapter 16 Inheritance 9

#include<iostream>
using namespace std;
class student //base class
{
private: char name[20]; int rno; public:
void acceptname( )
cout<<“\n Enter roll no and name..”;
cin>>rno>>name;
}
void displayname( )
{
Multilevel Inheritance
cout<<“\n Roll no:-“<<rno;
cout<<“\n Name :-“<<name<<endl;
}
};
class exam : public student //derived class with single base class
{
public:
int mark1, mark2, mark3, mark4, mark5, mark6;
void acceptmark( )
{
cout<<“\nEnter lang,eng,phy,che,esc,mat marks..”;
cin>>markl>>mark2>>mark3>>mark4>>mark5>>mark6;
}
void displaymark( )
{
cout<<“\n\t\t Marks Obtained”;
cout<<“\n Language. . .”<<mark1;
cout<<“\n English…”<<mark2;
cout<<“\n Physics… “<<mark3;
cout<<“\n Chemistry. .. “<<mark4;
cout<<“\n Comp.sci. . . “<<mark5;
cout«”\n Maths… “<<mark6;
}
} ;
class result : public exam
{
int total; public
void showresult( )
{
total=mark1+mark2+mark3+mark4 +mark5+mark6;
cout<<“\nTOTAL MARK SCORED :” «total;
}
};
int main( )
{
result r1;
rl.acceptname( ); //calling base class function using derived class object
rl.acceptmark( ); //calling base class function which itself is a derived
// class function using its derived class object
rl.displayname( ); //calling base class function using derived class object
rl.displaymark( ); //calling base class function which itself is a ‘ derived
//class function using its derived class object rl.showresult(); //calling the child class function return 0;
}
Output:
Enter roll no and name .. 1201 SARATHI
Enter lang,eng,phy,che,esc,mat marks.. 96 98 100 100 100 100
Roll no :-1201
Name .–SARATHI
Marks Obtained
Language… 96
English… 98
Physics … 100
Chemistry… 100
Comp.sci… 100
Maths… 100
TOTAL MARK SCORED: 594
In the above program, class “result” is derived from class “exam” which itself is derived from class student.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 16 Inheritance

Question 16.
All the banks operating in India are controlled by RBI. RBI has set certain guidelines (e.g. minimum interest rate, minimum balance allowed, maximum withdrawal limit etc.,) for all banks to follow. For example, suppose RBI has set minimum interest rate applicable to a saving bank account to be 5% annually; however, banks are free to use 5% interest rate or to set any rates above it.

Write a program to implement bank functionality in the above scenario. Note: Create few classes namely Customer, Account, RBI (Base Class) and few derived classes (SBI, ICICI, PNB, IOB etc.,). Assume and implement required member variables and functions in each class.
Hint:
class Customer
{
//Personal Details…
// Few functions…
}
class Account
{
// Account Detail…
//Few functions…
}
}
class RBI
{
Customer c;//hasA relationship
Account a; //hasA relationship
Public double GetlnterestRate( ) { }
Public double GetWithdrawalLimit( ) { }
}
class SBI: public RBI
{
//Use RBI functionality or define own functionality.
}
class ICICI: public RBI
{
//Use RBI functionality or define own functionality.
}
class IOB: public RBI
{
//Use RBI functionality or define own functionality.
}
Answer:
class customer
{
char c_name[20];
char c_address[30];
int c_phoneno;
public:
void get_customerinfo( )
{
cout<<“\nEnter customer name”<<endl; cin>>c name;
cout<<“\n Enter Customer Address”<<endl; cin>>c_address;
cout<<“\n Enter Customer phone No”<<endl;
cin>>c_phoneno ;
}
void display_customerinfo( )
{
cout<<“Displaying Customer information”<<endl;
cout<<“Custo.mer Name:” <<c_name;
cout<<“Customer Address:” <<c_address;
cout<<“Customer Phone No:” <<cphoneno;
}
class Account
{
char b_name[20];
int account_no;
float balance;
public:
void get_accountinfo ( )
{
_cout<<“Enter Bank Name”<<endl;
cin>>b_name;
cout<<“Enter Account Number”<<endl;
cin>>account_no;
}
};
};
class RBI:Public customer
{
float balance;
public:
double get_withdrawal limit( )
{
float w_amount;
cout<<“\n Enter with draw amount”<<endl;
if(balance-w_amount<1000)
{
cout<<“With draw amount is not possible”<<endl ;
}
balance=balance-w_amount;
}
double interestrate ( )
{
float interest;
interest=(balance*5)/100;
balance=balance+interest;
}
};
class SBI : public RBI
{
int amount;
public: .
SBI(int a)
{
amount = a;
}
int getBalance( )
{
return amount;
}
};
class ICICI : public RBI
{
int amount;
public:
ICICI (int a)
{
amount = a;
}
int getBalance( )
{
return amount;
}
};
class IOB : public RBI
{
int amount;
public:
IOB(int a)
{
amount = a;
}
int getBalance( )
{
return amount;
}
} ;

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 16 Inheritance

Question 17.
Write a class for a class Stock.
(i) – Each Stock has a data member which holds the net price, and a constructor which sets this price.
– Each Stock has a method get_Price(), which calculates and returns the gross price (the gross price includes VAT at 21%).
Answer:
class Stock
{
private:
float netprice;
public:
Stock (float P)
{
netprice=P;
}
void get_price( )
{
float grossprice, tax;
tax=netprice*21/100;
grossprice=netprice+tax;
cout<<“\n Net Price”<<netprice<<endl;
cout<<“\nTax Amount: “<<tax<<endl;
cout<<“Gross Price: “<<grossprice;
}
};

(ii) Write 2 classes which inherit from the general Stock class, of type Notebook and Book.
– The gross price for Notebook includes tax at 21%.
– Books are free of tax, so the gross price is unchanged from the net price, and you will need to re-define the getGrossPrice method in this class.
Answer:
class Stock
{
public:
float netprice;
Stock (float P)
{
netprice=P;
}
};
class Book : public Stock
{
void get_price()
{
float grossprice,tax; tax=netprice*21/100;
grossprice=netprice+tax;
cout<<“\n Net Price”<<netpr ice<<endl;
cout<<“\nTax Amount: “<<tax<<endl;
cout<<-“Gross Price: “<<grossprice;
}
};
class notebook : public Stock
{
void get_price( )
{
float grossprice;
grossprice=netprice;
cout<<“Gross Price:”<<grossprice;
}

(iii) Write a program which does the following;
(a) Declare an array of 10 objects to Stock.
(b) Declare a object to a Book and an object to Notebook.
(c) Ask the user to enter details of the book, and of the Notebook item.
(d) Check your method getGrossPrice works correctly with each type and then display the result.
Answer:
#include<iostream>
using namespace std;
class stock
{
int Bookcode;
float qty;
float price;
void totalcost( )
{
float tcost;
tcost=price*qty;
cout<<tcost;
}
public:
void bookdetails( )
{
cout<<“Enter the Quantity”<<endl;
cin>>qty;
cout<<“Enter Price”<<endl; .
cin>>price; display( );
}
void display( )
{
cout<<“\nTotal Cost is”<<endl;
totalcost ( );
}
}s[10] ;
int main( )
{
Stock bo,no;
cout<<“\nBook Details”<<endl;
bo.bookdetails( );
cout<<“\nNote book Details”<<endl;
no.bookdetails( );
return 0;
}

Question 18.
What is inheritance?
Answer:
Inheritance is an important feature of object oriented programming used for code reusability. It is a process of creating new classes called derived cljisses, from the existing or base classes. Inheritance allows to inherit all the code (except declared as private) of one class to another class.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 16 Inheritance

Question 19.
What is a base class?
Answer:
A class that is used as the basis for inheritance is called a super class or base class.

Question 20.
Why derived class is called power packed class?
Answer:
The derived class is a power packed class, as it can add additional attributes and methods and thus enhance its functionality.

Question 21.
In what, multilevel and multiple inheritance differ though both contains many base class?
Answer:

Multilevel inheritance

 Multiple inheritance

The level of inheritance can be extended to any number of level depending upon the relation. Multilevel inheritance is similar to relation between Grand Father, Father and child. The base classes do not have any relationship between them. However the derived class acquires all the properties of both the class.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 16 Inheritance

Question 22.
What is the difference between public and private visibility mode?
Answer:
When a base class is inherited with public visibility mode, the protected members of the base class will be inherited as protected members of the derived class and the public members of the base class will be inherited as public members of the derived class.
When a base class is inherited with private visibility mode the public and protected members of the base class become ‘private’ members of the derived class.

Question 23.
What are the points to be noted while deriving a new class?
Answer:
(i) The keyword class has to be used.
(ii) The name of the derived class is to be given after the keyword class.
(iii) A single colon
(iv) The type of derivation (the visibility mode), namely private* public or protected. If no visibility mode is specified, then by default the visibility mode is considered as private.
(v) The names of all base classes (parent classes) separated by comma.
class derived_class_
name:visibility_mode base_ class_name
{
// members of derivedclass
};

Question 24.
What is difference between the members present in the private visibility mode and the members present in the public visibility mode?
Answer:
When a base class is inherited with public visibility mode, the protected members of the base class will be inherited as protected members of the derived class and the public members of the base class will be inherited as public members of the derived class.
When a base class is inherited with private visibility mode the public and protected members of the base class become ‘private’ members of the derived class.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 16 Inheritance

Question 25.
What is the difference between polymorphism and inheritance though are used for reusability of code?
Answer:
Polymorphism:
Allows object to decide which Inheritance: Allows a derived class to use the elements and methods defined in the base class. The derived class does not need to define those elements or methods in it again. So it increases the code reusability and hence reduces the length of the code.

Inheritance:
Allows a derived class to use the elements and methods defined in the base class. The derived class does not need to define those elements or methods in it again. So it increases the code reusability and hence reduces the length of the code.

Question 26.
What do you mean by overriding?
Answer:
When a derived class member function has the same name as that of its base class member function, the derived class member function shadows/hides the base class’s inherited function. This situation is called function overriding and this can be resolved by giving the base class name followed by :: and the member function name.

Question 27.
Write some facts about the execution of constructors and destructors in inheritance.
Answer:
(i) Base class constructors are executed first, before the derived class constructors execution.
(ii) Derived class cannot inherit the base class constructor but it can call the base class constructor by using,
Base_case name: :base_class_constructor() in derived class definition.
(iii) If there are multiple base classes, then it starts executing from the left most base class.
(iv) In multilevel inheritance, the constructors will be executed in the order of inheritance.
(v) Destructors are executed in the reverse order of inheritance.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 16 Inheritance

Question 28.
Explain the different types of inheritance.
Answer:
There are different types of inheritance viz., Single inheritance, Multiple inheritance, Multilevel
inheritance, Hybrid inheritance and Hierarchical inheritance.
(i) Single Inheritance:
When a derived class inherits only from one base class, it is known as single inheritance.

(ii) Multiple Inheritance:
When a derived class inherits from multiple base classes it is known as multiple inheritance.

(iii) Hierarchical inheritance:
When more than one derived classes are created from a single base class, it is known as Hierarchical inheritance.

(iv) Multilevel Inheritance:
The transitive nature of inheritance is itself reflected by this form of inheritance. When a class is derived from a class which is a derived class – then it is referred to as multilevel inheritance.

(iv) Hybrid inheritance:
When there is a combination of more than one type of inheritance, it is known as hybrid inheritance. Hence, it may be a combination of Multilevel and Multiple inheritance or Hierarchical and Multilevel inheritance or Hierarchical, Multilevel and Multiple inheritance.

TN State Board 11th Computer Science Important Questions Chapter 16 Inheritance 10

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 16 Inheritance

Question 29.
Explain the different visibility mode through pictorial representation.
Answer:
An important feature of Inheritance is to know which member of the base class will be acquired by the derived class. This is done by using visibility modes. The accessibility of base class by the derived class is controlled by visibility modes. The three visibility modes are private, protected and public. The default visibility mode is private. Though visibility modes and access specifiers look similar, the main difference between them is Access specifiers control the accessibility of the members with in the class where as visibility modes control the access of inherited members with in the class.

Private visibility mode:
When a base class is inherited with private visibility mode, the public and protected members of the base class become ‘private’ members of the derived class.

TN State Board 11th Computer Science Important Questions Chapter 16 Inheritance 11

Protected visibility mode:
When a base class is inherited with protected visibility mode the protected and public members of the base class become ‘protected members’ of the derived class.

TN State Board 11th Computer Science Important Questions Chapter 16 Inheritance 12

Public visibility mode:
When a base class is inherited with public visibility mode, the protected members of the base class will be inherited as protected members of the derived class and the public members of the base class will be inherited as public members of the derived class.

TN State Board 11th Computer Science Important Questions Chapter 16 Inheritance 13

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 16 Inheritance

Question 30.
#include<iostream>
#include<string.h>
#include<stdio.h>
using name spacestd;
class publisher
{
char pname[15];
char hoffice[15];
char address[25];
double turnover;
protected:
char phone[3][10];
void register( );
public:
publisher( );
~publisher( );
void enter data( );
void disp data( );
};
class branch
class author: public branch, publisher
{
intaut_code;
charaname[20];
float income;
public:
author( );
~author( );
voidgetdata( );
voidputdata( );
};
Answer the following questions based on the above given program:
3.1 Which type of Inheritance is shown in the program?
3.2 Specify the visibility mode of base classes.
3.3 Give the sequence of Constructor/ Destructor Invocation when object of class author is created.
3.4 Name the base class(/es) and derived class (/es).
3.5 Give number of bytes to be occupied by the object of the following class:
(i) publisher
(ii) branch
(iii) author
3.6 Write the names of data members accessible from the object of class author.
3.7 Write the names of all member functions accessible from the object of class author.
3.8 Write the names of all members accessible from member functions of class author.
Answer:
3.1. Multiple Inheritance
3.2. Visibility mode publishes and Branch is public.

TN State Board 11th Computer Science Important Questions Chapter 16 Inheritance 14

3.3.
publisher ( )
branch ( )
author ( )
~ author ( )
~ branch ( )
~ publisher ( )

3.4
Base classes: publisher, branch
Derived class: author

3.5
(i) publisher

TN State Board 11th Computer Science Important Questions Chapter 16 Inheritance 15

(ii) branch

TN State Board 11th Computer Science Important Questions Chapter 16 Inheritance 16

(iii) author

TN State Board 11th Computer Science Important Questions Chapter 16 Inheritance 17

3.6. DataMember

publisher::phone[3] [10]
branch::bphone[2][10]
branch::no_of_emp
author::aut_code
author::name[20]
author::income

3.7. Member functions
publisher::register( )
publisher::enterdata( )
publisher::dispdata( )
branch::havedata( )
branch::givedata( )
author::getdata( )
author::putdata( )

3.8

TN State Board 11th Computer Science Important Questions Chapter 16 Inheritance 18

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 16 Inheritance

Question 31.
Consider the following C++ code and answer the questions.
class Personal
{
int Class,Rno;
char Section;
protected:
char Name[20];
public: personal( );
void pentry( );
void Pdisplay( );
};
class Marks:private Personal
{
float M{5};
protected:
char Grade[5];
public:
Marks( );
void M_entry( );
void M_display( );
};
class Result:
public Marks
{
float Total, Agg;
public:
char FinalGrade, Commence[20];
Result( );
void R_calculate( ) ;
void R_display( );
}:
4.1 Which type of Inheritance is shown in the program?
4.2 Specify the visibility mode of base classes.
4.3 Give the sequence of Constructor/ Destructor Invocation when object of class Result is created.
4.4 Name the base class(/es) and derived class (/es).
4.5 Give number of bytes to be occupied by the object of the following class:
(i) Personal (ii) Marks (iii) Result
4.6 Write the names of data members accessible from the object of class Result.
4.7 Write the names of all member functions accessible from the object of class Result.
4.8 Write the names of all members accessible from member functions of class Result.
Answer:
4.1. Multilevel Inheritance
4.2. Private for Personal Public for marks
4.3.
constructors
Personal( )
Marks( )
Result( )
Default destructors are executed
4.4.
Base class: Personal
Derived class: Marks, Result
4.5.
(i) Personal

TN State Board 11th Computer Science Important Questions Chapter 14 Classes and Objects 1

(ii) Marks

TN State Board 11th Computer Science Important Questions Chapter 16 Inheritance 20

(iii) Result

TN State Board 11th Computer Science Important Questions Chapter 16 Inheritance 21

4.6
Result::Total
Result::Agg
Marks::Grade[5]

4.7.
Rcalculate( )
RDisplay( )
Mentry( )
Mdisplay( )

4.8

DataMembers

Member functions

Result: :TotalResult: :Rcalculate( )
Result:: AggResult: :RDisplay( )
Marks::Grade[5]Marks::Mentry( )
Result::FinalGradeMarks:: Mdisplay( )
Result::Commence[20]

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 16 Inheritance

Question 32.
Write the output of the following program.
#include<iostream>
using namespace std;
class A
{
protected:
int x;
public:
void show( )
{
cout<<“x =”<<x<<endl;
}
A( )
{
cout<<endl<<“l am class A”<<endl;
}
~A( )
{
cout<<endl<<“Bye”;
}
};
class B:
public A
{
{
protected:
int y;
public:
B(int x, int y)
{
this→x = x; //this → is used to denote the objects datamember
this->y = y; //this → is used to denote the objects datamember
}
B( )
{
cout<<endl<<“l am class B”<<endl;
}
~B( )
{
cout<<endl<<“Bye”;
}
void show ( )
{
cout<<“x=” <<x<<endl;
cout«”y=”<<y<<endl;
}
};
int main( )
{
A objA;
B objB(30, 20);
objB.show( );
}
return 0;
}
Answer:
Output:
I am class A
I am class A
x = 30
y = 20
Bye
Bye
Bye

Question 33.
Debug the following program.
Output
————
15
14
13
Program :
————
%include(iostream.h)
#include<conio.h>
Class A
{
public;
int a1,a2:a3;
Void getdata[ ]
{
a1=15;
a2=13;
a3=13;
}
}
Class B:: public A( )
{
PUBLIC
voidfunc( )
{
int b1:b2:b3;
A::getdata[ ];
b1=a1;
b2=a2;
a3=a3;
cout<<bl<<‘\t'<<b2<<‘t\'<<b3;
}
void main( )
{
clrscr( )
B der;
derl:func( );
getch( );
}
Answer:
#include<iostream>
#include<conio.h>
using namespace std;
class A
{
public:
int a1,a2,a3;
void getdata( )
{
a1=15;
a2=14;
a3=13;
}
classBrpublic A
{
public:
void function ( )
{
int b1,b2,b3;
A: :getdata( );
b1=a1;
b2=a2;
b3=a3;
cout<<b1<<“\n”<<b2<<“\n”<<b3;
}
};
int main ( )
{
B der;
der.func( )
return 0;
}

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 16 Inheritance

Choose the correct answer:

Question 1.
The most important features of OOP is:
(a) Encapsulation
(b) Abstraction
(c) Polymorphism
(d) Inheritance
Answer:
(d) Inheritance

Question 2.
A class that inherits from a superclass is called a:
(a) super class
(b) derived class
(c) abstract class
(d) finite class
Answer:
(b) derived class

Question 3.
_________ allows us to inherit all the code of one class to another class.
(a) Inheritance
(b) Polymorphism
(c) Data hiding
(d) Overloading
Answer:
(a) Inheritance

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 16 Inheritance

Question 4.
The class to be inherited is called ______ class.
(a) base
(b) sub
(c) abstract
(d) normal
Answer:
(a) base

Question 5.
When a derived class inherits only from one base class, it is known as ______ inheritance.
(a) Single
(b) Multiple
(c) Multilevel
(d) Hybrid
Answer:
(a) Single

Question 6.
The _________ class is a power packed class, as it can add additional attributes and methods.
(a) derived
(b) base
(c) first
(d) last
Answer:
(a) derived

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 16 Inheritance

Question 7.
When a derived class inherits from multiple base classes it is known as _________ inheritance.
(a) Multiple
(b) Multilevel
(c) Hybrid
(d) Single
Answer:
(a) Multiple

Question 8.
When more than one derived classes are created from a single base class, it is known as _________ inheritance.
(a) One
(b) Common
(c) Hybrid
(d) Hierarchical
Answer:
(d) Hierarchical

Question 9.
When there is a combination of more than one type of inheritance, it is known as _________ inheritance.
(a) Hybrid
(b) Multiple
(c) Multilevel
(d) Single
Answer:
(a) Hybrid

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 16 Inheritance

Question 10.
While defining a derived class, the ______ class should identify the class from which it is derived.
(a) abstract
(b) common
(c) proper
(d) derived
Answer:
(d) derived

Question 11.
The name of the derived class is to be given after the keyword:
(a) function
(b) variables
(c) class
(d) object
Answer:
(c) class

Question 12.
A __________ is used between base class and derived class.
(a) ,
(b) :
(c) ;
(d) ::
Answer:
(b) :

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 16 Inheritance

Question 13.
The names of all base classes are separated by:
(a) comma
(b) colon
(c) semi-colon
(d) braces
Answer:
(a) comma

Question 14.
Though the derived class inherits all the members of base class, it has access privilege only to _________ members of the base class.
(a) private
(b) non-private
(c) finite
(d) visible
Answer:
(b) non-private

Question 15.
In _______ inheritance the level of inheritance can be extended to any number of level depending upon the relation.
(a) multiple
(b) single
(c) hybrid
(d) multilevel
Answer:
(d) multilevel

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 16 Inheritance

Question 16.
The relation between grandfather, father and child is established in:
(a) polymorphism
(b) abstraction
(c) multilevel inheritance
(d) single inheritance
Answer:
(c) multilevel inheritance

Question 17.
A class without any declaration will have ______ byte size.
(a) 1
(b) 2
(c) 3
(d) 4
Answer:
(a) 1

Question 18.
In a class x{ }; X occupies byte.
(a) 2
(b) 4
(c) 3
(d) 1
Answer:
(d) 1

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 16 Inheritance

Question 19.
The accessibility of base class by the derived class is controlled by ______ modes.
(a) visibility
(b) common
(c) derived
(d) base
Answer:
(a) visibility

Question 20.
There are ________ visibility modes.
(a) 4
(b) 3
(c) 2
(d) 5
Answer:
(b) 3

Question 21.
The default visibility mode is:
(a) auto
(b) static
(c) private
(d) protected
Answer:
(c) private

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 16 Inheritance

Question 22.
When a base class is inherited with protected visibility mode the protected and public members of the base class become ________ members of the derived class.
(a) public
(b) protected
(c) private
(d) static
Answer:
(b) protected

Question 23.
When classes are inherited with public, protected or private, the private members of the base class are:
(a) inherited
(b) not inherited
(c) not visible
(d) none
Answer:
(b) not inherited

Question 24.
When you derive the class from an existing base class, it may inherit the properties of the base class based on its ________ mode.
(a) visibility
(b) static
(c) auto
(d) extern
Answer:
(a) visibility

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 16 Inheritance

Question 25.
________ inheritance should be used when you want the features of the base class to be available to the derived class but not to the classes that are derived from the derived class.
(a) Private
(b) Public
(c) Protected
(d) Single
Answer:
(a) Private

Question 26.
________ inheritance should be used when features of base class to be available only to the derived class members but not to the outside world.
(a) Unprotected
(b) Protected
(c) Private
(d) Multiple
Answer:
(b) Protected

Question 27.
________ inheritance can be used when features of base class to be available the derived class members and also to the outside world.
(a) Public
(b) Multilevel
(c) Single
(d) Protected
Answer:
(a) Public

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 16 Inheritance

Question 28.
The _______ are executed in the reverse order.
(a) constructors
(b) derived class
(c) base class
(d) destructors
Answer:
(d) destructors

Question 29.
Base class constructors are executed _______ before the derived class constructors execution.
(a) first
(b) middle
(c) last
(d) none
Answer:
(a) first

Question 30.
Derived class _______ the base class constructor but it can call the base class constructor.
(a) can inherit
(b) cannot inherit
(c) cannot call
(d) none
Answer:
(b) cannot inherit

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 16 Inheritance

Question 31.
If there are multiple base classes, then its start executing from the _______ most base class.
(a) left
(b) top
(c) right
(d) bottom
Answer:
(a) left

Question 32.
In _______ inheritance, the constructors will be executed in the order of inheritance.
(a) single
(b) multilevel
(c) hybrid
(d) hierarchical
Answer:
(b) multilevel

Question 33.
Derived class can call the base class constructor by using:
(a) :
(b) .
(c) ;
(d) ::
Answer:
(d) ::

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 16 Inheritance

Question 34.
size of derived class object = _______ + size of all data members in derived class.
(a) size of all base class data members
(b) size of only public base class data members
(c) size of only private base class data members
(d) size of only protected base class data members
Answer:
(a) size of all base class data members

Question 35.
The public members can be accessed by the object of the derived class similar to its own members in:
(a) public
(b) auto
(c) static
(d) protected
Answer:
(a) public

Question 36.
In inheritance the _________ have higher priority.
(a) base class member function
(b) derived class member function
(c) constructor member function
(d) destructor member function
Answer:
(b) derived class member function

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 16 Inheritance

Question 37.
Shadowing base class function in derived class can be resolved using:
(a) ::
(b) :
(c) ,
(d) <
Answer:
(a) ::

Question 38.
_________ pointer is a constant pointer that holds the memory address of the current object.
(a) this
(b) for
(c) if
(d) else
Answer:
(a) this

Question 39.
In case of inheritance where both base and derived class are having constructors, when an object of derived class is created then:
(a) constructor of derived class will be invoked first.
(b) constructor of base class will be invoked first.
(c) constructor of derived class will be executed first followed by base class.
(d) constructor of base class will be executed first followed by derived class.
Answer:
(d) constructor of base class will be executed first followed by derived class.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 16 Inheritance

Question 40.
In case of inheritance where both base and derived class are having constructor and destructor, then which of the following are true?
(i) Constructors are executed in their order of derivation.
(ii) Constructors are executed in reverse order of derivation.
(iii) Destructors are executed in their order of derivation.
(iv) Destructors are executed in reverse order of derivation.
(a) Only (ii), (iv)
(b) Only (i), (iii)
(c) Only (i), (iv)
(d) Only (ii), (iii)
Answer:
(c) Only (i), (iv)

Question 41.
class x, class y and class z are derived from class BASE. This is _______ inheritance.
(a) Multiple
(b) Multilevel
(c) Hierarchical
(d) Single
Answer:
(c) Hierarchical

Question 42.
The _____ inherits some or all of the properties of the class.
(a) base, derived
(b) derived, base
(c) derived, initial
(d) base, final
Answer:
(b) derived, base

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 16 Inheritance

Question 43.
State whether the following statements about inheritance are true or false.
(i) A public member of a class can be accessed by its own objects using the dot operator.
(ii) While inheriting, the private members of the base class will never become the members of its derived class.
(a) true, false
(b) false, true
(c) true, true
(d) false, false
Answer:
(c) true, true

Question 44.
In C++ program, Inheritance allows:
(a) Class Re-usability
(b) Creating a hierarchy of classes
(c) Extendibility
(d) All
Answer:
(d) All

Question 45.
Match the following:

(i) Single Inheritance (a) combination of more than one type of Inheritance
(ii) Hierarchical Inheritance (b) Inherits only from one base class
(iii) Multilevel Inheritance (c) More than one derived classes are created.
(iv) Hybrid Inheritance (d) Transitive nature of inheritance.

(a) (i) – (b); (ii) – (c); (iii) – (d); (iv) – (a)
(b) (i) – (c); (ii) – (d); (iii) – (a); (iv) – (b)
(c) (i) – (d); (ii) – (a); (iii) – (b); (iv) – (c)
(d) (i) – (c); (ii) – (d); (iii) – (b); (iv) – (a)
Answer:
(a) (i) – (b); (ii) – (c); (iii) – (d); (iv) – (a)

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 16 Inheritance

Question 46.
Assertion (A):
The accessibility of base class by the derived class is controlled by visibility modes.
Reason (R):
The default visibility mode is public.
(a) Both A and R are true and R is the correct explanation for A.
(b) Both A and R are true, but R is not the correct explanation for A.
(c) A is true, but R is false.
(d) A is false, but R is true.
Answer:
(c) A is true, but R is false.

Question 47.
Which of the following is the process of creating new classes from an existing class?
(a) Polymorphism
(b) Inheritance
(c) Encapsulation
(d) Super class
Answer:
(b) Inheritance

Question 48.
Which of the following derives a class student from the base class school?
(a) school: student
(b) class student: public school
(c) student: public school
(d) class school: public student
Answer:
(b) class student: public school

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 16 Inheritance

Question 49.
The type of inheritance that reflects the transitive nature is:
(a) Single Inheritance
(b) Multiple Inheritance
(c) Multilevel Inheritance
(d) Hybrid Inheritance
Answer:
(c) Multilevel Inheritance

Question 50.
Which visibility mode should be used when you want the features of the base class to be available to the derived class but not to the classes that are derived from the derived class?
(a) Private
(b) Public
(c) Protected
(d) All of these
Answer:
(a) Private

Question 51.
Inheritance is process of creating new class from:
(a) base class
(b) abstract
(c) derived class
(d) function
Answer:
(a) base class

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 16 Inheritance

Question 52.
A class is derived from a class which is a derived class itself, then this is referred to as:
(a) multiple inheritance
(b) multilevel inheritance
(c) single inheritance
(d) double inheritance
Answer:
(b) multilevel inheritance

Question 53.
Which amongst the following is executed the order of inheritance?
(a) Destructor
(b) Member function
(c) Constructor
(d) Object
Answer:
(c) Constructor

Question 54.
Which of the following is true with respect to inheritance?
(a) Private members of base class are inherited to the derived class with private.
(b) Private members of base class are not inherited to the derived class with private accessibility.
(c) Public members of base class are inherited but not visible to the derived class.
(d) Protected members of base class are inherited but not visible to the outside class.
Answer:
(c) Public members of base class are inherited but not visible to the derived class.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 16 Inheritance

Question 55.
Based on the following class declaration answer the questions (from 55.1 to 55.4).
class vehicle
{
int wheels;
public:
void input_data (float,float) ;
void output_data( );
protected:
int passenger;
} ;
class heavy_vehicle :
protected vehicle
{
int diesel_petrol;
protected:
int load;
protected:
int load;
public:
voidread_data (float, float)
voidwrite_data( );
};
class bus:
private heavy_vehicle
{
charTicket[20];
public:
voidfetch_data(char);
voiddisplay_data( );
};
};

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 16 Inheritance

Question 55.1.
Which is the base class of the class heavyvehicle?
(a) bus
(b) heavyvehicle
(c) vehicle
(d) both (a) and (c)
Answer:
(c) vehicle

Question 55.2.
The data member that can be accessed from the function displaydataQ.
(a) passenger
(b) load
(c) ticket
(d) all of these
Answer:
(d) all of these

Question 55.3.
The member function that can be accessed by an objects of bus Class is:
(a) input_data( ),
(b) read_data( ),output_data( )write_data( )
(c) fetch_data( )
(d) all of these display_data( )
Answer:
(d) all of these display_data( )

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 16 Inheritance

Question 55.4
The member function that is inherited as public by Class Bus:
(a) input_data( ),
(b) read_data( ), output_data( )write_data( )
(c) fetch_data( )
(d) all of these display_data( )
Answer:
(d) all of these display_data( )

Question 56.
class x
{
int a;
public :
x( )
{ }
};
class y
{ x x1;
public :
y( )
{ }
};
class z : public y,x
{
int b;
public:
z( )
{ }
} z1;

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 16 Inheritance
What is the order of constructor for object z1 to be invoked?
(a) z,y,x,x
(b) x,y,z,x
(c) y,x,x,z
(d) x,y,z
Answer:
(d) x,y,z

TN Board 11th Computer Science Important Questions

TN Board 11th Computer Science Important Questions Chapter 15 Polymorphism

TN State Board 11th Computer Science Important Questions Chapter 15 Polymorphism

Question 1.
Define polymorphism.
Answer:
The word polymorphism means many forms (poly – many, morph – shapes). Polymorphism is the ability of a
message or function to be displayed in more than one form.

Question 2.
In C++ how the polymorphism is achieved.
Answer:
In C++, polymorphism is achieved through function overloading and operator overloading.

Question 3.
What does the overloaded function refers to?
Answer:
An ‘overloaded function’ refers to a function having more than one distinct meaning.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 15 Polymorphism

Question 4.
Define overload resolution.
Answer:
The process of selecting the most appropriate overloaded function or operator is called overload resolution.

Question 5.
What is function’s signature?
Answer:
The number and types of a function’s parameters are called the function’s signature.

Question 6.
Write the output for the following code.
#include<iostream>
using namespace std;
class Data
{
public:
void print(int i)
{
cout<<“printing int: “<<i<<endl ;
}
void print(double f)
{
cout<<“printing float: “<<f<<endl;
}
void print(char ch)
{
cout<<“printing character: “<<ch<<endl ;
}
};
int main(void)
{
Data d;
d.print(7); //call print to print integer
d.print (50.3) //call print to print float
d.print(“function overloading”)
//call print to print character
return 0;
}
Answer:
Output:
printing int : 7
printing float : 50.3
printing character : function overloading.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 15 Polymorphism

Question 7.
Rewrite the following program after removing the syntactical error(s) if any. Underline each correction.
#include[iostream]
Class Employee
{
int Empld=101;
char Ename[20];
public
Employee{ } { }
void Join( )
{
cin>>EmplD;
gets(EName);
}
void list( )
{
cout<<Empld<< “:”<<Ename<<endl;
}
};
int main( )
{
Employee E;
Join.E( );
E.List( )
}
Answer:
#include<iostream>
using namespace std;
class Employee
{
int Empld;
char Ename[20];
public:
Employee( )
{
EmpId=101;
}
void Join( )
{
cin>>EmpId;
gets(Ename);
}
void list( )
{
cout<<EmpId<<“: “<<Ename<<endl;
}
};
int main( )
{
Employee E;
Join.E ( ) ;
E. List ( ) ;
}

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 15 Polymorphism

Question 8.
Write the definition of a function Fixpay( ) (float Pay[ ],int N), which should modify each element of the array salary pay N elements, as per the following rules.

TN State Board 11th Computer Science Important Questions Chapter 15 Polymorphism 1

Answer:
void Fixpay (float pay[ ], int N)
{
for(int i=0; i<N; i:++)
{
if(pay[i]<50000)
pay[i] += pay[i] * 0.35;
else if(pay[i]>50000 && pay[i] < 100000)
pay[i] += pay[i] * 0.30;
else
pay[i] += pay[i] * 0.20; .
}
}

Question 9.
Find the syntax errors in the following program segment. Give your reason as well,
class MNQ
{
int x = 30;
float y;
MNQ( )
(y = 33;}
~ ( ) { }
int main( )
{
MNQ M1, M2
}
Answer:
The following are the errors in the given program segment:

TN State Board 11th Computer Science Important Questions Chapter 15 Polymorphism 2

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 15 Polymorphism

Question 10.
Answer the questions (i) and (ii) after going through the following program,
class Match
{
int Time;
public:
Match( ) //Function 1
{
Time = 0;
cout<< “Match commences”<<endl;
}
void Details( ) //Function 2
{
cout<< “Inter Section Basketball Match”<<endl;
}
Match(int Duration) //Function 3
{
Time = Duration;
cout<< “Another Match begins now”«endl;
}
Match(Match & M) //Function 4
{
Time = M.Duration;
cout<< “Like Previous Match”<<endl;
}
};
(i) Which category of Constructor-Function 4 belongs to and what is the purpose of using it?
(ii) Write statements that would call the member functions 1 and 3.
Answer:
(i) Copy constructor, it is invoked when an object is created and initialized with values of an already existing object.
(ii) Match M1; //for function 1
Match M2(90); //for function 3

Question 11.
Answer the questions (i) and (ii) after going through the following program.
class Train
{
int Train No, Track;
public:
Train( ); //Function 1
Train (int TN); //Function 2
Train (Train & T); //Function 3
void Allocate( ); //Function 4
void move( ); //Functions 5
void main( )
{
Train T;
}
(i) Out of the following, which of the option is correct for calling function 2?
Answer:
Option 1-Train N(M);
Option 2-Train P(10);

(ii) Name the feature of object oriented programming, which is illustrated by function 1, function 2 and function 3 combined together.
Answer:
(i) Option 2 is correct for calling function 2.
(ii) Function overloading, i.e., Polymorphism.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 15 Polymorphism

Question 12.
Write a C++ program to find the perimeter of a rectangle using constructor overloading in a class. To find the perimeter of a rectangle using constructor overloading in a class.
Answer:
// constructor declared as outline member function
#include<iostream>
using namespace std;
class Perimeter
int 1, b, p;
public:
Perimeter ( );
Perimeter (int);
Perimeter (int,int);
Perimeter (Perimeters);
void Calculate( );
};
Perimeter::Perimeter( )
{
cout<<“\n Enter the value of length and breadth”; cin>>1>>b;
cout<<“\n\nNonParameterized constructor”;
}
Perimeter::Perimeter(int a)
{
1=b=a;
cout<<“\n\n Parameterized constructor with one argument”;
}
Perimeter::Perimeter(int 11, int b1)
{
cout<<“\n\n Parameterized constructor with 2 argument”;
1=11;
b=b1;
}
Perimeter::Perimeter(Perimeter&p)
{
l = p.1;
b = p.b;
cout<<“\n\n copy constructor”;
}
void Perimeter::Calculate( )
{
p = 2*(l+b);
cout<<p;
}
int main( )
{
Perimeter Obj ;
cout<<“\n perimeter of rectangle is”;
Obj.Calculate( );
Perimeter Obj1(2);
cout<<“\n perimeter of rectangle”;
Obj1.Calculate( ) ;
Perimeter Obj2(2, 3);
cout<<“\n perimeter of rectangle”;
Obj 2.Calculate( );
Perimeter obj3 (0bj2);
cout,<<“\n perimeter of rectangle”;
obj 3.Calculate ( );
return 0;
}
Output:
Enter the value of length and breadth 10 20
Non Parameterized constructor perimeter of rectangle is 60
Parameterized constructor with one argument
perimeter of rectangle 8
Parameterized constructor with 2 argument
perimeter of rectangle 10 copy constructor
perimeter of rectangle 10

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 15 Polymorphism

Question 13.
What is function overloading? Write a C++ program to demonstrate function overloading?
Answer:
The ability of the function to process the message or data in more than one form is called as function overloading.
C++ program to demonstrate function overloading.
#include<iostream>
using namespace std;
void print(inti)
{cout<<“It is integer” <<i<<endl;
void print(double f)
{
cout<<“It is float”<<f<<endl;
}
void print(string c)
{
cout<<“It is string”<<e<<ertdl;
}
int main( )
{
print(10);
print(10.10);
print(“Ten”);
return 0;
}
Output:
It is integer 10
It is float 10.1
It is string Ten

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 15 Polymorphism

Question 14.
What do you mean by constructor overloading? Explain with example.
Answer:
Function overloading can be applied for constructors, as constructors are special functions of classes. A class can have more than one constructor with different signature.
Constructor overloading provides flexibility of creating multiple type of objects for a class.
Constructor overloading
#include<iostream>
using namespace std;
class add
{
int num1, num2, sum;
public:
add ( )
{
cout<<“\n Constructor without parameters…”;
num1 = 0;
num2= 0;
sum =0;
}
add(int s1, int s2)
{
cout<<“\n Parameterized constructor…
num1=s1;
num2-s2;
sum=0;
}
add(add &a)
{
cout<<“\h Copy Constructor…”;
num1=a.num1;
num2=a.num2;
sum=0;
} _
void getdata( )
{
cout<<“\nEnter data ….”;
cin>>num1 >>num2 ;
}
void addition( )
{
sum=num1 + num2;
}
void putdata( )
{
cout<<“\n The numbers are…”;
cout<<numl<< ‘\t’ <<num2; cout<<“\n The sum of the numbers are. . . “<< sum;
}
};
int main( )
{
add a,b(10,20), c(b);
a. getdata ( );
a.addition ( );
b. addition ( );
c. addition( );
cout<<“\n Object a :”;
a. putdata ( );
cout<<“\n Object b :”;
b. putdata( );
cout<<“\n Object c…”;
c. putdata( );
return 0;
}
Output:
Constructor without parameters….
Parameterized constructor…
Copy Constructor …
Enter data … 20 30
Object a :
The numbers are.. 20 30
The sum of the numbers are… 50
Object b :
The numbers are..10 20
The sum of the numbers are… 30
Object c..
The numbers are..10 20
The sum of the numbers are… 30

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 15 Polymorphism

Question 15.
Suppose you have a Kitty Bank with an initial amount of ? 500 and you have to add some more amount to it. Create a class ‘Deposit’ with a data member named ‘amount’ with an initial value of ? 500. Now make three constructors of this class as follows:
(i) Without any parameter – no amount will be added to the Kitty Bank.
(ii) Having a parameter which is the amount that will be added to the Kitty Bank.
(iii) whenever amount is added an additional equaly amount will be deposited automatically.
Create an object of the ‘Deposit’ and display the final amount in the Kitty Bank.
Answer:
#include<iostream>
using namespace std;
class Deposit
{
int amount;
public:
AddAmount( )
{
amount = 500;
}
AddAmount(int a)
{
amount = 500;
amount = a+amount;
}
void Print_amount( )
{
cout<<amount<<endl;
}
} ;
int main( )
{
Deposit a1;
Deposit a2(150);
a1.Print_amount( );
a2.Print_amount ();
return 0;

Question 16.
What is function overloading?
Answer:
The ability of the function to process the message or data in more than one form is called as function overloading.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 15 Polymorphism

Question 17.
List the operators that cannot be overloaded.
Answer:
The operator that cannot be overload are:
(i) scope operator::
(ii) sizeof
(iii) member selector.
(iv) member pointer selector *
(v) ternary operator ?:

Question 18.
class add{int x; public: add(int)}; Write an outline definition for the constructor.
Answer:
add::add(int y)
{
x=y;
}

Question 19.
Does the return type of a function help in overloading a function?
Answer:
No, the return type of a function does not help in overloading a function.

Question 20.
What is the use of overloading a function?
Answer:
Function overloading is not only implementing polymorphism but also reduces the number of comparisons in a program and makes the program to execute faster. It also helps the programmer by reducing the number of function names to be remembered.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 15 Polymorphism

Question 21.
What are the rules for function overloading?
Answer:
Rules for function overloading:

  1. The overloaded function must differ in the number of its arguments or data types.
  2. The return type of overloaded functions are not considered for overloading same data type.
  3. The default arguments of overloaded functions are not considered as part of the parameter list in function overloading.

Question 22.
How does a compiler decide as to which function should be invoked when there are many functions? Give an example.
Answer:
When an overloaded function is called, the compiler determines the mo§t appropriate
definition to use, by comparing the argument types that has been used to call the function with the parameter types specified in the definitions.
Eg:
float area (float radius);
float area (float half, float base, float height) ;
float area (float length , float breadth);

Question 23.
What is operator overloading? Give some example of operators which can be overloaded.
Answer:
The term operator overloading, refers to giving additional functionality to the normal C++ operators like +, + +, -, —, + =, – =, *.<, >. It is also a type of polymorphism in which an operator is overloaded to give user defined meaning to it.
Eg: ‘+’ operator can be overloaded to perform addition on various data types, like for Integer, String(concatenation) etc.

Question 24.
Discuss the benefit of constructor overloading?
Answer:
Function overloading can be applied for constructors, as constructors are special functions of classes. A class can have more than one constructor with different signature. Constructor overloading provides flexibility of creating multiple type of objects for a class.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 15 Polymorphism

Question 25.
class sale (int cost, discount jpublic: sale(sale &); Write a non-inline definition for constructor specified;
Answer:
sale::sale(sale&s)
{
cost-s.cost;
discount=s.discount;
}

Question 26.
What are the rules for operator overloading?
Answer:
(i) Precedence and Associativity of an Operator cannot be changed.
(ii) No new operators can be created, only existing operators can be overloaded.
(iii) Cannot redefine the meaning of an operator’s procedure.
(iv) Overloaded operators cannot’ have default arguments.
(v) When binary operators are overloaded, the left hand object must be an object of the relevant class.

Question 27.
Answer the question (i) to (v) after going through the following class.
classBook
{
intBookCode;
char Bookname[20];
float fees;
public:
Book( ) //Function X
{
fees=1000;
BookCode=l;
strcpy (Bookname “C++”);
}
void display(float C) //Function 2
{
cout«Book code <<“:”<< Bookname << “:” << fees << endl;
}
~Book( ) //Function 3
{
cout<<“End of Book Object”<<endl;
}
Book (intS[ ], char S[ ], float F); //Function 4 };
(i) In the above program, what are Function 1 and Function 4 combined together referred as?
(ii) Which concept is illustrated by Function3? When is this function called/ invoked?
(iii) What is the use of Function 3?
(iv) Write the statements in main to invoke functionl and function 2.
(v) Write the definition for Function 4.
The concept demonstrated is constructor overloading.
(i) Function 1 and Function 4 are called overloaded constructor of the class Book.
(ii) Function 3 is destructor of class Travel. The destructors are called automatically when the objects are destroyed.
(iii) Function 3 is used to deallocate memory.
(iv)
Book B;
B.display(1000);
(v)
Book(int sc, char s[ ], float F)
{
Bookcode = sc; strcpy(Bookname, s);
Fees = F;
}

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 15 Polymorphism

Question 28.
Write the output of the following program
#include<iostream>
using namespace std;
class Seminar
{
int Time;
public:
Seminar( )
{
Time =30;
cout<<“Seminar starts now”<,endl;
}
void Lecture( )
{
cout<<“Lectures in the seminar on”«endl;
}
Seminar(int Duration)
{
Time =Duration;
cout<<“Welcome to Seminar” <<endl;
}
Seminar(Seminar &D)
{
Time =D.Time;
cout<<“Recap of Previous Seminar Content”<<endl;
}
~Seminar( )
{
cout<<“Vote of thanks”<<endl;
}
};
intmain( )
{
Seminar s1, s2(2), s3(s2);
s1.Lecture( );
return 0;
}
Answer:
Output:
Seminar starts now
Welcome to Seminar
Welcome to Seminar
Lectures in the Seminar on
Vote of thanks
Vote of thanks
Vote of thanks

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 15 Polymorphism

Question 29.
Debug the following program.
#include<iostream>
using namespace std;
class String
{
public:
charstr[20];
public:
void accept_string
{
cout<<“\n Enter String:”; cin»str;
}
display_string( )
{
cout<<str;
}
String operator *(String x) //Concatenating String
{
String s;
strcat(str,str);
strcpy(s.str,str);
goto s;
}
}
int main( )
{
String str1, str2, str3;
str1.accept_string( );
str2.accept_string( );
cout<<“\n\n First String is:”;
str1=display_string( );
cout<<“\n\n Second String is:”;
str2.display_string( );
str3=str1 + str2;
cout>>”\n\n Concatenated String is:”;
str3.display_string( );
return 0;
}
Answer:
#include<iostream>
using namespace std;
class String
{
public: char str[20];
public:
void accept_string( )
cout<<“\n Enter String:”;
cin>>str;
}
void display_string( )
{
cout<<str;
}
String operator +(String x) //Concatenating String
{
string s
strcat(str,x.str) ; strcpy(s.str, str) ; return s;
};
int main ( )
{
String str1, str2, str3;
strl.accept_string( );
str2.accept_string( );
cout<<“\n\n First String is:”;
str1.display_string( );
cout<<“\n\n Second String is:”;
str2.display_string();
str3=str1+str2;
cout>>”\n\n Concatenated String is : “;
str3.display_string( );
return 0;
}
Output:
Enter String : COMPUTER
Enter String : SCIENCE
First String is : COMPUTER
Second String is : SCIENCE
Concatenated String is : COMPUTER SCIENCE

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 15 Polymorphism

Question 30.
Answer the questions based on the following program.
#include<iostream>
#include<$tring.h>
using namespace std;
class comp
{
public:
chars[10];
void getstring(char str[10])
{
strcpy(s,str);
}
void operator==(comp);
};
void comp::operator==f(comp ob)
{
if(strcmp(s,ob.s)==0)
cout<<“\nStrings are Equal”;
else
cout<<“\nStrings are not Equal”;
}
int main( )
{
comp ob, ob1;
char string1[10], string2[10];
cout<<“Enter First String:”;
cin>>string1;
ob.getstring(string1);
cout<<“\nEnter Second String:”;
cin>>string2;
ob1.getstring(string2);
ob==ob1;
return 0;
}
(i) Mention the objects which will have the scope till the end of the program.
(ii) Name the object which gets destroyed in between the program.
(iii) Name the operator which is overloaded and write the statement that invokes it.
(iv) Write out the prototype of the overloaded member function.
(v) What types of operands are used for the overloaded operator?
(vi) Which constructor will get executed? Write the output of the program.
Answer:
(i) ob, ob1
(ii) ob1
(iii) The operator that is overloaded is == The statement that invokes it ob==ob1
(iv) void operator ==(comp ob);
(v) string
(vi) default constructor is executed
Output:
Enter First String : Computer
Enter Second String : Computer
Strings are Equal

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 15 Polymorphism

Choose the correct answer:

Read the following C++ program carefully and answer questions from 1-3.
#include<iostream.h>
class negative
{
int i;
public:
void accept( )
{
cin>>i;
}
void display( )
{
cout<<i;
}
void operator-( )
{
i=-i;
}
};
void main( )
{
negative n2;
n2.accept ( );
-n2;
n2.display( ) ;
}

Question 1.
Identify the operator that is overloaded:
(a) =
(b) – (Unary)
(c) – (Binary)
(d) negative
Answer:
(c) – (Binary)

Question 2.
The prototype of the overloaded member function is:
(a) negative operator – ( )
(b) void operator minus
(c) void operator – ( )
(d) void operator – (negative)
Answer:
(c) void operator – ( )

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 15 Polymorphism

Question 3.
Which of the following statements invokes the overloaded member function?
(a) Negative n1 ( )
(b) – – n2 ( )
(c) n2 +;
(d) – n2;
Answer:
(d) – n2;

Question 4.
The mechanism of giving special meaning to an operator is called:
(a) Operator Overloading
(b) Function Overloading
(c) Inheritance
(d) Object
Answer:
(a) Operator Overloading

Question 5.
Which of the following is not a valid function prototype?
(a) void fun (int x) ;
void fun (int y);
(b) void fun (int x, int y);
void fun (int x, float y) ;
(c) int fun(: int x);
void fun (float x) ;
(d) void fun (char x) ;
void fun(char x, int y) ;
Answer:
(a) void fun (int x) ;
void fun (int y);

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 15 Polymorphism

Question 6.
Polymorphism is achieved in C++ through:
(a) Encapsulation
(b) Inheritance
(c) Overloading
(d) Function
Answer:
(c) Overloading

Question 7.
Which of the following operators cannot be overloaded?
(a) +
(b) ++
(c) +=
(d) ::
Answer:
(d) ::

Question 8.
While overloading functions, the possible integral promotions are:
(a) char → int
(b) int → char
(c) both (a) and (b)
(d) none of these
Answer:
(c) both (a) and (b)

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 15 Polymorphism

Question 9.
In operator overloading the operator functions must be defined as:
(a) member function
(b) friend function
(c) either (a) or (b)
(d) neither (a) nor (b)
Answer:
(c) either (a) or (b)

Question 10.
The functionality of ‘+’ operator can be extended to strings through:
(a) operator precedence
(b) operator overloading
(c) operator definition
(d) none of the given
Answer:
(b) operator overloading

Question 11.
The overloaded operator must have at least one operand of:
(a) built-in type
(b) user-defined type
(c) array
(d) derived
Answer:
(b) user-defined type

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 15 Polymorphism

Question 12.
Which one of the following cannot be overloaded?
(a) Constructor
(b) Destructor
(c) Operator
(d) Function
Answer:
(b) Destructor

Question 13.
The __________ arguments of overloaded functions are not considered by the C++ compiler as part of the parameter list.
(a) actual
(b) reference
(c) formal
(d) default
Answer:
(d) default

Question 14.
During overloading of which of the following operators,the left hand object must be an object of the relevant class?
(a) Unary
(b) Binary
(c) Ternary
(d) None of these
Answer:
(b) Binary

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 15 Polymorphism

Question 15.
Which of the following terms means a name having two or more distinct meanings?
(a) Data Abstraction
(b) Encapsulation
(c) Inheritance
(d) Overloading
Answer:
(d) Overloading

Question 16.
The overloaded function definitions are permitted for which of the following data types?
(a) Built in
(b) User defined
(c) Derived
(d) All of these
Answer:
(b) User defined

Question 17.
Which of the following is not true related to function overloading?
(a) Each overloaded function must differ by the number of its formal parameter
(b) The return type of overloaded functions may be the same data type
(c) The default arguments are considered by the C++ compiler as part of the parameter list
(d) Do not use the same function name for two unrelated functions
Answer:
(c) The default arguments are considered by the C++ compiler as part of the parameter list

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 15 Polymorphism

Question 18.
By integral promotions, int data type can be converted into which of the following?
(a) char
(b) double
(c) float
(d) all of these
Answer:
(d) all of these

Question 19.
Integral promotions are purely:
(a) compiler oriented
(b) computer oriented
(c) data oriented
(d) program oriented
Answer:
(a) compiler oriented

Question 20.
In polymorphism, the compiler adopts which strategy to match-function call statement?
(a) Best match
(b) Worst match
(c) Good match
(d) Next match
Answer:
(a) Best match

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 15 Polymorphism

Question 21.
In overloaded function, which are not considered by the C++ compiler as part of the parameter list:
(a) Dummy arguments
(b) Actual parameters
(c) Formal parameters
(d) Default arguments
Answer:
(d) Default arguments

Question 22.
Which operator cannot be overloaded?
(a) ::. size of ? :
(b) : size of + *
(c) + – * 7 :
(d) + . ? size of
Answer:
(a) ::. size of ? :

Question 23.
Which of the following C++ operators can be overloaded ?
(a) ::
(b) .
(c) ?:
(d) +
Answer:
(d) +

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 15 Polymorphism

Question 24.
The function operator( ) is declared in which part of the class ?
(a) public
(b) private
(c) protected
(d) static
Answer:
(a) public

Question 25.
Which of the following statements is false in case of operator overloading?
(a) Only existing operators can be overloaded
(b) The basic definition of an operator can be replaced
(c) The overloaded operator must have at least one operand of user defined type
(d) Binary operators overloaded through member function take one explicit argument.
Answer:
(b) The basic definition of an operator can be replaced

Question 26.
Operator <symbol>( ) must be declared under which access of the class?
(a) private
(b) prptect
(c) public
(d) protected
Answer:
(c) public

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 15 Polymorphism

Question 27.
Which of the following operators can be overloaded?
(a) size of ( )
(b) ::
(c) ++
(d) (.) membership operator
Answer:
(c) ++

Question 28.
In how many ways is polymorphism achieved in C++?
(a) 2
(b) 3
(c) 1
(d) 4
Answer:
(a) 2

Question 29.
How many explicit argument(s) is/are taken by binary operators overloaded through a member function?
(a) One
(b) Two
(c) Three
(d) Six
Answer:
(a) One

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 15 Polymorphism

Question 30.
Polymorphism is achieved through:
(a) function overloading
(b) operator overloading
(c) both (a) and (b)
(d) encapsulation
Answer:
(c) both (a) and (b)

Question 31.
The parameter list in function overloading must differ by:
(a) number of arguments
(b) function name
(c) function size
(d) number of functions
Answer:
(a) number of arguments

Question 32.
The operator that can be overloaded is:
(a) ::
(b) .
(c) sizeof( )
(d) + =
Answer:
(d) + =

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 15 Polymorphism

Question 33.
In C++, each overloaded function must differ either by the number of:
(a) function name
(b) actual parameter
(c) default parameter
(d) formal parameter
Answer:
(d) formal parameter

Question 34.
The ability of the function to process the message or data in more than one form is called as:
(a) function overloading
(b) operator overloading
(c) destructor overloading
(d) data overloading
Answer:
(a) function overloading

Question 35.
Which one of the following operator overload through a member function take one explicit argument?
(a) Unary
(b) Ternary
(c) Binary
(d) Conditional
Answer:
(c) Binary

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 15 Polymorphism

Question 36.
The overloaded operator must have at least how many operand of user defined data type?
(a) Two
(b) One
(c) Three
(d) Four
Answer:
(b) One

Question 37.
The overloaded operator must have atleast one operahd of:
(a) user definded
(b) class
(c) static
(d) Built in data
Answer:
(a) user definded

Question 38.
Which access specifier is used to declare operator () function in operator overloading?
(a) Private
(b) Protected
(c) Public
(d) Unprotected
Answer:
(c) Public

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 15 Polymorphism

Question 39.
The ability of an object to respond differently to different messages is called as:
(a) Encapsulation
(b) Polymorphism
(c) Inheritance
(d) Object
Answer:
(b) Polymorphism

Question 40.
The word ‘poly’ means:
(a) Class
(b) Shape
(c) Many
(d) Constructor
Answer:
(c) Many

Question 41.
In C++ which is achieved through overloading?
(a) Data hiding
(b) Encapsulation
(c) Inheritance
(d) Polymorphism
Answer:
(d) Polymorphism

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 15 Polymorphism

Question 42.
In C++, when binary operators are overloaded through a member function they take how many explicit arguments?
(a) Four
(b) Two
(c) One
(d) Three
Answer:
(c) One

Question 43.
Hierarchical database were primarily used in which computers?
(a) Super
(b) Mainframe
(c) Personal
(d) Micro
Answer:
(b) Mainframe

Question 44.
In C++, double data type can be converted into which data type during integral promotion?
(a) char
(b) int
(c) string
(d) void
Answer:
(b) int

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 15 Polymorphism

Question 45.
In C++, which of the following is achieved through function overloading and operator overloading?
(a) encapsulation
(b) data abstraction
(c) polymorphism
(d) inheritance
Answer:
(c) polymorphism

Question 46.
Identify the odd man out:
(a) Scope operation (::)
(b) Sizeof
(c) Member selector (.)
(d) Plus (+)
Answer:
(d) Plus (+)

Question 47.
Identify the incorrect statement in operator overloading:
(a) Precedence and Associativity can be changed.
(b) No new operators can be created only existing operators can be overloaded.
(c) Cannot redefine the meaning of an operator’s precedence.
(d) Overloaded operators cannot have default arguments.
Answer:
(a) Precedence and Associativity can be changed.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 15 Polymorphism

Question 48.
Identify the incorrect statement:
(a) Overloaded function refers to function having only one meaning.
(b) A class can have more than one constructor with different signature.
(c) ?: operator can be overloaded.
(d) Function overloaded makes the program to execute slower.
Answer:
(b) A class can have more than one constructor with different signature.

Question 49.
Which of the following refers to a function having more than one distinct meaning?
(a) Function overloading
(b) Member overloading
(c) Operator overloading
(d) Operations overloading
Answer:
(a) Function overloading

Question 50.
Which of the following reduces the number of Comparisons in a program?
(a) Operator overloading
(b) Operations overloading
(c) Function overloading
(d) Member overloading
Answer:
(c) Function overloading

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 15 Polymorphism

Question 51.
void dispchar(char ch=‘$’,int size=10)
{
for (int i=1; i<=size; i++) ;
cout<<Ch;
}
How will you invoke the function dispchar( ) for the following input?
To print $ for 10 times
(a) dispchar( );
(b) dispchar(ch,size);
(c) dispchar($,10);
(d) dispchar(‘$’, 10 times);
Answer:
(a) dispchar( );

Question 52.
Which of the following is not true with respect to function overloading?
(a) The overloaded functions must differ in their signature.
(b) The return type is also considered for overloading a function.
(c) The default arguments of overloaded functions are not considered for Overloading.
(d) Destructor function cannot be overloaded.
Answer:
(b) The return type is also considered for overloading a function.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 15 Polymorphism

Question 53.
Which of the following is invalid prototype for function overloading?
(a) void fun (int x); void fun (char ch);
(b) void fun (int x); void fun (int y);
(c) void fun (double d); void fun (char ch);
(d) void fun (double d); void fun (int y);
Answer:
(b) void fun (int x); void fun (int y);

Question 54.
Which of the following function(s) combination cannot be considered as overloaded function(s) in the given snippet?
void print(char A,int B); // F1
void printprint (int A, float B) ; // F2
void Print(int P=10); // F3
void print( ); // F4
(a) F1,F2,F3,F4
(b) F1,F2,F3
(c) F1,F2,F4
(d) F1,F3,F4
Answer:
(a) F1,F2,F3,F4

Question 55.
Which of the following operator is by default
overloaded by the compiler?
(a) *
(b) +
(c)+=
(d) = =
Answer:
(d) = =

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 15 Polymorphism

Based on the following program answer the questions (8) to (10)
#include<iostream>
using namespace std;
class Point
{
private:
int x, y;
public: .
Point (int x1,int y1)
{ ,
x=x1;y=y1;
}
void operatort+(Point &pt3);
void show( )
{
cout<<“x=”<<x<<“, y=”<<y;
}
};
void Point::operator+(Point &pt3)
{
x += pt3.x;
y += pt3.y;
}
int main( )
Point pt1 (3, 2), pt2(5, 4);
pt1 + pt2;
pt1.show ( );
return 0;
}

Question 56.
Which of the following operator is overloaded?
(a) +
(b) operator
(c) ::
(d) =
Answer:
(a) +

Question 57.
Which of the following statement invoke operator overloading?
(a) pt1 + pt2;
(b) point pt1 (3,2), pt2(5,4);
(c) ptl.show( );
(d) return 0;
Answer:
(a) pt1 + pt2;

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 15 Polymorphism

Question 58.
What is the output for the above program?
(a) x = 8, y = 6
(b) x = 14, y = 14
(c) x = 8, y = 6
(d) x = 5, y = 9
Answer:
(a) x = 8, y = 6

TN Board 11th Computer Science Important Questions

TN Board 11th Computer Science Important Questions Chapter 14 Classes and Objects

TN State Board 11th Computer Science Important Questions Chapter 14 Classes and Objects

Question 1.
What is a class?
Answer:
In C++ a class is defined using the keyword class followed by the name of the class. The body of the class is defined inside the curly brackets and terminated either by a semicolon or a list of declarations at the end.

Question 2.
What are the features present in OOP languages?
Answer:
Abstraction, Encapsulation, Inheritance and Polymorphism.

Question 3.
What is data hiding?
Answer:
Data hiding is one of the important features of Object Oriented Programming which allows preventing the functions of a program to access directly the internal representation of a class type.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 14 Classes and Objects

Question 4.
What are access specifiers?
Answer:
The keywords public, private and protected are called access specifiers.

Question 5.
What are the ways to define the member functions of a class?
Answer:
The member functions of a class can be defined in two ways. They are:

  1. Inside the class definition
  2. Outside the class definition

Question 6.
What do you mean by Array of objects?
Answer:
An array which contains the class type of element is called array of objects. It is declared and defined in the same way as any other type of array.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 14 Classes and Objects

Question 7.
What is scope resolution operator?
Answer:
If there are multiple variables with the same name defined in separate blocks then :: (scope resolution) operator will reveal the hidden file scope(global) variable.

Question 8.
How the objects are passed to a function?
Answer:
Objects can be passed as arguments to a member function just like any other data type of C++.
Objects can also be passed in both ways:

  1. Pass By Value
  2. Pass By Reference

Question 9.
What do you mean by Nested class?
Answer:
When one class become the member of another class then it is called Nested class and the relationship is called containership.
Classes can be nested in two ways.

  1. By defining a class within another class.
  2. By declaring an object of a class as a member to another class.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 14 Classes and Objects

Question 10.
Why constructors are advised to define in the public section? Give reason.
Answer:
A constructor can be defined either in private or public section of a class. But it is advisableto defined in public section of a class, so that 16. What do you mean by Inline member its object can be created in any function. functions.

Question 11.
What are the functions of Constructor?
Answer:

  1. To allocate memory space to the object and
  2. To initialize the data member of the class object.

Question 12.
What do you mean by default constructor?
Answer:
A constructor that accepts no parameter is called default constructor. For example in the class data program Data ::Data( ) is the default constructor. Using this constructor, objects are created similar to the way the variables of other data types are created.
int num; //ordinary variable declaration
Data dl; //object declaration
If a class does not contain an explicit constructor (user defined constructor) the compiler automatically generate a default constructor implicitly as an inline public member.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 14 Classes and Objects

Question 13.
What are the ways to create an object using parameterized constructor?
Answer:
There are two ways to create an object using parameterized constructor. They are:

  1. Implicit call
  2. Explicit call

Question 14.
What is explicit call?
Answer:
An explicit call to constructor creates temporary instance which remains in the memory as long as it is used and after that it get released.

Question 15.
What is Destructor?
Answer:
When a class object goes out of scope, a special function called the destructor gets executed. The destructor has the same name as the class tag but prefixed with a ~(tilde). Destructor function returns nothing and it is not associated with anydata type.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 14 Classes and Objects

Question 16.
What do you mean by Inline member functions?
Answer:
When a member function is defined inside a class, it behaves like inline functions. These are called Inline member functions.

Question 17.
What is container class?
Answer:
Whenever an object of a class is declared as a member of another class it is known as a container class. In the container-ship, the object of one class is declared in another class.

Question 18.
Write the general form of a class definition.
Answer:
The General Form of a class definition
class class-name
{
private:
variable declaration;
function declaration;
protected:
variable declaration;
function declaration;
public:
variable declaration;
function declaration;
};
(i) The class body contains the declaration of its members (Data member and Member functions).
(ii) The class body has three access specifiers, private, public and protected.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 14 Classes and Objects

Question 19.
Why do you need a class?
Answer:
Class is a way to bind the data and its associated functions together. Classes are needed to represent real world entities that not only have data type properties but also have associated operations. It is used to create user defined data type.

Question 20.
Explain the access specifiers with example.
Answer:
The access specifiers are public, private and protected.

The Public Members:
A public member is accessible from anywhere outside the class but within a program. User can set and get the value of public data members even without using any member function. ,

The Private Members:
A private member cannot be accessed from outside the class. Only the class member functions can access private members. By default all the members of a class would be private.

The Protected Members:
A protected member is very similar to a private member but it provides one additional benefit that they can be accessed in child classes which are called derived classes (inherited classes).

TN State Board 11th Computer Science Important Questions Chapter 14 Classes and Objects 1

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 14 Classes and Objects

Question 21.
Write short note on outside the class definition.
Answer:
When a member function defined outside the class is just like normal function definition then it is be called as outline member function or non-inline member function. Scope resolution operator (::) is used for this purpose. The syntax for defining the outline member function is
Syntax:
return_type class_name :: function_name (parameter list) .
{
function definition
}

TN State Board 11th Computer Science Important Questions Chapter 14 Classes and Objects 2

Question 22.
What are the methods to create objects?
Answer:
A class specification defines the properties of a class. To make use of a class specified, the variables of that class type have to be declared. The class variables are called object. Objects are also called as instance of class.
Eg: student s;
In the above statement s is an instance of the class student. Objects can be created in two methods,
(i) Global object
(ii) Local object.

(i) Global Object:
If an object is declared outside all the function bodies or by placing their names immediately after the closing brace of the class declaration then it is called as Global object. These objects can be used by any function in the program.

(ii) Local Object:
If an object is declared within a function then it is called local object. It cannot be accessed from outside the function.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 14 Classes and Objects

Question 23.
How will you declare and define the constructor?
Answer:
When an instance of a class comes into scope, a special function called the constructor gets executed. The constructor function name has the same name as the class name. The constructors return nothing. They are not associated with any data type. It can be defined either inside class definition or outside the class definition.
Eg: A constructor defined inside the class specification.
#include<iostream>
using namespace std;
class Sample
{
int i, j;
public :
int k;
Sample ( )
{
i=j=k=0;//constructor defined
inside the class
}
};

Question 24.
What is a copy constructor? When will the copy constructor is called?
Answer:
A constructor having a reference to an already existing object of its own class is called copy constructor.
A copy constructor is called
(i) When an object is passed as a parameter to any of the member functions.
Eg: void simple: :putdata(simple x);
(ii) When a member function returns an object.
Eg: simple getdata() {}
(iii) When an object is passed by reference to an instance of its own class.
Eg: simples 1, s2(s1); // s2(s1) calls copy constructor

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 14 Classes and Objects

Question 25.
Why there is a need for constructors?
Answer:
Need for Constructors:
An array or a structure in C++ can be initialized during the time of their declaration.
Eg:
struct sum
{
int n1,n2;
};
class add
{
int num1,num2;
};
int main ( )
{
int arr[ ]={1,2,3}; //declaration and initialization of array
sum s1={l,l}; //declaration and initialization of structure object
add a1={0,0}; // class object declaration and initialization throws compilation error
}
The initialization of class type object at the time of declaration similar to a structure or an array is not possible because the class members have their associated access specifiers (private or protected or public). Therefore Classes include special member functions called as constructors. The constructor function initializes the class object.

Question 26.
Write short note on memory allocation of objects. Give example.
Answer:
(i) The member functions are created and placed in the memory space only when they are defined as a part of the class specification.
(ii) All the objects belonging to that class use the same member function, no separate space is allocated for member functions when the objects are created.
(iii) Memory space required for the member variables are only allocated separately for each object because the member variables will hold different data values for different objects.
Eg:
Memory allocation for objects:
#include<iostream>
using namespace std;
class product
{
int code,quantity;
float price;
public:
void assignData( );
void Print( );
};
int main( )
{
product p1, p2;
cout<<\n Memory allocation for object pi “<<sizeof (pi) ; cout<<\n Memory allocation for object p2 “<<sizeof(p2); return 0;
}
Output:
Memory allocation for object p1 12
Memory allocation fdr object p2 12

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 14 Classes and Objects

Question 27.
How will you reference a class member?
Answer:
The members of a class are referenced (accessed) by using the object of the class followed by the dot (membership) operator and the name of the member.
The general syntax for calling the member function is:
Object_name. fimction_name(actual parameter);

TN State Board 11th Computer Science Important Questions Chapter 14 Classes and Objects 3

Question 28.
Explain pass by value with example.
Answer:
When an object is passed by value, the function creates its own copy of the object and works on it. Therefore any changes made to the object inside the function do not affect the original object.
C++ program to illustrate how the pass by value method work:
#include<iostream>
using namespace std;
class Sample
{
private: int num; public:
void set(int x)
{
num = x;
}
void pass(Sample obj1, Sample obj2) //objects are passed
{
obj1.num=100; // value of the object is changed inside the function
obj2.num=200; // value of the object is changed inside the function
cout<<“\n\n Changed value of object1″<<obj 1. num;
eout<<“\n\n Changed value of object2″<<obj2 .num;
}
void print( )
{
cout<<num;
}
};
int main( )
{
//object declarations
Sample s1;
Sample s2;
Sample s3;
//assigning values to the data member of objects
s1.set (10);
s2.set (20);
cout<<“\n\t\t Example program for pass by value\n\n\n”;
//printing the values before passing the object cout<<“\n\nValue of objectl before passing”;
s1.print ( );
cout<<“\n\nValue of object2 before passing”;
s2.print( );
//passing object si and s2 s3.pass (s1, s2);
//printing the values after returning to main cout<<“\n\nValue of objectl after passing”;
s1.print () ;
cout<<“\n\nValue of 0bject2 after passing”;
s2.print ( );
return 0;
}
Output;
Example program for PASS BY VALUE
Value of object1 before passing 10
Value of object2 before passing 20
Changed value of object 1 100
Changed value of object 2 200
Value of object 1 after passing 10
Value of object 2 after passing 20

In the above program the objects s1 and s2 are passed to pass( ) method. They are copied to obj 1 and obj2 respectively. The data member num’s value is changed inside the function. But it didn’t affect the s1 and s2 objects data member.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 14 Classes and Objects

Question 29.
Explain pass by reference with example.
Answer:
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.

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)
{
num = x;
}
void pass(Sample &objl, Sample &obj2) //objects are passed
{
obj1.num=100; // value of the object is changed inside the function
obj2.num=200; // value of the object is changed inside the function
cout<<“\n\n Changed value of object1″<<obj1.num;
cout<<“\n\n Changed value of objeet2″<<obj2.num;
}
void pfint( )
{
cout<<num;
}
};
int main( )
{ … .
clrscr( );
//object declarations Sample si;
Sample s2;
Sample s3;
//assigning values to the data member of objects si.set(10);
s2.set(20) ;
cout<<“\n\t\t Example program for pass by reference\n\ n\n”;
//printing the values before passing the object
cout<<‘\\n\nValue of objectl before passing”;
s1.print ( ) ;
cout<<“\n\nValue of object2 before passing”;
s2.print( );
//passing object s1 and s2 s3.pass (s1, s2);
//printing the values after returning to main
Cout<<“\n\nValue of object1 after passing”;
s1.print( );
cout<<“\n\nValue of object2 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

Question 30.
Explain the parameterized constructors with example.
Answer:
A constructor which can take arguments is called parameterized constructor. This type of constructor helps to create objects with different initial values. This is achieved by passing parameters to the function. To illustrate the Parameterized constructor used for creating objects:
#include<iostream>
using namespace std;
class simple
{
private:
int a,b;
public:
simple(int m,int n)
{
a= m ;
b= n;
cout<<“\n Parameterized Constructor of Class- simple”<<endl;
}
void putdata( )
{
cout<<“\nThe two integers are. . . “<<a<<‘\t'<< b<<endl; cout<<“\n The 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”;
si.putdata( );
cout<<“\n\t\tObject 2\n”;
s2.putdata( );
return 0;
}
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

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 14 Classes and Objects

Question 31.
Write the characteristics of constructors.
Answer:

  1. The name of the constructor must be same as that of the class.
  2. No return type can be specified for constructor.
  3. A constructor can have parameter list.
  4. The constructor function can be overloaded.
  5. They cannot be inherited but a derived class can call the base class constructor.
  6. The compiler generates a constructor, in the absence of a user defined constructor.
  7. Compiler generated constructor is public member function.
  8. The constructor is executed automatically when the object is created.
  9. A constructor can be used explicitly to create new object of its class type.

Question 32.
Write the characteristics of destructors.
Answer:

  1. The destructor has the same name as that of the class prefixed by the tilde character ‘~’.
  2. The destructor cannot have arguments.
  3. It has no return type.
  4. Destructors cannot be overloaded i.e., there can be only one destructor in a class.
  5. In the absence of user defined destructor, it is generated by the compiler.
  6. The destructor is executed automatically when the control reaches the end of class scope to destroy the object.
  7. They cannot be inherited.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 14 Classes and Objects

Question 33.
State the reason for the invalidity of the following code fragment.

(i)

(ii)

Class count

{

int first;

int second;

public;

int first;

};

Class item

{

int prd;

};

item int prdno;

Answer:
(i) Redeclaration of variable first.
(ii) Two or more datatypes in declaration of prdno.

Question 34.
class area
{
int s;
public:
void calc( );
};
Write an outline function definition for calc( ); which finds the area of a square.
Answer:
void area :: calc( )
{
cout<<“Enter the value of s”;
cin>>s;
cout<<“The area of square is”<<s*s
}

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 14 Classes and Objects

Question 35.
Identify the error in the following code fragment
class A
{
float x;
void init( )
{
A a1;
X1.5=1;
void main( )
{A1.init( );}
Answer:
class A
{
float x;
public:
void init( )
{
x=1.5;
} };
int main( )
{
A a1;
a1.init( )
}

Question 36.
What is the size of the objects s1, s2?
Answer:
class sum
{
int n1,n2;
public:
void add( ){int n3=10;nl=n2=10;}
} s1,s2;
S1 8 bytes
S2 8 bytes

Question 37.
(i) Write member function called display with no return. The function should display all the member value of the class objects.
(ii) Try the output of the above coding with the necessary modifications.
Answer:
#include<iostream>
using namespace std;
class compute
{
int n1,n2;
public:
int n;
int add(int a,int b)
{
int c= a+b; return c;
}
int prd(int a,int b)
{
int c=a*b;
return c;
}
void display( )
{
compute c1,c2; .
c1 .n=c1..add(12, 15);
c2.n=c2..add(8, 4);
cout<<“\nSum of object-1” <<c1. n; .
cout<<“\nSum of objeet-2” <<c2.n;
cout<<“\n Sum of the two
objects are”<<c1. n+c2 . n;
c1.n=c1.prd(5, 4);
c2.n=c2.prd(2, 5);
cout<<“\nProduct of object-1” <<c1.n;
cout<<“\nProduct of object-2” <<c2 . n;
cout<<“\nProduct of two . objects are”<<c1.n*c2 .n;
}
};
int main( )
{
compute c;
c.display 0;
return 0;
}

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 14 Classes and Objects

Question 38.
#include<iostream>
using namespace std;
class Sample
{
int i ,j;
public:
int k;
Sample( )
{
i=j=k=0;//constructor defined inside the
class
}
};
int main ( )
{
Samples1;
return 0;
}
Answer:
In the above program justify your reason for no output.
There is no cout statement in the above program.

Question 39.
Define a class in general and in C++’s context.
Answer:
The classes are the most important feature of C++ that leads to object oriented programming. Glass is a user defined data type, which holds its own data members and member functions, which can be accessed and used by creating instance of the class.

Question 40.
What is the purpose of a class specifier?
Answer:
The purpose of a class specifier is to identify the access rights for the data and member functions of the class.

Question 41.
Compare a structure and a class in C++ context.
Answer:

  1. Members of a class are private by default and members of struct are public by default.
  2. When deriving a struct from a class/struct, default access-specifier for a base class/struct is public. And when deriving a class, default access specifier is private.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 14 Classes and Objects

Question 42.
Compare private and public access specifier.
Answer:
Private: The private member is not accessible from outside the class.
Public: The public members are accessible from outside the class, using objects of class.

Question 43.
What is non-inline member function? Write its syntax.
Answer:
When a member function is defined outside the class just like normal function definition then it is called as outline member function (or) non-inline member function.
Syntax:
return type class name :: function name
(parameter list)
{
Function definition
}

Question 44.
Define a class Employee with the following specification.
Answer:
private members of class employee:
empno – integer
ename – 20 characters
basic-float
netpay, hra, da, – float
calculate( ) – A function to find the basic+hra+da with float return type .
public member functions of class employee:
havedata( ) – A function to accept values for empno, ename, basic, hra, da and call calculate!) to compute netpay
dispdata( ) – A function to display all the data members on the screen
class employee
{
private:
int empno;
char ename[20];
float basic, hra, da, netpay;
float calculate ( ) ;
public:
vpid havedata( );
void dispdata( );
};
float employee :: calculated
{
return basic + hra + da;
}
void employee :: havedata( )
{
cout<<“\n Enter employee number”;
cin>>empno;
cout<<“\n Enter employee name”;
cin>> ename;
cout<<“\n Enter basic”;
cin>> basic; cout<<“\n Enter hra”;
cin>>hra;
cout<<“\n Enter da”;
cin>>da;
netpay = calculated ( );
}
void employee :: dispdata ( )
{
cout<<“\n Employee number”<<empno;
cout<<“\n Employee name”<<ename;
cout<<“\n Basic: “<<basic;
cout<<“\n HRA: “<<hra;
cout<<“\n DA:”<<da;
}

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 14 Classes and Objects

Question 45.
Define a class MATH with the following specifications.
Answer:
private members:
num1, num2, result-float
init( ) function to initialize numl, num2 and result to zero
protected members:
add( ) function to add numl and num2 and store the sum in result
diff( ) function to subtract numl from num2 and store the difference in the result.

public members:
getdata( ) function to accept values for numl and num2
menu( ) function to.display menu
(i) Add…
(ii) Subtract…
invoke add( ) when choice is
(i) and invoke prod when choice is
(ii) and also display the result.
#include<iostream>
using namespace std;
class math
{
private:
float num1, num2, result;
int c;
void init( )
{
numl = 0.0;
num2 =0.0;
result =0.0;
}
protected: void add( )
{
result = num1 + num2;
cout<<“\n The sum is:”<<result;
void diff( )
{
result = numl-num2; cout<<“\n The product is:” <<result;
}
public:
void getdata( )
{
init ( )
cout<<“\n Enter numbers:”;
cin>>num1>>num2;
}
void menu( )
{
cout<<“\n1.Add”;
cout<<“\n2.Subtraction”;
cout<<“\n Enter your choice:”;
cin>>c;
if(c==1)
add( );
else
diff( );
}
};
int main( )
{
clrscr 0;
math m1; m1.getdata ( );
m1.menu( );
return 0;
}

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 14 Classes and Objects

Question 46.
Create a class called Item with the following specifications.
private members:
code, quantity – Integer data type
price – Float data type
getdata( )-function to accept values for all data members with no return

public members:
tax – float
dispdata( ) member function to display code, quantity, price and tax. The tax is calculated as if the quantity is more than 100 tax is 2500 otherwise 1000.
Answer:
class item
{
private:
int code,quantity;
float price;
void getdata( )
{
cout<<“\n Enter code, quantity, price”;
cin>>code>>quantity>>price;
}
public:
float tax = 0.0;
void putdata( )
{
cout<<“\n code:”<<code;
cput<<“\n Quantity: “<<quantity;
cout<<“\n Price:”<<price;
if(quantity > 100) tax =2500;
else
tax = 1000;
cout<<“\n Tax:”<<tax;
}
};

Question 47.
Write the definition of a class FRAME in C++ with following description.
Private members:
FrameID – Integer data type
Height, Width, Amount – Float data type
SetAmount( ) -Member function to calculate and assign amount as 10*Height*Width
Public members
GetDetail( ) A function to allow user to entervalues of FramelD, Height, Width. This function should also call SetAmount( ) to calculate the amount.
ShowDetail( ) A function to display the values of all data members,
Answer:
class FRAME
{
int Frame ID;
float Height, Width , Amount;
void setAmount( )
{
Amount = 10*Height*Width;
}
Public:
void GetDetail( )
{
cout<<“Enter Frame ID”<<end-1;
cin>>Frame ID;
cout<<“Enter Height”<<endl;
cin>>Height;
cout<<“Enter Widthw<<endl;
cin>>Width; setAmount( );
}
void showDetail( )
{
cout«”Frame ID: “<<FrameID<<endl;
cout<<“Height: w<<Hpight<<endl;
cput<<”Width: “<<Width<<endl;
}
};

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 14 Classes and Objects

Question 48.
Define a class RESORT in C++ with the following description:
Private Members :
Rno//Data member to store Room No
RName //Data member to store customer name
Charges //Data member to store per day charges
Days //Data member to store number of days of stay
COMPUTE( ) //A function to calculate and return Amount as
//Days*Charges and’ if the value of Days*Charges is more than 5000 then as 1.02*Days*Charges
Public Members:
Getinfo() //A function to enter the content Rno, Name, Charges and Days
Displayinfo( ) //A function to display Rno, RName, Charges, Days and
//Amount (Amount to displayed by calling functionCOMPUTE())
Answer:
class RESORT
{
int Rno, Days;
char RName[20];
float charges float COMPUTE ( )
public:
void Getinfo ( );
void Displayinfo( );
void RESORT :: Getinfo( )
{
cout<<“Room Number:'”;
cin>>Rno; cout<<,‘Name i gets(name);
cout<<”Charges:
cin>>Charges;
cput<<“Pays:w;
cin>>Days;
void RESORT :: Displayinfo( )
{
cout<<endl<<“Details as
follows:”<<endl<<“Ropm No: “<<RNo<<“\n Name : “;
puts(name);
cput<<“Charges: “<<Charges<<“\n Days: “<<Days<<“\n Amount: “<<Compute ( ) <<endl;
}
}
float RESORT : : COMPUTE ( )
{
float amount = Charges * Days;
if (amount > 5000)
amount = 1.02*Days*Charges;
return amount;
}

Question 49.
struct pno
{
int pin; float balance;
}
Create a BankAccount class with the following specifications
Protected members
pho_obj //array of 10 elements
init(pin) // to accept the pin number and initialize it and initialize
// the balance amount is 0
public members
deposit(pin, amount):
Increment the account balance by accepting the amount and pin. Check the pin number for matching. If it matches increment the balance and display the balance else display an appropriate message.

withdraw(self, pin, amount):

Decrement the account balance by accepting the amount and pin. Check the pin number for matching and balance is greater than 1000 and amount is less than the balance. If it matches withdraw the amount and display the balance else display an appropriate message.
Answer:
class BankAccount
{
protected:
char name[15];
int acc_no;
char acc_type;
float bal_amount;
public:
void readData( )
{
cout<<“\nEnter the name: “;
gets(name);
cout<<“\nEnter the account number: “;
cin>>acc_no;
cout<<“\nEnter the account type:
cin>>acc_t ype;
cout<<“\nEnter the amount to deposit:
cin>>bal_amount;
}
void deposit( )
{
float deposit;
cout<<“\nEnter your account number:
cin>>acc_no;
cout<<“\nEnter the amount to deposit: “;
cin>>deposit;
bal_amount=bal_amount + deposit;
}
void withdraw( )
{
float w_amount;
cout<<“\nEnter your account number: “;
cin>>acc_no;
cout<<“\nEnter amount to withdraw”;
cin>>w_amount;
if ((bal_amount-*w^amount) <1000)
cout<<“\nWithdraw is not possible”;
else
{
bal_amount=bali_amaunt-w_ amount;
cout<<“\nThe balance is”<<bal_ amount-w_amount;
}
}
void display( )
{
cout<<“\nName of the depositor :”<<name;
cout<<”\nAccount Number: “<<acc_ no;
cout<<“\nAcCount Type:”<<acc_ type;
cout<<“\nThe balance amount is”<<bal_amount;
}
};

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 14 Classes and Objects

Question 50.
Define a class Hotel in C++ with the following description:
Private Members:
Rno //Data member to store Room No
Name //Data member to store customer name
Charges //Data member to store per day charges
Days //Data member to store number of days of stay
Calculate( ) //A function to calculate and return Amount as
//Days*Charges and if the value of Days*Charges is more than 12000 then as 1.2*Days*Charges

Public Members:
Hote{ } //to initialize the class members
Getinfo( ) //A function to enter the content Rno, Name, Charges//and Days
Showinfo( ) //A function to display Rno, RName, Charges, Days and
//Amount (Amount to displayed by calling function CALCULATE( ))
Answer:
class Hotel
{
int Rno, NOD;
char Name[30] float charges;
float calculate ( )
{
float temp = NOD*Charges;
if(temp>12000)
return (1.2*temp);
return temp;
}
public:
void Getinfo( )
{
cout<<“Enter the Room number:”<<endl;
cin>>Rno;
cout<<“Enter the customer .name:” <<endl;
gets(Name);
cout<<“Enter the Room charges per day”;<<endl;
cin>>charges;
cout<<“Enter number of days
stayed by customer”;<<endl;
cin>>NOD;
}
void Showinfo( )
{
cout<<“Room Number: “<<Rno<<endl ;
cout<<“Customer
Name:”<<puts (Name) ;
cout<<“Charges per . day: “<<charges<<endl;
cout<<“Number of days stayed by customer: “<<NOD;
cout<<“Total charges of customers: “<<calculate ( )
}
};

Question 51.
Define a class Exam in C++ with the following description:
Private Members:
Rollno – Integer data type
Cname – 25 characters
Mark – Integer data type

public:
Exam(int,char[ ],int) //to initialize the object
~Exam( ) // display message “Result will be intimated shortly”
void Display( ) // to display all the details if the mark is
// above 60 other wise display “Result Withheld”
Answer:
Class Exam
{
int Rolino;
char Cname[25];
int mark;
public:
Exam( )
{
Rollno=0;
strcpy(Cname,” “) ;
mark=0; .
}
~Exam( )
{
cout<<“Result will be intimated shortly”;
}
void Display( )
if(marks>60)
{
cout<<“Roll No:”<<Rollno;
cout<<“Name: “<<Cname;
cout<<“Marks: “<<marks;
}
else
{
cout<<“Result Withheld”;
}
};

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 14 Classes and Objects

Question 52.
Define a class Student in C++ with the following specification:
Private Members:
A data member Rno(Registration Number) type long
A data member Cname of type string
A data member Agg_marks (Aggregate Marks) of type float
A data member Grade of type char
A member function setGrade ( ) to find the grade as per the aggregate marks obtained by the student. Equivalent aggregate marks range and the respective grade as shown below.

Aggregate Marks

 Grade

>=90 A
Less than 90 and >=75 B
Less than 75 and >=50 C
Less than 50 D

Public members:
A constructor to assign default values to data members:
A copy constructor to store the value in another object
Rno=0,Cname=”N.A” Agg_marks=0.0
A function Getdata ( ) to allow users to enter values for Rno.Cname, Agg_marks and call
functionsetGrade ( ) to find the grade.
A function dispResult( ) to allow user to view the content of all the data members.
A destructor to display the message “END”
Answer:
class student
{
long Rno;
char CName[20];
float Agg-Marks;
char Grade;
void setGrade( )
{
If (Agg_Marks>=90)
Grade = ‘A’;
else if (Agg_Marks<9.0 && Agg_Marks>=75)
Grade = ‘B’;
else if(Agg_Marks<75 && Agg_Marks>=50)
Grade = ‘C’;
else
Grade = ‘D’;
}
public:
candidate( )
{
Rno- 0;
Strcpy(CName , “N.A”);
Agg-Marks =0.0;
void Getdata( )
{
cout<<“Enter Register No”;
cih>>RNO;
cout<<“Enter CName”;
cin>>CName;
cout<<“A§gregate Marks”;
cin>>Agg_Marks;
setGrade( );
}
void dispResult( )
{
cout<<“Registration No”<<Rno;
cout<<“Name”«cname;
cout<<“Aggregate. Marks”<<Agg_Marks;
}
~student ( )
{
cout<<“END”;
}
};

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 14 Classes and Objects

Question 53.
What are called members?
Answer:
Class comprises of members. Members are classified as Data Members and Member functions. Data members are the data variables that represent the features or properties of a class. Member functions are the functions that perform specific tasks in a class. Member functions are called as methods and data members are called as attributes.

Question 54.
Differentiate structure and class though both are user defined data type.
Answer:

Structure

 Class

In C++, a structure Can be referred to as an user defined data type possessing its own operations. In C++, a class can be defined as a collection of related variables and functions encapsulated in a single structure.
Generally used for smaller amounts of data. Generally used for large amounts of data.
The member variable of structure cannot be initialized directly. The member variable of class can be initialised directly.

Question 55.
What is the difference between the class and object in terms of oop?
Answer:

class

 Object

A template or blueprint with which objects are Created is known as class. An instance of a class is known as object.
It is declared by using class keyword. It is invoked by new keyword.
The formation of a class doesn’t allocate memory.Creation of object consumes memory.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 14 Classes and Objects

Question 56.
Why it is considered as a good practice to define a constructor though compiler can automatically generate a constructor?
Answer:

  1. When an object of the class is created, a compiler automatically generates a constructor if it is not defined.
  2. It is considered that writing constructor for a class is a good practice because constructor takes over very important duty of initialization of an object being created and relieves us from this task.

Question 57.
Write down the importance of destructor.
Answer:

  1. The purpose of the destructor is to free the resources that the object may have acquired during its lifetime.
  2. A destructor function removes the memory of an object which was allocated by the constructor at the time of creating a object.

Question 58.
Rewrite the following program after removing the syntax errors if any and underline the errors:
#include<iostream>
#include<stdio.h>
classmystud
{
intstudid =1001;
char name[20];
public mystud( )
{ }
void register ( )
{
cin>>studid;
gets(name);
}
void display ( )
{
cout<<studid<<“: “<<name<<endl;
}
int main( )
{
mystud MS;
register.MS( );
MS.dispfay( );
}
Answer:
#include<iOstream>
#include<stdio.h>
class mystud
{
int studid;
char name[20];
public:
mystud( )
{
Studid =1001;
}
void register( )
{
cin>>studid;
gets(name);
}
void display( )
{
cout<<studid<<“: “<<namd<<endl;
}
int main( )
{
mystud MS;
MS.register( );
MS.display( ) ;
}

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 14 Classes and Objects

Question 59.
Write with example how will you dynamically initialize objects?
Answer:
When the initial values are provided during runtime, then it is called dynamic initialization.
Eg:
int main( )
{
int a;
float b;
cout<<“\n Enter the Roll . number”;
cin>>a;
cout<<“\h Entet the Avetage”;
cin>>b;
x x(a,b); //dynamic initialization
x.disp( );
return 0;

Question 60.
What are advantages of declaring constructors and destructor under public accessibility?
Answer:
The advantages of declaring under public accessibility, so that its object can be created in any function.

Question 61.
Given the following C++ code, answer the questions (i) & (ii)
class TestMeOut
{
public:
~TestMeOut( ) //Function 1
{cout<<“Leaving the examination hall”<<endl;
}
TestMeOut( )//Function 2
{cout<<“Appearingforexamination”<<endl;
}
void MyWork( )//Function 3
{
cout<<“Attempting Questions//<<endl;}
};

(i) In Object Oriented Programming, what is Function 1 referred as and when doesit get invoked / called ?
(ii) In Object Oriented Programming, what is Function 2 referred as and when doesit get invoked / called ?
Answer:
(i) Destructor: It is invoked as soon as the scope of the object of the class TestMeOut gets over.
(ii) Constructor: It is invoked automatically at the time of creation of the object of class TestMeOut.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 14 Classes and Objects

Question 62.
Write the output of the following C++ program code :
#include<iostream>
using namespace std;
class Calci
{
char Grade;
int Bonus;
public:
Calci( )
{
Grade=’E’; Bonus=0;}//ascii value of
A=65
void Down(int G)
{
Grade-=G;
}
void Up(intG)
{
Grade+=G;
Bonus++;
}
Answer:
void Show( )
{
cout<<Grade<<“#”<<Bonus<<endl;
}
};
int main( ) ,
{
Calci c;
c.Down(3);
c.Show();
c.Up(7);
c.Show( );
c.Down(2);
c.Show( );
return 0;
}
Output:
B#0
I#1
G#1

Question 63.
Explain nested class with example.
Answer:
When a class is declared with in another class, the inner class is called as Nested class (i.e., the inner class) and the outer class is known as Enclosing class. Nested class can be defined in private as well as in the public section of the Enclosing class.
C++ program to illustrate the nested class:
#inelude<iostream>
using namespace std;
class enclose
{
private:
int X;
class nest
{
private :
int y;
public:
int z;
void prn( )
{
y=3; z=2
cout<<“\n The product of “<<y<< ‘ *’ <<z<<“=”<<y*z<<“\n”;
}
}; //inner class definition over
nest n1;
public:
nest n2;
void square( )
{
n2.prn( ); //inner class member function is called by its object
x=2;
n2.z=4;
cout<<“\n The product of “<<n2 . z <<‘*'<<n2 . z<<=<n2 . z*n2 . z <<“\n”;
cout<<“\n The product of ” <<x<< ‘*’ <<x<<“=”<<x*x;
}
}; //outer class definition over
int main( )
{
enclose e;
e.square ( ); //outer class member function is called
}
Output:
The product of 3*2=6
The product of 4*4=16
The product of 2*2=4
In the above program, the inner class nest is defined inside the outer class enclose. Nest is accessed by enclose by creating an object of nest.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 14 Classes and Objects

Question 64.
Mention the differences between constructor and destructor.
Answer:

Constructor

 Destructor

A constructor is called when a new instance of a class is created. A destructor is called when an existing instance of a class is destroyed.
It is called each time a class is instantiated. It is called automatically when an object is deleted from the memory.
They can have arguments. They gannot have arguments.
It allocates memory to a newly created object. It deallocates memory of an object after its deletion.
There can be multiple constructors inside a class. There can be only one destructor in a class.
It can be overloaded. The name of the constructor must be same as that of the class. It cannot be overloaded. The destructor has the same name as that of the class prefixed by the tilde character.

Question 65.
Define a class RESORT with the following description in C++:
Private members:
Rno // Data member to store room number Name //Data member to store user name
Charges //Data member to store per day charge
Days //Data member to store the number of days
Compute ( ) // A function to calculate total amount as Days * Charges and if the
//total amount exceeds 11000 then total amount is 1.02 * Days *Charges

Public member:
getinfo( ) // Function to Read the information like name, room no, charges and days
dispinfo ( ) // Function to display all entered details and total amount calculated // using COMPUTE function
Answer:
Class RESORT
{
int Rno, Days;
char Name[30];
float charges;
float compute ( )
{
float temp = Days * charges;
if(temp >11000) .
return(1.02*temp);
}
Public:
void getinfo( )
{
cout<<“Enter the room number:
cin>>Rno;
cout<<“Enter the customer Name:” gets(Name);
cout<<“Enter the room charges per day:”;
cin>>charges;
cout<<“Enter number of days stayed by customer:”;
cin>>Days;
}
void dispinfo( )
{
cout<<“Room number: “«Rno; cout<<“Customer Name:” ;
puts (Name);
cout<<“Charges per day :” <<Charges;
cout<<“Number of days stayed by customer: “<<Days;
cout<<“Total charges of
customer: “<<compute ( ) ;
}
};

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 14 Classes and Objects

Question 66.
Write the output of the following:
#include<iostream>
#include<stdio.h>
using namespace std;
class sub
{
int day, subno;
public:
sub(int,int); // prototype
void printsub( )
{
cout<<“subject number :”<<subno; cout<<“Days :”<<day;
}
};
sub::sub(int d=150,intsn=12)
{
cout<<endl<<“Constructing the object” <<endl;
day=d;
sub no=sn;
}
class stud
{
int rno;
float marks;
public:
stud( )
{
cout<<“Constructing the object of students” <<endl;
rno=0;
marks=0.0;
}
void getval( )
{
cout<<“Enter the roll number and the marks secured”;
cin>>rno>>marks;
}
void printdet( )
{cout<<“Roll no : “<<rno<<“Marks :”<<marks<<endl;
}
};
class admission
{
sub obj;
stud objone;
float fees;
public:
admission ( )
{
cout<< “Constructing the object of admission”<<endl;
fees=0.0;
}
void printdet( )
{
objone.printdet( );
obj.printsub();
cout<<“fees :”<<fees<,endl;
}
};
int main( )
{system(“cls”);
admission adm;
cout<<endl<< “Back in main ()”;
return 0;
}
Answer:
Output:
Constructing the object
Constructing the object of students
Constructing the object of admission
Back in main( )

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 14 Classes and Objects

Question 67.
Write the output of the following.
#include<iostream>
#include<stdio.h>
using namespace std;
class P
{
public:
P( )
{
cout<< “\nConstructor of class P”;}
~P( )
{
cout<< “\nDestructor of class P”;}
class Q
{
public:
Q ( )
{
cout<<“\nConstructor of class Q”;
}
~Q( )
{cout<< “\nDestructor of class Q”;
}
};
class R
{
P obj1, obj2;
Q obj3;
public:
R( ) ,
{
cout<<“\nConstructor of class R”;}
~ R ( )
{
cout<< “\nDestructor of class R”;}
};
int main ( )
{
R Ro;
Q oq;
Pop;
return 0;
}
Answer:
Output:
Constructor of class P
Constructor of class P
Constructor of class Q
Constructor of class R
Constructor of class Q
Constructor of Class P
Destructor of class P
Destructor of class Q
Destructor of class R
Destructor of class Q
Destructor of class P
Destructor of class P

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 14 Classes and Objects

Choose the correct answer:

Question 1.
________ is a way to bind the data and its associated functions together.
(a) Class
(b) Function
(c) Objects
(d) Variables
Answer:
(a) Class

Question 2.
The class body has access specifiers.
(a) two
(b) three
(c) four
(d) five
Answer:
(b) three

Question 3.
_________ is one of the important features of object oriented programming.
(a) Inheritance
(b) Encapsulation
(c) Data hiding
(d) Polymorphism
Answer:
(c) Data hiding

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 14 Classes and Objects

Question 4.
The default access specifier for member is:
(a) public
(b) protected
(c) static
(d) private
Answer:
(d) private

Question 5.
Identify the odd:
(a) Public
(b) Protected
(c) Private
(d) Auto
Answer:
(d) Auto

Question 6.
The member functions of a class can be defined in ____ ways.
(a) two
(b) three
(c) four
(d) five
Answer:
(a) two

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 14 Classes and Objects

Question 7.
Member functions are called as;
(a) data
(b) variables
(c) objects
(d) methods
Answer:
(d) methods

Question 8.
Data members are also called as:
(a) class
(b) objects
(c) attributes
(d) methods
Answer:
(c) attributes

Question 9.
_________ is a scope resolution operator.
(a) :
(b) ;
(c) .
(d) ::
Answer:
(d) ::

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 14 Classes and Objects

Question 10.
Objects can be created in ______ methods.
(a) three
(b) five
(c) six
(d) two
Answer:
(d) two

Question 11.
_______ objects can be used by any function in the program.
(a) Local
(b) Auto
(c) Static
(d) Global
Answer:
(d) Global

Question 12.
________ objects cannot be accessed from outside the function.
(a) Protected
(b) Local
(c) Public
(d) Static
Answer:
(b) Local

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 14 Classes and Objects

Question 13.
The members of a class are accessed by using ______ operator.
(a) :
(b) \
(c) ,
(d) .
Answer:
(d) .

Question 14.
An array which contains the class type of elements is called:
(a) array of objects
(b) array of elements
(c) array of classes
(d) array of functions
Answer:
(a) array of objects

Question 15.
Objects can be passed in ______ ways.
(a) three
(b) four
(c) two
(d) five
Answer:
(c) two

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 14 Classes and Objects

Question 16.
If there are multiple variables with the same name defined in separate blocks then _________ operator will reveal the hidden file scope variable.
(a) &
(b) =
(C) >
(d) ::
Answer:
(d) ::

Question 17.
In ______ changes made to the object inside the function do not affect the original object.
(a) pass by value
(b) pass by object
(c) pass by reference
(d) pass by function
Answer:
(a) pass by value

Question 18.
In ______ any changes made to the object inside the function definition are reflected in original object.
(a) pass by class
(b) pass by object
(c) pass by reference
(d) pass by value
Answer:
(c) pass by reference

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 14 Classes and Objects

Question 19.
When one class become the member of another class then it is called:
(a) Nested function
(b) Nested objects
(c) Nested class
(d) Nested structure
Answer:
(c) Nested class

Question 20.
When an instance of a class comes into scope, a special function called the _______ gets executed.
(a) constructor
(b) nested function
(c) destructor
(d) structure
Answer:
(a) constructor

Question 21.
The constructor function name has the same name as the ______ name.
(a) function
(b) object
(c) class
(d) array
Answer:
(c) class

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 14 Classes and Objects

Question 22.
If a class does not contain an user defined constructor compiler automatically generates ______ constructor.
(a) copy
(b) abstract
(c) default
(d) destructor
Answer:
(c) default

Question 23.
A constructor which can take arguments is called _______ constructor.
(a) default
(b) copy
(c) abstract
(d) parameterized
Answer:
(d) parameterized

Question 24.
________ constructor helps to create objects with different initial values.
(a) First
(b) Parameterized
(c) Instance
(d) Copy
Answer:
(b) Parameterized

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 14 Classes and Objects

Question 25.
Constructors are advisable to define in __________ section of a class.
(a) private
(b) protected
(c) public
(d) default
Answer:
(c) public

Read the code below and answer the questions 26 and 27.
class simple
{
Private: int x;
public: simple(int y)
{
x = y;
}
~ simple( )
{
}
};

Question 26.
The name of the constructor is:
(a) simple
(b) simple
(c) private
(d) public
Answer:
(a) simple

Question 27.
What type of constructors are used in the above code?
(a) Non – parameterized
(b) Copy
(c) Parameterized
(d) Default
Answer:
(c) Parameterized

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 14 Classes and Objects

Question 28.
There are ________ ways to Create an object using parameterized constructor.
(a) three
(b) two
(c) four
(d) five
Answer:
(b) two

Question 29.
An _____ to constructor creates temporary instance in the memory.
(a) implicit call
(b) explicit call
(c) copy
(d) object
Answer:
(b) explicit call

Question 30.
A constructor having a reference to an already existing object of its own class is called:
(a) call by reference
(b) default constructor
(c) copy constructor
(d) abstract
Answer:
(c) copy constructor

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 14 Classes and Objects

Question 31.
add(add & a) is a _________ constructor.
(a) copy
(b) abstract
(c) default
(d) parameterized
Answer:
(a) copy

Question 32.
Whieh of the following is not true?
(a) The name of the constructor must be same as that of the class.
(b) No return type can be specified for constructor.
(c) A constructor can have parameter list.
(d) The constructor function cannot be overloaded.
Answer:
(d) The constructor function cannot be overloaded.

Question 33.
When a class object goes out of seope, ______ gets executed.
(a) destructor
(b) constructor
(c) default constructor
(d) copy constructor
Answer:
(a) destructor

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 14 Classes and Objects

Question 34.
The destructor is prefixed by:
(a) *
(b) ~
(c) +
(d) –
Answer:
(b) ~

Question 35.
Which of the following are not provided by the compiler by default?
(a) Zero-argument constructor
(b) Destructor
(c) Copy constructor
(d) Copy destructor
Answer:
(c) Copy constructor

Question 36.
A _______ is a constructor that either has no parameters, or if it has parameters, all the parameters have default values.
(a) default constructor
(b) copy constructor
(c) Both (a) and (b)
(d) None of these
Answer:
(a) default constructor

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 14 Classes and Objects

Question 37.
How many default constructors per class are possible?
(a) Only one
(b) Two
(c) Three
(d) Uilimited
Answer:
(a) Only one

Question 38.
Which of the following statement is correct about destructors?
(a) A destructor type. has void return
(b) A destructor type. has integer return
(c) A destructor has no return type.
(d) A destructors return type is always same as that of main( ).
Answer:
(c) A destructor has no return type.

Question 39.
Which of the following never requires any argument?
(a) Member function
(b) Friend function
(c) Default constructor
(d) Const function
Answer:
(c) Default constructor

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 14 Classes and Objects

Question 40.
Which of the following statements are correct?
(a) Constructor is always called explicitly.
(b) Constructor is called either implicitly or explicitly, where as destructor is always called implicitly.
(c) Destructors is always called explicitly.
(d) Constructor and destructor functions are not ealled at all as they are always inline.
Answer:
(b) Constructor is called either implicitly or explicitly, where as destructor is always called implicitly.

Question 41.
Identify the default constructor?
(a) add( )
(b) add(int s1)
(c) add(int s1, int s2)
(d) add(add & a)
Answer:
(a) add( )

Read the following code and answer the questions 42 & 43.
class simple
{
private: int x;
public: simple(int y)
{
x=y;
}
};
void main ( )
{
Simple s(6) ;
}

Question 42.
How many objects are created?
(a) 0
(b) 7
(c) 1
(d) 6
Answer:
(d) 6

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 14 Classes and Objects

Question 43.
What type of constructors are used in the above program?
(a) Parameterized constructor
(b) Copy constructor
(c) Non- parameterized constructor
(d) Default constructor
Answer:
(a) Parameterized constructor

Question 44.
Which of the following two entities can be connected by the dot operator?
(a) A class member and a class object.
(b) A class object and a class.
(c) A class and a member of that class-
(d) A class object and a member of that class.
Answer:
(d) A class object and a member of that class.

Question 45.
Which of the following statements is correct about the constructors and destructors?
(a) Destructors can take arguments but constructors cannot.
(b) Constructors can take arguments but destructors cannot.
(c) Destructors can be overloaded but constructors cannot be overloaded.
(d) Constructors can return a value.
Answer:
(b) Constructors can take arguments but destructors cannot.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 14 Classes and Objects

Question 46.
Which of the following access specifiers is used in a class definition by default?
(a) Protected
(b) Public
(c) Private
(d) Friend
Answer:
(c) Private

Question 47.
_______ provides additional benefit to access the child classes.
(a) Default
(b) Break
(c) Protected
(d) Private
Answer:
(c) Protected

Question 48.
Which of the following ean access private data members or member functions of a class?
(a) Any function in the program.
(b) All global functions in the program.
(c) Any member function of that class.
(d) Only public member functions of that class.
Answer:
(c) Any member function of that class.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 14 Classes and Objects

Question 49.
Which of the following statements is correct?
(a) Data items in a class must be private.
(b) Both data and functions can be either private or public.
(c) Member functions of a class must be private.
(d) Constructor of a class cannot be private
Answer:
(b) Both data and functions can be either private or public.

Question 50.
Where does the object is created?
(a) Class
(b) Constructor
(c) Destructor
(d) Attributes
Answer:
(a) Class

Question 51.
Match the following:

(i) Member function (a) attributes
(ii) Data Members (b) instance of a class
(iii) Object (c) allocate memory space to object
(iv) Constructor (d) methods

(a) (i) – (d); (ii) – (a); (iii) – (b); (iv) – (c)
(b) (i) – (a); (ii) – (b); (iii – (c); (iv) – (d)
(c) (i) – (b); (ii) – (a); (iii) – (d); (iv) – (c)
(d) (i) – (c); (ii) – (d); (iii) – (b); (iv) – (a)
Answer:
(a) (i) – (d); (ii) – (a); (iii) – (b); (iv) – (c)

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 14 Classes and Objects

Question 52.
Match the following:

(i) Test ( ) (a) Copy constructor
(ii) Test(int x int y) (b) Method
(iii) Void show( ) (c) Default constructor
(iv) Test (test & a) (d) Parametarized constructor

(a) (i) – (b); (ii) – (c); (iii) – (d); (iv) – (a)
(b) (i) – (c); (ii) – (d); (iii) – (a); (iv) – (b)
(c) (i) – (b); (ii) – (c); (iii) – (a); (iv) – (d)
(d) (i) – (c); (ii) – (d); (iii) – (b); (iv) – (a)
Answer:
(d) (i) – (c); (ii) – (d); (iii) – (b); (iv) – (a)

Question 53.
Identify the correct statement:
(a) In constructor overloading is not allowed.
(b) It is executed when an object is destroyed.
(c) It allocates memory space to objects.
(d) It cannot have argument.
Answer:
(c) It allocates memory space to objects.

Question 54.
Identify the Incorrect statement:
(a) :: operator will reveal the hidden file scope variable.
(b) A member function can access only the private function.
(c) When a class is declared with in another class, the inner class is called as nested class.
(d) The destructors are prefixed by tilde character
Answer:
(b) A member function can access only the private function.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 14 Classes and Objects

Question 55.
Assertion (A):
A constructor having a reference to an already existing object of its own class is called copy constructor.
Reason (R):
The argument should be passed only by reference not by value method.
(a) Both A and R are true and R is the correct explanation for A.
(b) Both A and R are true, but R is not the correct explanation for A.
(c) A is true, but R is false.
(d) A is false, but R is true.
Answer:
(a) Both A and R are true and R is the correct explanation for A.

Question 56.
The variables declared inside the class are known as data members and the functions are known as:
(a) data functions
(b) inline functions
(c) member functions
(d) attributes
Answer:
(c) member functions

Question 57.
Which of the following statements about member functions are True or False?
(i) A member function can call another member function directly with using the dot operator.
(ii) Member function can access the private data of the class.
(a) (i) -True, (ii) – True
(b) (i) – False, (ii) – True
(c) (i) – True, (ii) – False
(d) (i) – False, (ii) – False
Answer:
(b) (i) – False, (ii) – True

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 14 Classes and Objects

Question 58.
A member function can call another member function directly, without using the dot operator called as:
(a) sub function
(b) sub member
(c) nesting of member function
(d) sibling of member function
Answer:
(c) nesting of member function

Question 59.
The member function defined within the class behave like:
(a) inline functions
(b) non-inline function
(c) outline function
(d) data function
Answer:
(a) inline functions

Question 60.
Which of the following access specifier
(a) Private
(b) Protected
(c) Public
(d) Global
Answer:
(a) Private

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 14 Classes and Objects

Question 61 .
class x
{
int y;
public:
x(int z)(y=z;}
} x1[4];
int main( )
{
x x2(10);
return 0;
}
How many objects are created for the above program?
(a) 10
(b) 14
(c) 5
(d) 2
Answer:
(c) 5

Question 62.
State whether the following statements about the constructor are True or False.
(i) constructors should be declared in the private section.
(ii) constructors are invoked automatically when the objects are created.
(a) True, True
(b) True, False
(c) False, True
(d) False, False
Answer:
(c) False, True

Question 63.
Which of the following constructor is executed for the following prototype?
add displayf add &); // add is a class name
(a) Default constructor
(b) Parameterized constructor
(c) Copy Constructor
(d) Non-Parameterized constructor
Answer:
(c) Copy Constructor

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 14 Classes and Objects

Question 64.
What happens when a class with parameterized constructors and having no default constructor is used in a program and we create an object that needs a zero- argument constructor?
(a) Compile-time error
(b) Domain error
(c) Runtime error
(d) Runtime exception.
Answer:
(a) Compile-time error

Question 65.
Which of the following Create a temporary instance?
(a) Implicit call to the constructor
(b) Explicit call to the constructor
(c) Implicit call to the destructor
(d) Explicit call to the destructor
Answer:
(b) Explicit call to the constructor

TN Board 11th Computer Science Important Questions

TN Board 11th Computer Science Important Questions Chapter 13 Introduction to Object-Oriented Programming Techniques

TN State Board 11th Computer Science Important Questions Chapter 13 Introduction to Object-Oriented Programming Techniques

Question 1.
Define procedural programming.
Answer:
Procedural is a list of instructions were given to the computer to do something. Procedural programming aims more at procedures. This emphasis on doing things.

Question 2.
Define class.
Answer:
Class is defined as a template or blueprint_representing a group objects that share common properties and relationship.

Question 3.
Define object.
Answer:
An identifiable entity with, some characteristics and behaviour is called object.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 13 Introduction to Object-Oriented Programming Techniques

Question 4.
Define encapsulation.
Answer:
The mechanism by which the data and functions are bound together into a single unit is known as Encapsulation.

Question 5.
What do you mean by modularity?
Answer:
Modularity is designing a system that is divided into a set of functional units (named modules) that can be composed into a larger application.

Question 6.
What is Inheritance?
Answer:
Inheritance is the technique of building new classes (derived class) from an existing Class (base class). The most important advantage of inheritance is code reusability.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 13 Introduction to Object-Oriented Programming Techniques

Question 7.
What do you mean by modular programming?
Answer:
Modular programming consist of a list of instructions that instructs the computer todo something. Tins’ Paradigm consists of multiple modules, each module has a set of functions of related types. Data is hidden under the modules. Arrangement of data can be changed only by modifying the module.

Question 8.
Write short note on (i) Class (ii) object.
Answer:
(i) Class:
AClass is a construct in C++ which is used to bind data and its associated function together into a single unit using the encapsulation concept. Class is a user defined data type. Class represents a group of similar objects. It can also be defined as a template or blueprint representing a group of objects that share common properties and relationship.

(ii) Object:
It represents data and its associated function together into a single unit. Objects are the basic unit of OOP. An object is created from a class. They are instances of class also called as class variables. An identifiable entity with some characteristics and behaviour is called object.

Question 9.
Write short note on Data Abstraction.
Answer:
Abstraction shows only the essential features without revealing background details. Classes use the concept of abstraction to define a list of abstract attributes and function which operate on these attributes. They encapsulate all the essential properties of the object that are to be created. The attributes are called data members because they hold information. The functions that operate on these data are called methods or member function.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 13 Introduction to Object-Oriented Programming Techniques

Question 10.
Write short note on Encapsulation.
Answer:
The mechanism by which the data and functions are bound together into a single unit is known as Encapsulation. It implements abstraction.

Encapsulation is about binding the data variables and functions together in class. It can also be called data binding. Encapsulation is the most striking feature of a class. The data is accessible only to functions which are wrapped in the class can access it. These functions provide the interface between the object’s data and the program. This encapsulation of data from direct access by the program is called data hiding or information hiding. ‘

Question 11.
Write down the important features of object oriented programming language.
Answer:

  1. Emphasizes on data rather than algorithm.
  2. Data abstraction is introduced in addition to procedural abstraction.
  3. Data and its associated operations are grouped in to single unit.
  4. Programs are designed around the data being operated.
  5. Relationships can be created between similar, yet distinct data types.
    Eg: C++, Java, VB.Net, Python etc.

Question 12.
What do you mean by procedural programming? Write down the important features.
Answer:
Procedural is a list of instructions given to the computer to do something. Procedural programming aims more at procedures. This emphasis on doing things.
Important features of procedural programming:
(i) Programs are organized in the form of subroutines or sub programs.
(ii) All data items are global.
(iii) Suitable for small sized software application.
(iv) Difficult to maintain and enhance the program code as any change in data type needs to be propagated to all subroutines that use the same data type. This is time consuming.
Eg: FORTRAN and COBOL.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 13 Introduction to Object-Oriented Programming Techniques

Question 13.
Explain modular programming with important features.
Answer:
Modular programming consist of a list of instructions that instructs the computer to do something. This Paradigm consists of multiple modules, each module has a set of functions of related types. Data is hidden under the modules. Arrangement of data can be changed only by modifying the module.
Important features of Modular programming:
(i) Emphasis on algorithm rather than data.
(ii) Programs are divided into individual modules.
(iii) Each modules are independent of each other and have their own local data.
(iv) Modules can work with its own data as well as with the data passed to it.
Eg: Pascal and C.

Question 14.
Explain object oriented programming in detail.
Answer:
Object Oriented Programming paradigm emphasizes on the data rather than the algorithm. It implements programs using classes and objects.

Class:
A Class is construct in C++, which is used to bind data and its associated function together into a single unit using the encapsulation concept. Class is a user defined data type. Class represents a group of similar objects.
An identifiable entity with some characteristics and behaviour is called object.
Important features of Object oriented programming:

  1. Emphasizes on data rather than algorithm.
  2. Data abstraction is introduced in addition to procedural abs’traction.
  3. Data and its associated operations are grouped into single unit.
  4. Programs are designed around the data being operated.
  5. Relationships can be created between similar, yet distinct data types.
  6. Eg: C++, Java, VB.Net, Python etc.,

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 13 Introduction to Object-Oriented Programming Techniques

Question 15.
How is modular programming different from procedural programming paradigm?
Answer:
Procedural programming aims more at procedures. Here the programs are organized in the form of subroutines or sub programs. Modular programming emphasis on algorithm rather than data. Programs are divided into individual molecules.

Question 16.
Differentiate classes and objects.
Answer:

Object

 Class

An instance of a class is known as object. A template or blueprint with which objects are created is known as class.
Object is invoked by new keyword. Class is declared by using class keyword.
Creation of object consumes memory. The formation of a class doesn’t allocate memory.

Question 17.
What is polymorphism?
Answer:
Polymorphism is the ability of a message or function to be displayed in more than one form.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 13 Introduction to Object-Oriented Programming Techniques

Question 18.
How encapsulation and abstraction are interrelated?
Answer:
Encapsulation is wrapping data into single unit. Abstraction is hiding unessential parts and showing only essential data.

Question 19.
Write the disadvantages of OOP.
Answer:
Size: Object Oriented Programs are much larger than other programs.
Effort: They require a lot of work to create.
Speed: They are slower than other programs, because of their size.

Question 20.
What is paradigm? Mention the different types of paradigm.
Answer:

  1. Paradigm means organizing principle of a program. It is an approach to programming.
  2. Procedural programming, Modular Programming and Object Oriented Programming are different approaches available for solving problem using computer.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 13 Introduction to Object-Oriented Programming Techniques

Question 21.
Write a note on the features of procedural programming.
Answer:

  1. Programs are organized in the form of subroutines or sub programs.
  2. All data items are global.
  3. Suitable for small sized software application.
  4. Difficult to maintain and enhance the program code as any change in data type needs to be propagated to all subroutines that use the same data type. This is time consuming.
    Eg: FORTRAN and COBOL.

Question 22.
List some of the features of modular programming.
Answer:

  1. Emphasis On algorithm rather than data.
  2. Programs are divided into individual modules.
  3. Each modules are independent of each other and have their own local data.
  4. Modules can work with its own data as well as with the data passed to it.
    Eg: Pascal and C.

Question 23.
What do you mean by modularization and software reuse?
Answer:
Modularization:
The program can be decomposed into modules.
Software re-use: A program can be composed from existing and new modules.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 13 Introduction to Object-Oriented Programming Techniques

Question 24.
Define information hiding.
Answer:
Encapsulation of data from direct access by the program is called data hiding or information hiding.

Question 25.
Write the differences between Object Oriented Programming and procedural programming.
Answer:

Object Oriented Programming

 Procedural programming

Program is divided into parts called objects.Program is divided into small parts called functions.
Importance is given to the data rather than procedures or functions because it works as a real world. Importance is not given to data but to functions.
OOP has access specifier named public, private, protected.Procedural programming does not have access specifier.
Objects can move and communicate with each other through member functions.Data can move freely from function to function in the system.
Data cannot move easily from function to function, it can be kept public or private. So we can control the access of data.Function uses Global data for sharing that can be accessed freely from function to function in the system.
OOP provides Data Hiding. So it provides more security.It does not have any proper way for hiding data. So it is less secure.
Overloading is possible in the form of function, overloading and operator overloading.Overloading is not possible.
Example of C++,               JAVA, VB.NET, C#. NET.C, VB, FORTRAN, PASCAL

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 13 Introduction to Object-Oriented Programming Techniques

Question 26.
What are the advantages of OOPs?
Answer:
(i) Reusability:
Write once and use it multiple times” it can achieved by using class.

(ii) Redundancy:
Inheritance is the good feature for data redundancy. If a same functionality is needed in multiple class, a common class is written for the same functionality and inherit that class to sub class.

(iii) Easy Maintenance:
It is easy to maintain and modify existing code as new objects can be created with small differences to existing ones.

(iv) Security:
Using data hiding and abstraction only necessary data will be provided thus maintains the security of data.

Question 27.
Write a note on the basic concepts that support OOPs.
Answer:
Main Features of Object Oriented Programming are
(i) Data Abstraction,
(ii) Encapsulation,
(iii) Modularity,
(iv) Inheritance,
(v) Polymorphism.

(i) Data Abstraction:
Abstraction refers to showing only the essential features without revealing background details.

(ii) Encapsulation:
The mechanism by which the data and functions are bound together into a single unit is known as Encapsulation. It implements abstraction.

(iii) Modularity:
Modularity is designing a system that is divided into a set of functional units (named modules) that can be composed into a larger application.

(iv) Inheritance:
Inheritance is the technique of building new classes (derived class) from an existing Class (base class). The most important advantage of inheritance is code reusability.

(v) Polymorphism:
Polymorphism is the ability of a message or function to be displayed in more than one form.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 13 Introduction to Object-Oriented Programming Techniques

Choose the correct answer:

Question 1.
The ________ Paradigm allows us to organize software as a collection of objects that consists of both data and behaviour.
(a) STACK
(b) SOP
(c) SAP
(d) OOP
Answer:
(d) OOP

Question 2.
__________ means organizing principle of a program.
(a) Functions
(b) Paradigm
(c) Class
(d) Object
Answer:
(b) Paradigm

Question 3.
In __________ programming programs are organized in the form of subroutines or sub programs.
(a) procedural
(b) functional
(c) structural
(d) modular
Answer:
(a) procedural

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 13 Introduction to Object-Oriented Programming Techniques

Question 4.
FORTRAN and COBOL are examples of ________ programming.
(a) Structural
(b) Modular
(c) Linear
(d) Procedural
Answer:
(d) Procedural

Question 5
_________ programming consists of multiple modules, each module has a set of functions of related types.
(a) Linear
(b) Non – Linear
(c) Model
(d) Modular
Answer:
(d) Modular

Question 6.
__________ is hidden under modules.
(a) Object
(b) Class
(c) Function
(d) Data
Answer:
(d) Data

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 13 Introduction to Object-Oriented Programming Techniques

Question 7.
Pascal and C are examples of
(a) Structural
(b) OOV
(c) Modular
(d) Linear
Answer:
(c) Modular

Question 8.
________ is defined as the template or blueprint representing a group objects that share common properties.
(a) Class
(b) Objects
(c) Program
(d) Algorithm
Answer:
(a) Class

Question 9.
______ represents data and its associated function together into a single unit.
(a) Variable
(b) Expressions
(c) Objects
(d) Constants
Answer:
(c) Objects

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 13 Introduction to Object-Oriented Programming Techniques

Question 10.
_____ are the basic unit of OOP.
(a) Class
(b) Objects
(c) Program
(d) Algorithm
Answer:
(b) Objects

Question 11.
Python is an example for _________ programming.
(a) Functional
(b) Structural
(c) SAP
(d) OOP
Answer:
(d) OOP

Question 12.
Basically an object is created from a:
(a) class
(b) functions
(c) structures
(d) statements
Answer:
(a) class

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 13 Introduction to Object-Oriented Programming Techniques

Question 13.
In ___________ the program can be decomposed into modules.
(a) sub-programs
(b) modularisation
(c) naturalization
(d) multi-way branching
Answer:
(b) modularisation

Question 14.
A program can be composed from existing and new modules in:
(a) software re-use
(b) existing modules
(c) new modules
(d) redundancy
Answer:
(a) software re-use

Question 15.
The mechanism by which the data and functions are bound together into a single unit is called:
(a) encapsulation
(b) inheritance
(c) polymorphism
(d) data hiding
Answer:
(a) encapsulation

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 13 Introduction to Object-Oriented Programming Techniques

Question 16.
Encapsulation is also called as:
(a) data hiding
(b) object hiding
(c) object binding
(d) data binding
Answer:
(d) data binding

Question 17.
__________ shows only the essential features without revealing background details.
(a) Abstraction
(b) Polymorphism
(c) Inheritance
(d) Data binding
Answer:
(a) Abstraction

Question 18.
Attributes are called:
(a) data
(b) objects
(c) variables
(d) data members
Answer:
(d) data members

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 13 Introduction to Object-Oriented Programming Techniques

Question 19.
The functions that operate on data are called:
(a) Procedures
(b) Objects
(c) Methods
(d) Structure
Answer:
(c) Methods

Question 20.
Methods are also called as:
(a) friend function
(b) method function
(c) member function
(d) inline function
Answer:
(c) member function

Question 21.
_________ is the technique of building new classes from an existing class.
(a) Polymorphism
(b) Inheritance
(c) Modularity
(d) Encapsulation
Answer:
(b) Inheritance

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 13 Introduction to Object-Oriented Programming Techniques

Question 22.
__________ is the ability of a message or a function to be displayed in more than one form.
(a) Polymorphism
(b) Data hiding
(c) Methods
(d) Members
Answer:
(a) Polymorphism

Question 23.
_____ paradigm emphasizes on the data rather than the algorithm.
(a) OOP
(b) SAP
(c) Structural
(d) Functional
Answer:
(a) OOP

Question 24.
Match the following:

(i) Modul arization(a) Represents data and its associated function together
(ii) Class(b) Programs can be decomposed into modules
(iii) Objects(c) Blue print representing group of objects that share common properties
(iv) Paradigm (d) Organizing principles of a program

(a) (i) – (d); (ii) – (a); (iii) – (c); (iv) – (b)
(b) (i) – (b); (ii) – (c); (iii) – (a); (iv) – (d)
(c) (i) – (b); (ii) – (c); (iii) – (d); (iv) – (a)
(d) (i) – (d); (ii) – (c); (iii) – (b); (iv) – (a)
Answer:
(b) (i) – (b); (ii) – (c); (iii) – (a); (iv) – (d)

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 13 Introduction to Object-Oriented Programming Techniques

Question 25.
Match the following:

(i) Procedural programming (a) data binding
(ii) Modular programming (b) C++,JAVA, VB.Net
(iii) Object oriented programming (c) Pascal and C
(iv) Encapsulation (d) FORTRAN and COBOL

(a) (i) – (d); (ii) – (c); (iii) – (b); (iv) – (a);
(b) (i) – (a); (ii) – (b); (iii) – (c); (iv) – (d);
(c) (i) – (b); (ii) – (a); (iii) – (d); (iv) – (c);
(d) (i) – (c); (ii) – (d); (iii) – (b); (iv) – (a);
Answer:
(a) (i) – (d); (ii) – (c); (iii) – (b); (iv) – (a);

Question 26.
The term used to describe a programming approach based on classes and objects is:
(a) OOP
(b) POP
(c) ADT
(d) SOP
Answer:
(a) OOP

Question 27.
The paradigm which aims more at procedures:
(a) Object Oriented Programming
(b) Procedural programming
(c) Modular programming
(d) Structural programming
Answer:
(b) Procedural programming

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 13 Introduction to Object-Oriented Programming Techniques

Question 28.
Which of the following is a user defined data type?
(a) class
(b) float
(c) int
(d) object
Answer:
(a) class

Question 29.
The identifiable entity with some characteristics and behaviour is:
(a) class
(b) object
(c) structure
(d) member
Answer:
(b) object

Question 30.
The mechanism by which the data and functions are bound together into a single unit is known as:
(a) Inheritance
(b) Encapsulation
(c) Polymorphism
(d) Abstraction
Answer:
(b) Encapsulation

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 13 Introduction to Object-Oriented Programming Techniques

Question 31.
Encapsulation of the data from direct access by the program is called as:
(a) Data hiding
(b) Inheritance
(c) Polymorphism
(d) Abstraction
Answer:
(a) Data hiding

Question 32.
Which of the following concept encapsulate all the essential properties of the object that are to be created?
(a) Class
(b) Encapsulation
(c) Polymorphism
(d) Abstraction
Answer:
(a) Class

Question 33.
Which of the following is the most important advantage of inheritance?
(a) Data hiding
(b) Code reusability
(c) Code modification
(d) Accessibility
Answer:
(b) Code reusability

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 13 Introduction to Object-Oriented Programming Techniques

Question 34.
“Write once and use it multiple time” can be achieved by:
(a) redundancy
(b) reusability
(c) modification
(d) composition
Answer:
(b) reusability

Question 35.
Which of the following supports the transitive nature of data?
(a) Inheritance
(b) Encapsulation
(c) Polymorphism
(d) Abstraction
Answer:
(a) Inheritance

TN Board 11th Computer Science Important Questions

TN Board 11th Computer Science Important Questions Chapter 12 Arrays and Structures

TN State Board 11th Computer Science Important Questions Chapter 12 Arrays and Structures

Question 1.
Write the syntax to declare a one-dimensional array with example.
Answer:
Syntax:
<data type><array_name> [<array_ size>];
data_type declares the basic type of the array, which is the type of each element in the array.
array name specifies the name with which the array will be referenced.
array size defines how many elements the array will hold. Size should be specified with square brackets [ ].
Eg: int num[10];

Question 2.
What do you mean by subscript?
Answer:
Each element (Memory box) has a unique index number starting from 0 which is known as “subscript”. The subscript always starts with 0 and it should be an unsigned integer value. Each element of an array is referred by its name with subscript index within the square bracket. For example, num[3] refers to the 4th element in the array.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 12 Arrays and Structures

Question 3.
Write the formula to allocate memory space for an array.
Answer:
The memory space allocated for an array can be calculated using:
Number of bytes allocated for type of array × Number of elements.

Question 4.
What do you mean by initialization of an array?
Answer:
An array can be initialized at the time of its declaration. Unless an array is initialized, all the array elements contain garbage values.
Syntax:
<datatype> <array_name> [size]
= {value-1, value-2, ………, value-n};
Eg:
int age[5]={19,,21,16,1,50};

Question 5.
How will you accept values to an array during run time?
Answer:
Multiple assignment statements are required to insert values to the cells of the array during runtime. The for loop is ideally suited for iterating through the array elements.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 12 Arrays and Structures

Question 6.
What do you mean by searching in a one dimensional array?
Answer:
Searching is a process of finding a particular value present in a given set of numbers. The linear search or sequential search compares each element of the list with the value that has to be searched until all the elements in the array have been traversed and compared.

Question 7.
Write the syntax to initialize the character array with example.
Answer:
The character array can be initialized at the time of its declaration. The syntax is shown below:
char array_name [size] = {list of characters separated by comma or a string} ;
Eg:
char country[6]=”INDIA”;
At the end of the string, a null character is automatically added by the compiler.

Question 8.
How will you read a line of text?
Answer:
cin.get( ) is used to read a line of text including blank spaces.
getline( ) is also used to read a line of text from the input stream.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 12 Arrays and Structures

Question 9.
How will you access array elements?
Answer:
Array elements can be used anywhere in a program as in case of a normal variable. The elements of an array are accessed with the array name followed by the subscript index within the square bracket.
Eg:
cout<<num[3];
In the above statement, num[3] refers to the 4th element of the array and cout statement displays the value of num[3].

Question 10.
What is two dimensional array? Give syntax to declare the two dimensional array.
Answer:
Two-dimensional (2D) arrays are collection of similar elements where the elements are stored in certain number of rows and columns. An example m x n matrix where m denotes the number of rows and n denotes the number of columns is shown in Figure below.

TN State Board 11th Computer Science Important Questions Chapter 12 Arrays and Structures 1

The array arr can be conceptually viewed in matrix form with 3 rows and columns. Point to be noted here is since the subscript starts with 0 arr [0][0] represents the first element.
The declaration of a 2-D array is
data-type array_name[row-size] [col-size];

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 12 Arrays and Structures

Question 10.
Write down the bytes that are allocated for each data type.
Answer:

TN State Board 11th Computer Science Important Questions Chapter 12 Arrays and Structures 2

Question 11.
Write a simple program to access the array elements.
Answer:
#include<iostream>
using namespace std;
int main( )
{
int num[5] = {10, 20, 30, 40, 50};
int t=2;
cout<<num[2] <<endl; //SI cout«num [ 3+1 ] <<endl; // S2
cout<<num[t=t+l] ; // S3
Output:
30
50
40

Question 12.
Write a C++ program to read and write the values from an array.
Answer:
#include<iostream>
using namespace std;
int main( )
{
int age[4];//declaration of array
cout<<“Enter the age of four persons:” <<endl;
for(int i=0; i<4; i++)//loop to

write array elements
cin>> age[i];
cout<<“The ages of four persons are:”;
for(int j=0; j<4; j++)
cout<< age[j]<<endl;
}

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 12 Arrays and Structures

Question 13.
#include <iostream>
using namespace std;
int main( )
{
int num[10], even=0, odd=0;
for (int i=0; i<10; i++)
{
cout<< “\n Enter Number”<< i+1
cin>>num[i];
if (num[i] %2 = = 0)
++even;
else
++odd;
}
cout<<“\n There are”«even«”Even Numbers”;
cout<<“\n There are”« odd «”Odd Numbers”;
}
Rewrite the above coding with the conditional operator instead of if.
Answer:
#include<iostream>
using namespace std;
int main( )
{
int num[10],even=0,odd=0;
for (int i=0;i<10;i++)
{
cout<<“\n Enter Number*'<<i+1 <<“=”;
cin>>num[i] ;
(num[i]%2 = = 0)? ++even
}
cout<<“\n There are”<<even<< “Even Numbers”;
cout<<“\n There are”<<odd<<“0dd Numbers”;
>
}
Output:
Enter Number 1= 78
Enter Number 2= 51
Enter Number 3= 32
Enter Number 4= 66
Enter Number 5= 41
Enter Number 6= 68
Enter Number 7= 27
Enter Number 8= 65
Enter Number 9= 28
Enter Number 10= 94
There are 6 Even Numbers
There are 4 Odd Numbers

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 12 Arrays and Structures

Question 14.
Write a C++ program to read the prices of 10 products in an array and then print the sum and average of all the prices and also find the product of the prices.
Answer:
#include<iostream>
using namespace std;
int main( )
{
float price [10] , sum=0, avg=0, prod=1;
for(int i=0; i<10; i++)
{
cout<<“\n Enter the price of item”<<i+1<<“=”;
cin>>price[i];
sum+=price[i];
}
avg=sum/10.0;
cout<<“\n Sum of all prices:”<<sum;
cout<<“\n Average of all prices:” <<avg;
}

Question 15.
Write a C++ program to accept the sales of each day of the month and print the total sales and average sales for each month.
Answer:
#include<iostream>
using namespace std;
int main( )
int days;
float sales [5] , avgSales=0, totalSales=0; .
cout<<“\n Enter No. of days:”;
cin>>days;
for(int i=0; i<days; i++)
{
cout<<“\n Enter sales on day”<<i+1<<“:”;
cin>>sales [i} ;
totalSales+=sales[i];
}
avg=total sales/days;
cout<<“\n Average Sales =” <<avgSales;
return 0;
}

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 12 Arrays and Structures

Question 16.
Write a note on character array creation in C++.
Answer:
To create any kind of array, the size (length) of the array must be known in advance, so that the memory locations can be allocated according to the size of the array. Once an_array is created, its length is fixed and cannot be changed during run time. This is shown in figure below.

TN State Board 11th Computer Science Important Questions Chapter 12 Arrays and Structures 3

Syntax:
Array declaration is:
char array_name[size];
In the above declaration, the size of the array must be. an unsigned integer value.
Eg:
char country[6];
The array reserves 6 bytes of memory for storing a sequence of characters. The length of the string cannot be more than 5 characters and one location is’ reserved for the null character at the end.
//Program to demonstrate a character array.
#include<iostream>
using namespace std;
int main( )
{
char country[6];
cout<<“Enter the name of the country:”;
cin>>country;
cout<<“The name of the country is”<<country;
}
Output:
Enter country the name: INDIA
The country name is INDIA

Question 17.
Write a C++ program to demonstrate various methods of initializing the character array.
Answer:
#include<iostream>
using namespace std;
int main( )
{
char arr1[6]=”INDIA”;
char arr2[6]={‘I’,’N’,’D’,’I’, ‘AV\0’f;
char arr3[ ]=”TRICHY”;
char arr4[ ]={‘T’,’R’, ‘I’, ‘C’,’H’, ‘Y’, ‘\0’};
char arr5[8]=”TRICHY”;
cout<<“arrl is :” <<arr1<< “and its size is”
<<sizeof (arr1) <<endl;
cout<<“arr2 is :” <<arr2<< “and its size is”
<<sizeof (arr2)<<endl;
cout<<“arr3 is :” <<arr3<< “and its size is”
<<sizeof (arr3) <<endl;
cout<<“arr4 is: “<<arr4<<” and its size is”
<<sizeof (arr4) <<endl;
cout<<“The elements of arr5″<<endl;
for(int i=0; i<8; i++) cout<<arr5 [i]<<” “;
return 0;
}
Output:
arr1 is :INDIA and its size is 6
arr2 is :INDIA and its size is 6
arr3 is :TRICHY and its size is 7
arr4 is :TRiCHY and its size is7
The elements of arr5 T R I C H Y.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 12 Arrays and Structures

Question 18.
Write a C++ program to display a line of text using get ( ) function.
Answer:
// str10.cpp
// To read a line of text
#include<iostream>
using namespace std;
int main( )
{
char str[100];
cout<<“Enter a string:”;
cin.get(str,100);
cout<<“You entered: “<<str<<endl;
return 0;
}
Output:
Enter a string: I am a student
You entered: I am a student

Question 19.
Write the ways to initialize the Two-Dimensional array.
Answer:
The array can be initialized in more than one way at the time of 2-D array declaration.
Eg:
int matrix[4][3]={
{10,20,30},// Initializes row 0
{40,50,60},// Initializes row 1
{70,80,90},// Initializes row 2
{100,110,120}// Initializes row 3
};
int matrix[4][3]={10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120};

Question 20.
Write a program to demonstrate array of string using 2d character array.
Answer:
#include<iostream>
using namespace std;
int main ( )
{
// initialize 2d array
char colour [4] [10] = {“Blue”, “Red”,”Orange”,”yellow”};
// printing strings stored in 2d array
for(int i=0; i<4; i++)
cout<<colour [i]<<“\n”;
}
Output:
Blue
Red
Orange
Yellow

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 12 Arrays and Structures

Question 21.
Write a C++ program to display marks of 5 students using one dimensional array.
Answer:
#include<iostream>
using namespace std;
void display (int m[5]);
int main( )
{
int marks[5]={88,76,90,61,69};
display(marks);
return 0;
}
void display (int m[5])
{
cout<<“\n Display Marks : “<<endl;
for (int i=0; i<5; i++)
{
cout<<“Student”<<i+K<“: “<<m[i]<<endl;
}
}
Output:
Display Marks:
Student 1: 88
Student 2: 76
Student 3: 90
Student 4: 61
Student 5: 69

Question 22.
How will you represent two-dimensional array?
Answer:
The two-dimensional array can be viewed as a matrix. The conceptual view of a 2-D array is shown below:
int A[4] [3] ;

TN State Board 11th Computer Science Important Questions Chapter 12 Arrays and Structures 4

In the above example, the 2-D array name A has 4 rows and 3 columns. Like one-dimensional, the 2-D array elements are stored in continuous memory.
There are two types of 2-D array memory representations. They are:
(i) Row-Major order
(ii) Column-Major order.
Eg:
int A[4][3]={ .
{ 8,6,5},
{2,1,9},
{3,6,4},
{4,3,2},

Row Major order:
In row-major order, all the elements are stored row by row in continuous memory locations, i.e., all the elements in first row, then in the second row and so on. The memory representation of row major order is as shown below;

TN State Board 11th Computer Science Important Questions Chapter 12 Arrays and Structures 5

Column-Major order:

TN State Board 11th Computer Science Important Questions Chapter 12 Arrays and Structures 6

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 12 Arrays and Structures

Question 23.
Write a C++ program to check the given string is palindrome or not.
Answer:
#include<iostream>
using namespace std;
int main( )
{
int i,j,len,flag =1;
char a [20];
-cout<<“Enter a string:”;
cin>>a;
for(len=0; a[len]!-‘\0’; ++len)
for(!=0, j =len-1; i<leh/2; ++i, –j)
{
if(a[j]!=a[i])
flag=0;
}
if (flag==1) ;
cout<<“\n The String is palindrome”;
else
cout<<“\n The String is not palindrome”;
return 0;

Output:
Enter a string : madam
The String is palindrome

Question 24.
Explain the returning structures from functions with example.
Answer:
A structure can be passed to a function through its object. Passing a structure to a function or passing a structure object to a function is the same because structure object represents the structure. Like a normal variable, structure variable (structure object) can be passed by value or by references / addresses.

Sitnilar to built-in data types, structures also can be returned from a function.
#ihclude<iostream.h>
using namespace std;
struct Employee
{
int Id;
char Name 125];
int Age;
long Salary;
};
Employee Input( );
void main ( )
{
Employee e;
Emp = Input( );
cout<<“The values Entered are” <<endl:
cout<<“\nEmployee Id: “<<e. Id”;
cout<<“\nEmployee :”<<e.Name;
cout<<“\nEmployee Age:”<<e.Age;
cout<<“\nEmployee Salary :”<<e.Salary;
}
Employee Input( )
{
Employee e;
cout<<“\nEnter Employee Id
cin>>e.Id;
cout<<“\nEnter Employee Name :”;
cin>>e.Name;
cout<<“\nEnter Employee Age :”;
cin>>e.Age;
cout<<“\nEnter Employee Salary :”;
cin>>e. Salary;
return;
}
Output:
Enter Employee Id : 10
Enter Employee Name : Ajay
Enter Employee Age : 25
Enter Employee Salary : 15000
Employee Id : 10
Employee Name : Ajay
Employee Age : 25
Employee Salary : 15000

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 12 Arrays and Structures

Question 25.
Write a program to perform addition of two matrices.
Answer:
#include<iostream>
#include<conio>
using namespace std;
int main ( )
{
int row, col,m1[10][10], m2[10][10],sum[10][10];
cout<<“Enter the number of rows: “;
cin>>row;
cout<<“Enter the number of columns: “;
cin>>col;
cout<<“Enter the elements of first matrix: “<<endl;
for(int i=0; i<row; i++)
for(int j=0; j<col; j++)
cin>>m1 [i] [ j ] ;
cout<<“Enter the elements of second matrix: “<<endl;
for (int i=0; i<row; i++)
for(int j=0; j<col; j++)
cin>>m2[i] [j];
cout<<“Output: “<<endl;
for(int i=0; i<row; i++)
for (int j=0; j<col; j++)
{
sum[i] [j]=ml[i] [j]+m2[i] [j];
cout<<sum [i] [ j ] <<” “;
}
cout<<endl<<endl;
}
getch( );
return 0;
}
Output:
Enter the number of rows : 2
Enter the number of column : 2
Enter the elements of first matrix:1 1 1 1
Enter the elements of second matrix:1 1 1 1
Output:
2 2
2 2

Question 26.
Write a program to accept the marks of 10 students and find the average, maximum and minimum marks.
Answer:
#include<iostream>
using namespace std;
int main( )
{
int mark[10],i,max,min,sum=0;
float avg =0.0;
cout<<“Enter the marks:”;
for(i=0;i<10;i++)
{
cin>>mark[i];
sum += mark[i];
}
avg = sum/10;
max = mark[0] ;
for(i=0; i<10; i++)
{
if(max<mark[i])
max = mark[i];
}
min = mark[0];
for(i=0; i<10; i++)
{
if(min>mark[i] )
min = mark[i];
}
cout<<“The average marks :”<<avg;
cout<<“\n The maximum mark:” <<max;
cout<<“\n The minimum mark:” <<min;
}

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 12 Arrays and Structures

Question 27.
Write a program to accept rainfall recorded in four metropolitan cities of India and find the city that has the highest and lowest rainfall.
Answer:
#include<iostream>
using namespace std;
int main( )
{
double rainfall[4],sum=0,avg, highest=0,lowest;
int highest_city,lowest_city;
for (int i=0; i<4; i++)
{
cout<<“\n The total rainfall for”<<i+1<<“city:”;
cin>>rainfall [i] ;
while(rainfall[i]< 0)
{
cout<<“\n Error. Enter a positive value:”;
cout<<“\n Enter the total rainfall”<<i+1<<“city:”;
cin>>rainfall [i] ;
}
for (int x=0;x<4;x++)
{
if(highest<rainfall[x];
{
… highest = rainfall[x];
highest_city = x+1;
}
}
lowest = rainfall[0];
for(int y=0; y<4; y++)
{
if(lowest>rainfall[y];
lowest_city = y+1;
}
}
cout<<“\n The city has the highest rainfall is”<<highest_city<<endl;
cout<<“\n The city has the lowest rainfall is”<<lowest_ city<<endl;
return 0;
}

Question 28.
Survey your neighbouring shops and find the price of any particular product of interest and suggest where to buy the product at the lowest cost.
Answer:
You are living in the heart of the city. You are very much fond of ice-creams. There are many ice-cream parlours in
your area. You want quality based product and at the same time it should be pocket-friendly.
You have collected pamphlets from three icecream outlets and the same is given below:

TN State Board 11th Computer Science Important Questions Chapter 12 Arrays and Structures 7

Suggestions:
(i) If you want to buy cone ice cream you can buy at ABC or MMM outlets.
(ii) Black forest is cheap at ABC ice cream parlour.
(iii) MMM ice cream shop offers the lowest price for the family pack.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 12 Arrays and Structures

Question 29.
What is Traversal in an Array?
Answer:
Accessing each element of an array at least once to perform any operation is known as “Traversal”.

Question 30.
What is Strings?
Answer:
A string is defined as a sequence of characters where each character may be a letter, number or a symbol. Each element occupies one byte of memory. Every string is terminated by a null (‘\0’, ASCII code 0) character which must be appended at the end of the string.

Question 31.
What is the syntax to declare two – dimensional array.
Answer:
data-type array_name[row-size][col-size];
Eg: int A[5] [5];

Question 32.
Define an Array? What are the types?
Answer:
“An array is a collection of variables of the same type that are referenced by a common name”.
Types of Arrays:

  1. One-dimensional arrays
  2. Two-dimensional arrays
  3. Multi-dimensional arrays

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 12 Arrays and Structures

Question 33.
Write note on Array of strings.
Answer:
An array of strings is a two-dimensional character array. The size of the first index (rows) denotes the number of strings and the size of the second index (columns) denotes the maximum length of each string. Usually, array of strings are declared in such a way to accommodate the null character at the end of each string. For example, the 2-D array has the declaration:
char N ame[6] [10];
In the above declaration, the 2-D array has two indices which refer to the row size and column size, that is 6 refers to the number of rows and 10 refers to the number of columns.

Question 34.
Write a C++ program to accept and print your name?
Answer:
#include<iostream>
using namespace std;
int main ( )
{
char name[20];
cout<<“Enter your Name:”;
cin>>name;
cout<<“your Name is”<<name;
}
Output:
Enter your Name: Ramu
your Name is Ramu

Question 35.
Write a C++ program to find the difference between two matrix.
Answer:
#include<iostream>
#include<conio.h>
using namespace std;
int main( )
{
int row,col,ml[10][10],m2[10][10], diff[10] [10] ;
cout«”Enter the number of rows:”;
cin>>row;
cout<<“Er,ter the number of columns:”; cin»col;
cout<<“Enter the elements of first matrix:”«endl; for(int i-0;icrow;i++) .
for(int j=0; j<col; j++)
{
cin>>m1 [i] [ j ] ;
}
}
cout<<“Enter the elements of ; second matrix: “<<endl;
for(int i=0; i<row; i++)
for(int j=0; j<col; j++)
{
cin>>m2[i] [ j];
}
}
cout<<“output: “<<endl;
for(int i=0; i<row; i++)
{
for(int j=0; j<col; j++)
{
diff [ i ] [ j ] = m1 [i][ j] – m2 [i][j];
cout<<diff[i] [j]<< ” “;
}
cout<<endl<<endl;
}
return 0;
}
Output:
Enter the number _ of rows : 2
Enter the number of columns : 2
Enter the elements of first matrix :
3
3
3
3
Enter the elements of second matrix :
1 .
1
1
1
Output:
2 2
2 2

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 12 Arrays and Structures

Question 36.
How will you pass two dimensional array to a function explain with example.
Answer:
In C++, array can be passed to a function as an argument. To pass an array to a function in C++, the function needs the array name as an argument.
C++ program to display values from two dimensional array:
#include<iostream>
using namespace std;
void display(int n[3][2]);
int main ( )
{
int num[3][2] = {{3,4}, {9,5}, {7,1}};
display(num);
return 0;
}
void display(int n[3][2])
{
cout<<“\n Displaying Values” <<endl;
for (int i=0; i<3; i++)
{
for(int j=0; j<2; j++)
{
cout«n [i] [ j ] <<”
}
cout<<endl<<endl;
}
}
Output:
Displaying Values
3 4
9 5
7 1

Question 37.
Define structure. What is its use?
Answer:
Structure is a user-defined which has the combination of data items with different data types.
Uses:
This allows to group of variables of mixed data types together into a single unit.

Question 38.
To store 100 integer number, Which of the following is good to use? Array or Structure. State the reason.
Answer:
In any situation, when more than one variable is required to represent objects of uniform data-types array can be used. Because it is used to store number of same data type in sequential manner. It provides an easy access to element due to the usage of index number.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 12 Arrays and Structures

Question 39.
What is the error in the following structure definition?
Answer:
struct employee{inteno; charename[20]; char dept;}
Employee e1,e2;

Incorrect statement

Correct statement

inteno; intno;
char ename[20] char name[20];
char dept; char dept[20]

Question 40.
Write a structure definition for the structure student containing examno, name and an array for storing five subject marks.
Answer:
struct student
{
int examno;
char name[20];
int marks[5];
};

Question 41.
Why for passing a structure to a function, call by reference is advisable to us?
Answer:
Structures are usually passed by reference method because it saves the memory space and executes faster.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 12 Arrays and Structures

Question 42.
What is the size of the following highlighted variable in terms of byte if it is compiled in dev C++ ?
Answer:
struct A{ float f[3]; char ch[5];
long double d;};
struct B{ A a; int arr[2][3];}b[3]

TN State Board 11th Computer Science Important Questions Chapter 12 Arrays and Structures 8

Question 43.
Is the following snippet is fully correct. If not identify the error.
struct sum1{int nl,n2;}s1;
struct sum2{int nl,n2}s2;
cin>>s1 .n1>>s1 .n2;
s2=s1;
Answer:
The error statement is s2 = s1;
The object name must be followed with a dot (.) and the member name.

Question 44.
Differentiate array and structure.
Answer:

Array

 Structures

Array is a collection of variables of similar data type. Structure is a collection of variables of dissimilar data types.
Variables of an array are stored in a contiguous memory location. The variables in a structure may or may not be stored in a contiguous memory locations.
Array elements are accessed by their index number. Structure elements are accessed by their names.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 12 Arrays and Structures

Question 45.
What are the different ways to initialize the structure members?
Answer:
Values can be assigned to structure elements similar to assigning values to variables.
Eg:
balu.rollno= “702016”;
balu.age= 18;
balu.weight- 48.5;
Also, values can be assigned directly as similar to assigning values to Arrays.
balu={702016,18,48.5};

Question 46.
What is wrong with the following C++ declarations?
Answer:
A. struct point ( double x, y)
B. struct point (double x, double y };
C. struct point {double x; double y}
D. struct point {double x; double y;};
E. struct point { double x; double y;}
struct point {double x; double y;}; is the only one syntactically correct.

Question 47.
How will you pass a structure to a function?
Answer:
A structure variable can be passed to a function in a similar way of passing any argument that is of built-in data type.

  1. If the structure itself is an argument, then it is called “call by value”.
  2. If the reference of the structure is passed as an argument then it is called, “call by reference”.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 12 Arrays and Structures

Question 48.
The following code sums up the total of all students name starting with ‘^S’ and display it. Fill in the blanks with required statements.
Answer:
struct student {int exam no, lang, eng, phy, che, mat, csc, total;char name[15];};
int main( )
{
student s[20];
for(int i=0;i<20;i++)
{
//accept student details
}
for(int i=0;i<20;i++)
{
//check for name starts with letter “S”
// display the detail of the checked name
}
return 0;
}
#include<iostream>
using namespace std;
struct student
{
int examno, lang, eng, phy, che, mat, esc, total;
Char name[15];
};
int main ( )
{
student s [20];
for(int i=0; i<20; i++)
{
cout<<“\n Enter Exam no”;
cin>>examno;
cout<<“Enter Name”
cin>>name;
cout<<“\n Enter language”;
cin>>lang;
cout<<“\n Enter English mark”;
cin>>eng;
cout<<“\n Enter Physics mark”;
cin>>phy;
cout<<“\n Enter Chemistry mark”;
cin>>che;
cout<<“\n Enter Maths mark”;
cin>>mat;
cout<<“\n Enter CSC mark”;
cin»csc; .
}
cout<<“Displaying the information the name starts
Now the elements of the structure student can be accessed as follows.
balu.rollno
balu.age
balu.weight
frank.rollno
frank.age
frank.weight.

Question 49.
Write the syntax and an example for structure.
Answer:
Syntax:
struct structure_name
{
type member_namel;
type member_name2;
} reference_name;
An optional field reference name can be used to declare objects of the structure type directly.
Eg:
struct Student
{
long rollno;
int age;
float weight;
};

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 12 Arrays and Structures

Question 50.
For the following structure definition write the user defined function to accept data through keyboard.
struct date{ int dd,mm,yy};
struct item {int item id; char name[10];float price;
date date_manif;}
Answer:
date readdata(date d)
{
cout<<“Enter date”;
cin>>d.dd;
cout<<“Enter month”;
cin>>d.mm;
cout<<“Enter year”;
cin>>d;yy;
}
item readdata(item i)
{
cout<<“Enter Item code:”;
cin>>i.item_id;
cout<<“Enter Name:”; cin»i.name;
cout<<“Enter Price:”;
cin>>i .price;
cout<<“Enter date of manufacture:”;
cin>>i. date_manif;
}

Question 51.
What is called anonymous structure? Give an example.
Answer:
Anonymous Structure A structure without a name/tag is called anonymous structure.
struct
{
long rollno;
int age;
float weight;
} student;
The student can be referred as reference name to the above structure and the elements can be accessed like student.rollno, student, age and student.weight.

Question 52.
Write a user defined function to return the structure after accepting value through keyboard. The structure definition is as follows:
Answer:
struct ltem{int item no;float price;};
item Input( )
{
item I
cout<<“Enter Item Number”;
cin>>I.itemno;
cout<<“Enter Price”;
cin>>Price;
return;
}

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 12 Arrays and Structures

Question 53.
Explain array of structures with example.
Answer:
An array of structures is declared in the same way as declaring an array with built-in data types like int or char.
The following program reads the details of 20 students and prints the same.
#include<iostream>
using namespace std;
struct Student
{
int age;
float height,weight; char name[30];
with letters”;<<endl;
for(int i=0; i<=3; i++.)
{
if(s[i].name[0} == ‘S’
{
cout<<s[i] .examno<<endl;
cout<<s [i].name<<endl;
cout<<s [i]. language<<endl;
cout<<s [i].Eng<<endl;
cout<<s [i].Phy<<endl;
cout<<s[i].Che<<endl;
cout<<s [i] .Mat<<endl;
cout<<s [i] .Csc<<endl;
}
}
return 0;
}

Question 54.
What is called nested structure? Give example.
Answer:
The structure declared within another structure is called a nested structure.
Eg:
The following code the struct date of birth can be assigned as one of the elements in the student structure.

Now the student structure will be,
struct Student
{
int age;
float height, weight;
struct dob
{
int date;
char month[4];
int year;
};
};

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 12 Arrays and Structures

Question 55.
Rewrite the following program after removing the syntactical error(s),if any.
Answer:
Underline each correction.
struct movie
{
charm_name[10];
charm_lang[10];
float ticket cost =50;};
Movie;
void main( )
{
gets(m_name);
cin>>mjang;
return 0;
}
struct movie
{
char m_name[10];
char m_lang[50];
float ticket_Cost =50;
}movie;
int main( )
{
gets(movie.m_name);
cin>>movie.m lang;
return 0;
}

Question 56.
What is the difference among the following two programs?
Answer:
(a) #inelude <iostream.h>
struct point { double x; double y;};
int main( ) {
struct point test;
test.x = .25; test.y = .75;
cout<<test.x<<test.y;
return 0;
}

(b) #include <iostream.h>
struct { double x; double y;} Point;
int main(void) {
Point test={.25;. 75};
return 0;
}
The program (b) is the anonymous structure.
The program (b) does not contain a name/tag in the structure.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 12 Arrays and Structures

Question 57.
How to access members of a structure? Give example.
Answer:
The members of the structure can be accessed directly by using a dot(.)
Eg:
struct Student
{
long rollno;
int age;
float weight;
}balu,frank;
};
void main( )
{
Student std[20];
int i;
Cout<<“Enter the details for 20 students”<<endl;
for(i=0; i<20; i++)
{
cout<<“Enter the details of Student”<<i+1<<endl;
cout<<“Enter the age:”<<endl;
cin>>std[i].age;
cout<<“Enter the. height: “<<endl;
cin>>std[i] .height;
cout<<“Enter the weight: “<<endl;
cin>>std[i] .weight;
}. . .
cout<<“The values entered for Age,.height and weight are”<<endl;
for(i=0; i<20; i++)
cout<<“Student”<<i+l<<“\t”<<std[i] .age<<“\t”<<std[i] . height<< “\t”<<std [i] weight;
}
Output:
Enter the details of 20 students details for students age:
height:
weight:
details for student2 age:
height:
Enter -the weight: 61.5
The values entered for Age, height and weight are Student 1 18 160.5 46.5 Student 2 18 164-5 61.5

Question 58.
Explain call by value with respect to structure.
Answer:
When a structure is passed as argument to a function using call by vatue method, any change made to the contents of the structure variable inside the function to which it is passed do not affect the structure variable used as an argument.
Eg:
#include<iostream>
using namespace std;
struct Employee
{
char.name[50];
int age;
float salary;
};
void printData(Employee);
//Function declaration
int main( )
{
Employee p;
cout<<“Enter Full name:”;
cin>>p.name;
cout<<“Enter age:”;
cin>>p.age;
cout<<“Enter salary:”;
cin>>p. salary;
// Function call with structure variable as an argument printData(p);
return 0;
}
void printData(Employee q)
{
cout<<“\nDi splaying Information.” <<endl;
cout<<“Name: “<< q.name <<endl;
cout<<“Age: “<<q. age<<endl;
cout<<“Salary: “<<q. salary;
}
Output:
Enter Full name: Kumar
Enter age: 55
Enter salary: 34233.4
Displaying Information.
Name: Kumar
Age: 55
Salary: 34233.4
In the above example, a structure named Employee is declared and used. The values that are entered into the structure are name, age and salary of a Employee are displayed using a function named printDataQ. The ^ argument for the above function is the structure Employee. The input ban be received through a function named readData( ).

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 12 Arrays and Structures

Question 59.
How call by reference is used to pass structure to a function. Give an Example.
Answer:
In this method of passing the structures to functions, the address of a structure variable
/object is passed to the function using address of(&) operator. So any change made to the contents of structure variable inside the function are reflected back to the calling function.
Eg:
#include<iostream>
using namespace std;
struct Employee
{
char name[50];
int age;
float salary;
};
void readData(Employees) ;
void printData(Employee);
int main( )
{
Employee p;
readData(p);
printData (p);
return 0;
}

void readData.(Employee &p)
{
cout<<“Enter Full name:”;
cin.get(p.name, 50) ;
cout<<“Enter age:”;
cin>>p. age;
cout<<“Enter salary:”;
cin>>p.salary;
}
void printData(Employee p)
{
cout<<“\nDisplaying Information. “<<endl;
cout<<“Name: “<<p.name<<endl;
cout<<“Age: “<<:p. age<<endl;
Cout<<“Salafy: “<<p. salary;
}
Output:
Enter Full name: Kumar
Enter age: 55
Enter Salary: 34233.4
Displaying Information.
Name: Kumar
Age: 55
Salary: 34233.4

Question 60.
Write a C++ program to add two distances using the following structure definition.
Answer:
Struct Distance
{
int feet;
float inch;
}
d1 , d2, sum;
PROGRAM:
#include<idstream>
using namespace std;
Struct Distance .
{
int feet;
float inch; .
}
d1, d2, sum;

int main( )
{
cout<<“Enter 1st distance”<<endl;
cout<<“Enter feet:”;
cin>>d1.feet;
cout<<“Enter inch:”
cin>>d1.inch;
cout<<“nEnter information for 2nd distance”<<endl;
Cout<<“Enter feet:”; ‘
cin>>d2. feet;
cout<<“Enter inch:”;
cin>>d2.inCh;
sum.feet = d1.feet + d2.feet;
sum.inch = d1.inch + d2.inch;
//Changing to feet if inch is greater than 12
if(sum.inch>12)
{
++ sum.feet;
sum.inch – = 12;
}
cout<<endl<<“sum of distances-“<<sum. feet<<“feet”<<sum.inch<<“inches”;
return 0;
}
Output:
Enter 1st .distance
Enter feet : 6
Enter inch : 3.4
Enter infdtmatidh for 2nd distance
Enter feet : 5
Enter inch : 10.2
Sum of distances – 12 feet 1.6 inches

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 12 Arrays and Structures

Question 61.
Write a C++ Program to Add two Complex Numbers by Passing Structure to a Function for the following structure definition,
struct complex
{
float real;
float imag;
};
The prototype of the function is complex add Complex Numbers(complex, complex);
Answer:
#include<iostream>
using namespace std;
typedef struct complex
{
float real;
float, imag;
}
Complex Number;
Complex Number addComplexNumbers(complex, Complex);
int main( )
{
Complex Number n1, n2, temporaryNumber;
char SignofImag;
cout<<“For 1st complex number,”<<endl;
cout<<“Enter real and imaginary parts respectively:”<<endl;
cin>>n1. real>>n2 . imag;
cout<<“For 2nd complex number “<<endl;
cout<<“Enter real and imaginary parts respectively:”<<endl;
cin>>n2 . real>>n2 . imag;
SignofImag =(temporaryNumber. , imag>0) ? ‘+’: ‘-‘;
cout<<“Ehter real and imaginary parts respectively:”<<endl;
cin>>n2 . real>>n2 . imag;
SignofImag =(temporaryNumber. , imag>0) ?
temperaryNumber. imag = (temporaryNurnbet.imag>0)? temporaryNumber .imag: – temporaryNumber.imag; temporaryNumber = addComplexNumbers(n1,n2);
cout<<“Sum = ” <<temporaryNumber. real<<temporatyNumber. imag<<“i”;
return 0;
}
ComplexNumber
addComplexNumbers(complex n1,complex n2)
{
complex temp;
temp.real – n1.real + n2.real;
temp.imag = hi. imag + n2. imag;
return(temp);
}
Output:
For 1st complex number,
Enter real and imaginary parts respectively:
3.4
5.5
For 2nd complex number,
Enter real and imaginary parts, respectively:
– 4.5
– 9.5
sum = -1.1 – 4i

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 12 Arrays and Structures

Question 62.
Write a C++ Program to declare a structure book containing name and author as character array of 20 elements each and price as integer. Declare an array of book. Accept the name, author, price detail for each book. Define a user defined function to display the book details and calculate the total price. Return total price to the calling function.
Answer:
#inciude<iostream>
using namespace std;
struct Book
{
char bookname [20];
char author[20];
float price;
}b[3] ;
void displaydata(Book);
int main( )
{
for (int i=1; i<-3; i++)
(
cout<<“Enter Book Name :”;
cin>>b [ i ] .bookname;
Gout<<“Enter Author Name :”;
cin>>b[i] .author;
cout<<“Enter Price :”;
cin>>b [i] .price;
}
displaydata (b.[3] ) ;
return 0;
}
void displaydata(Book)
float total=0.0;
cout<<“Displaying Book Details”<<endl;
cout<<“\nS.No\tBook Name\tAuthor Name\tPrice”<<endl;
for(int i=1;i<=3;i++)
{
cout<<i<<“\t”<<b [i] .bookname<<“\t”<<b [i] . author<<“\t”<<b [i] .
price<<endl;
total+=b[i].price;
}
cout<<“\nThe total price =”<<total<<endl;
}
Output:
Enter Book Name :Programming
Enter Author Name :Dromy
Enter Price :150
Enter Book Name:C++programming
Enter Author Name :BjarneStrouStrup
Enter Price :200
Enter Book Name :JavaProgramming
Enter Author Name :James
Enter Price :220
Displaying Book Details

TN State Board 11th Computer Science Important Questions Chapter 12 Arrays and Structures 9

The Total Price = 550

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 12 Arrays and Structures

Question 63.
Write a C++ program to declare and accept an array of professors. Display the details of the department=”COMP.SCI” and the name of the professors start with ‘A’. The structure “college” should contain the following members.
prof_id as integer
name and Department as character array
Answer:
#include<iostream>
#include<string.h>
using namespace std;
struct college
{
int Prof_Id;
char name[20];
char Department[20];
};
int main( )
{
college c [4] ;
for(int i=0; i<=3; i++)
{
cout<<“Enter Record”<i + 1<<endl;
cout<<“Enter Prof_Id”<<endl ;
cin>>c[i] . Prof_Id;
cout<<“Enter Professor Name” <<endl;
cin>>c [i] .name;
cout<<“Enter Department”<<endl ;
cin>>c[i].Department;
}
cout<<“Displaying the information”<<endl;
for(int i=0; i<=3; i++)
{
if(strcmp (c [i] .Department, “COMP.SCI”)==0)&&
(s[i].name[0]==’A’) | | (s[i]. name[0]==’a’)

Question 64.
Write the output of the following C++ program.
#include<iostream>
#include<stdio>
#include <string>
#include<conio>
using namespace std;
struct books
{
char name[20], author[20];
}
a [50];
int main( )
{
cout<<c[i] .Prof_Id<<endl;
cout<<c[i] .name<<endl;
cout<<c[i] . Department<<endl;
}
}
return 0;
}
Answer:
Output:
Enter Record 1
Enter Prof_Id
1001
Enter Name
Aarthi
Enter Department
COMP.SCI
Enter Record 2
Enter Prof_Id
1002
Enter Name
Sangeetha
Enter Department
Physics
Enter Record 3
Enter Prof_Id
1003
Enter Name Kavitha
Enter Department
Chemistry
Enter Record 4
Enter Prof_Id
1004
Enter Name
Saritha
Enter Department
Physics
Displaying the information
1001
Aarthi
COMP.SCI
clrscr( );
cout<<“Details of Book No” <, 1<, “\n”;
cout<,”————-\n”;
cout<< “Book Name :”<<strcpy(a[0].name,”Programming”)<<endl; ’
cout<< “Book Author :”<<strcpy(a[0].author,”Dromy”)<<endl;
cout<< “\nDetails of Book No”<< 2 << “\n”;
cout<< ” ———–\n”;
cout<< “Book Name :”<<strcpy(a[1].name,”C++programming” )<<endl;
cout<< “Book Author :”<<strcpy(a[1].author,”BjarneStroustrup”)<<endl;
cout<<“\n\n”;
cout<< “==================\n”;
cout<< “S.No\t| Book Name\t|author\n”;
cout<, “=================”;
for (Int i = 0; i < 2; i++)
{
cout<<“\n”<< i + 1<< “\t |” << a[i].riame << “\t |”<< a[i].author;
}
cout<< “\n=======-========”;
return 0;
}
Output:
DETAILS OF BOOK NO 1
Book Name : Programming
Book Author : Dromy

DETAILS OF BOOK NO 2
Book Name : C++ Programming
Book Author : BjarneStroustrup
=======================
S.No | Book Name | author
=======================
1 | Programming | Dromy
2 | C++ Programming | BjarneStroustrup

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 12 Arrays and Structures

Question 65.
Write the output of the following C++ program.
#include <iostream>
#include <string>
using namespace std; ,
struct student
{
int roll_no;
char name[10];
long phone_number;
};
int main( ){
student p1 = {1,”Brown”, 123443};
student p2, p3;
p2.roll_no = 2;
strcpy(p2.name ,”Sam”);
p2.phone_number = 1234567822;
p3.roll_no = 3; ,
strcpy(p3.name,”Addy”);
p3.phone_number = 1234567844;
eout<< “First Student” <<endl;
cout,<< “roll no :”<< p1.roll_no <<endl;
cout<< “name :”<< pi.name <<endl;
cout<< “phone no :”<< p1.phone_number <<endl;
cout<< “Second Student”<<endl;
cout<< “roll no :”<< p2.roll_no <<endl;
cout<< “name :”<< p2.name <<endl;
cout<< “phone no :”<< p2.phone_number <<endl;
cout<< “Third Student”<<endl;
cout<< “roll no :”<< p3.ro|l_no <<endl;
cout<, “name :”<< p3.name <<endl;
cout<<“phone no;”<< p3.phone_number <<endl;
return 0;
}
Output:
First Student
roll no : 1
name : Brown
phone no : 123443
Second Student
roll no : 2
name : Sam
phone no : 1234567822
Third Student roll no : 3
name : Addy .
phone no : 1234567844

Question 66.
Debug the error in the following program,
#include <is.vream.h>
structPersonRec
{
charlastName[10];
chaefirstName[10];
intage;
}
Person RecPeopleArrayType[10];
voidLoadArray(PeopleRecpeop);
void main( )
{
PersonRecord people;
for (i = 0; i < 10; i++)
{
cout<<people.firstName<<” <<people. lastName
<<setw(10) <<people.age;
}
}
LoadArray(PersonRecpeop)
{
for (int i = 0; i < 10; i++)
{
cout<< “Enter first name:”;
cin<<peop[i].firstName;
cout<< “Enter last name:”;
cin>>peop[i].lastName;
cout<< “Enter age:”;
cin>> people[i].age;}
#include<iostream>
#include<iomanip.h>
using namespace std;
struct_PersonRec
{
char lastName[10];
char firstName [10];
int age;
};
PersonRec PeopleArrayType[10];
void LoadArray(PeopleArrayTypepeop);
int main( )
{
PeopleArrayType people;
for (int i=0;i<10;i++)
{
cout<<people [ i ] .firstName<<‘ ‘<<people(i].lastName <<setw (10) <<people[ i ] . age;
}
}
void LoadArray(PeopleArrayType peop)
{
for (int i=0;i<10;i++)
{
cout<<“Enter first name:”;
cin>>peop[i] .firstName;
cout<<“Enter last name:”;
cin>>peop [i] . lastName;
cout<<“Enter age:”;
cin>>peop[i] .age;
}

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 12 Arrays and Structures

Choose the correct answer:

Question 1.
________ is a collection of variables of the same type that are referenced by a common name.
(a) Structure
(b) Array
(c) Function
(d) Class
Answer:
(b) Array

Question 2.
There are ______ types of arrays used in C++.
(a) three
(b) four
(c) five
(d) six
Answer:
(a) three

Question 3.
Displaying all the elements in an array is an example of:
(a) walk through
(b) traversal
(c) accessing
(d) statements
Answer:
(b) traversal

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 12 Arrays and Structures

Question 4.
Which of the following correctly declares an array?
(a) int num[5];
(b) int num
(c) num{10};
(d) num num[10];
Answer:
(a) int num[5];

Question 5.
What is the index number of the last element of an with 6 elements?
(a) 6
(b) 5
(c) 0
(d) 1
Answer:
(b) 5

Question 6.
Which of the following gives the memory address of the first element in array?
(a) num[0];
(b) num[l];
(c) num(O);
(d) num( 1);
Answer:
(a) num[0];

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 12 Arrays and Structures

Question 7.
Which of the following access the seventh element stored in array?
(a) num(7);
(b) num(6);
(c) num[7];
(d) num[6];
Answer:
(d) num[6];

Question 8.
________ is a process of finding a particular value present in a given set of numbers.
(a) Finding
(b) Searching
(c) Traversing
(d) Walkthrough
Answer:
(b) Searching

Question 9.
____ function receives array, size and value to be searched as parameters.
(a) find( )
(b) replace( )
(c) searching( )
(d) search( )
Answer:
(d) search( )

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 12 Arrays and Structures

Question 10.
If the searched items are not found it returns:
(a) 0
(b) 1
(c) array index
(d) -1
Answer:
(d) -1

Question 11.
_____ is defined as a sequence of characters.
(a) Characters
(b) Numbers
(c) Arrays
(d) String
Answer:
(d) String

Question 12.
char country[6];
In this array reserves _________ bytes of memory.
(a) 5
(b) 6
(c) 0
(d) none
Answer:
(b) 6

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 12 Arrays and Structures

Question 13.
In the initialization of the string, if all the characters are not initialized, then the rest of the characters will be filled with:
(a) Zero
(b) Empty
(c) 1
(d) Null
Answer:
(d) Null

Question 14.
________ is used to read a line of text including blank spaces.
(a) cin.get( )
(b) gets( )
(c) read( )
(d) read line( )
Answer:
(a) cin.get( )

Question 15.
In C++, __________ is also used to read a line of text from the input stream.
(a) getsline( )
(b) readline( )
(c) putline( )
(d) getline( )
Answer:
(d) getline( )

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 12 Arrays and Structures

Question 16.
________ arrays are collection of similar elements where the elements are stored in certain number of rows and columns.
(a) Single-dimensional
(b) Two-dimensional
(c) Structures
(d) Functions
Answer:
(b) Two-dimensional

Question 17.
Identify the invalid:
(a) int A[3][4];
(b) float x[2][3];
(c) char name[5][20];
(d) int A(3)(4);
Answer:
(d) int A(3)(4);

Question 18.
An array of _______is a two-dimensional character array.
(a) character
(b) strings
(c) number
(d) symbols
Answer:
(b) strings

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 12 Arrays and Structures

Question 19.
int a[3][2] declares:
(a) 3 rows and 3 columns
(b) 2 rows and 3 columns
(c) 2 columns and 3 rows
(d) 3 rows and 2 columns
Answer:
(d) 3 rows and 2 columns

Question 20.
Determine the number of elements in the following declaration int array[10][12];
(a) 10
(b) 12
(c) 120
(d) 100
Answer:
(c) 120

Question 21.
Structure is declared using the keyword:
(a) str
(b) structure
(c) struct
(d) std
Answer:
(c) struct

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 12 Arrays and Structures

Question 22.
Objects declared along with structure definition are called _______ objects.
(a) global
(b) local
(c) class
(d) function
Answer:
(a) global

Question 23.
By default all members are ________ in a structure.
(a) private
(b) protected
(c) public
(d) static
Answer:
(c) public

Question 24.
A structure without a name/tag is called ________
(a) anonymous
(c) infinite
(b) finite
(d) empty
Answer:
(a) anonymous

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 12 Arrays and Structures

Question 25.
The structure declared within another structure is ealled a _______ structure.
(a) looping
(b) nested
(c) iterative
(d) selection
Answer:
(b) nested

Question 26.
Nested structures act as _________ of another structure.
(a) objects
(b) variables
(c) members
(d) classes
Answer:
(c) members

Question 27.
If the structure itself is an argument, then it is called:
(a) call by method
(b) call by value
(c) call by reference
(d) call by obj ect
Answer:
(b) call by value

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 12 Arrays and Structures

Question 28.
While declaring and initializing values in an array the values should be given within the:
(a) {}
(b) <>
(c) ( )
(d) [ ]
Answer:
(a) {}

Question 29.
By default all members ar ______ in a structure.
(a) public
(b) private
(c) protected
(d) struct
Answer:
(a) public

Question 30.
The array subscripts always commences from:
(a) 1
(b) 0
(c) -1
(d)10
Answer:
(b) 0

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 12 Arrays and Structures

Question 31.
The second index of the 2D-array refers to:
(a) column
(b) row
(c) length
(d) size
Answer:
(a) column

Question 32.
The header file for setw( ):
(a) iostream
(b) iomanip
(c) stdio
(d) conio
Answer:
(b) iomanip

Question 33.
________ is used between the object name and the member name.
(a) .
(b) ;
(c) :
(d) ,
Answer:
(a) .

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 12 Arrays and Structures

Question 34.
Matrices can be represented through:
(a) single dimensional array
(b) 2-D array
(c) 3-D array
(d) 4-D array
Answer:
(b) 2-D array

Question 35.
In C++, array subscripts is enclosed within ______ symbol.
(a) [ ]
(b) { }
(c) ( )
(d) < >
Answer:
(a) [ ]

Question 36.
The appropriate declaration statement to initialize the variable ‘name’ with the value ‘computer’ is:
(a) char name = “computer”
(b) char[ ] name = “computer”;
(c) char name[ ] – computer;
(d) char name[ ] – “computer”;
Answer:
(d) char name[ ] – “computer”;

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 12 Arrays and Structures

Question 37.
Which of the following is an invalid array declaration?
(a) int array[100];
(b) int array[ ];
(c) int array[i]
(d) const int i – 10; int array[i];
Answer:
(b) int array[ ];

Question 38.
How many elements are stored in an array int num[4][2]?
(a) 2
(b) 4
(c) 6
(d) 8
Answer:
(d) 8

Question 39.
Which function returns 0, if the strings are equal?
(a) strcmp( )
(b) strcpy( )
(c) strlen( )
(d) strcat( )
Answer:
(a) strcmp( )

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 12 Arrays and Structures

Question 40.
Which of the following is called as literals?
(a) String
(b) Float
(c) Int
(d) Char
Answer:
(a) String

Question 41.
Match the following:

(i) Variable (a) Sequence of characters
(ii) Array (b) Read a line of text
(iii) String (c) Basic building blocks in C++
(iv) Getline( ) (d) Collection of variables of the same type

(a) (i) – (d); (ii) – (a); (iii) – (c); (iv) – (b)
(b) (i) – (a); (ii) – (c); (iii) – (b); (iv) – (d)
(c) (i) – (d); (ii) – (a); (iii) – (b); (iv) – (c)
(d) (i) – (c); (ii) – (d); (iii) – (a); (iv) – (b)
Answer:
(d) (i) – (c); (ii) – (d); (iii) – (a); (iv) – (b)

Question 42.
Identify the correct statement:
(a) Array size must be unsigned integer value which is greater than 0.
(b) In arrays, column size is optional but row size is compulsory.
(c) An array of strings is a two-dimensional character array.
(d) Displaying all the elements is an array is an example of‘‘traversal”
Answer:
(b) In arrays, column size is optional but row size is compulsory.

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 12 Arrays and Structures

Question 43.
Identify the correct statement:
(a) If the structure itself is an argument it is called “call by reference”
(b) If the structure is passed as an argument then it is called “call by value”
(c) Structure assignment is possible only if both structure variables / objects are same type
(d) Structure is declared using the keyword “array”
Answer:
(c) Structure assignment is possible only if both structure variables / objects are same type

Question 44.
Assertion (A):
An array is a collection of variables of the same type that are referenced by a common name.
Reason (R):
In an array the values are stored in a fixed number of elements of the same type sequentially in memory.
(a) Both A and R are true and R is the correct explanation for A.
(b) Both A and R are true, but R is not the correct explanation for A.
(c) A is true, but R is false.
(d) A is false, but R is true.
Answer:
(a) Both A and R are true and R is the correct explanation for A.

Question 45.
Which of the following is the collection of variables of the same type that are referenced by a common name?
(a) int
(b) float
(c) Array
(d) class
Answer:
(c) Array

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 12 Arrays and Structures

Question 46.
Array subscripts is always starts with which number?
(a) -1
(b) 0
(c) 2
(d) 3
Answer:
(b) 0

Question 47.
int age[ ] = {6,90,20,18,2}; How many elements are there in this array? ‘
(a) 2
(b) 5
(c) -6
(d) 4
Answer:
(b) 5

Question 48.
cin>>n[3]; To which element does this statement accepts the value?
(a) 2
(b) 3
(c) 4
(d) 5
Answer:
(c) 4

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 12 Arrays and Structures

Question 49.
By default, the string end with which character?
(a) \o
(b) \t
(c)\n
(d) \b
Answer:
(a) \o

Question 50.
The data elements in the structure are also known as:
(a) objects
(b) members
(c) data
(d) records
Answer:
(b) members

Question 51.
Structure definition is terminated by:
(a) :
(b) }
(c) ;
(d) ::
Answer:
(c) ;

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 12 Arrays and Structures

Question 52.
What will happen when the structure is declared?
(a) it will not allocate any memory
(b) it will allocate file memory
(c) it will be declared and initialized
(d) it will be only declared
Answer:
(a) it will not allocate any memory

Question 53.
What is the output of this program?
#include<iostream>
#include<string.h>
using namespace std;
int main ( )
{
struct student
{
int n;
char name[10];
};
student s;
s.n – 123;
strcpy(s.name,”Balu”);
cout<<s.n;
cout<<s. name«endl;
return 0;
}
(a) 123Balu
(b) BaluBalu
(c) Balu 123
(d) 123 Balu
Answer:
(a) 123Balu

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 12 Arrays and Structures

Question 54.
A structure declaration is given below,
struct Time
{
int hours; int minutes;
int seconds;
} t;
Using declaration which of the following refers to seconds.
(a) Time. seconds
(b) Time:: seconds
(c) seconds
(d) t. seconds
Answer:
(d) t. seconds

Question 55.
What will be the output of this program?
#include<iostream>
using namespace std;
struct ShoeType
{
string name;
double price;
};
int main ( )
{
ShoeType shoel,shoe2;
shoe1.name =? “Adidas”;
shoel.price = 9.99;
cout<<shoel. name<<“#”<<shoe1.price<<end1;
shoe2 = shoe1;
shoe2.price = shoe2.price/9;
cout<<shoe2. name<<“#”<<shoe2.price;
return 0;
(a) Adidas #9.99 Adidas #1.11
(b) Adidas # 9.99 Adidas #9.11
(c) Adidas # 9.99 Adidas #11.11
(d) Adidas #9.11 Adidas #11.11
Answer:
(a) Adidas #9.99 Adidas #1.11

Question 56.
Which of the following is a properly defined structure?
(a) struct {intnum;}
(b) struct sum {int num;}
(c) struct sum int sum;
(d) struct sum {int num;};
Answer:
(d) struct sum {int num;};

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 12 Arrays and Structures

Question 57.
A structure declaration is given below.
struct employee
{
int empno;
char ename[10];
}e [5] ;
Using above declaration which of the following statement is correct.
(a) cout<<e[0].empno<<e[0].ename;
(b) cout<<e[0].empno<<ename;
(c) cout<<e[0]→empno<<e[0]->ename;
(d) cout<<e.empno<<e.ename;
Answer:
(a) cout<<e[0].empno<<e[0].ename;

Question 58.
Which of the following cannot be a structure member?
(a) Another structure
(b) Function
(c) Array
(d) Variable of double data type
Answer:
(b) Function

Samacheer Kalvi TN State Board 11th Computer Applications Important Questions Chapter 12 Arrays and Structures

Question 59.
When accessing a structure member, the identifier to the left of the dot operator is the name of:
(a) structure variable
(b) structure tag
(c) structure member
(d) structure function
Answer:
(a) structure variable

TN Board 11th Computer Science Important Questions