Comp !0 ICSE CHP 3
Comp !0 ICSE CHP 3
1. What are programming languages? Describe the various generations of programming languages.
Ans. A Programming language is a set of commands and syntax used to create a computer program.
2. What are programming paradigms? Briefly explain two popular programming paradigms.
Ans. Programming paradigm is an approach or style of programming that is used to classify programming
language. Each programming language uses one or more programming paradigms. Each programming
paradigm supports a set of concepts that make it the best for a certain kind of problem.
The two programming paradigms are Procedure Oriented Paradigm and Object Oriented Programming.
Procedure Oriented programming paradigm is best suited for problems with step-by-step instructions
whereas, the Object Oriented Programming paradigm is the best suited for problems with a large number of
related data.
10. Differentiate between the Owner’s and the Vet’s perspective in the figure shown here:
Ans. Perspective of Owner is – Breed, colour, Food, and weight.
Perspective of Vet is – Vaccination, digestive health, breed and oral health.
www.bhuvantechs.com
14. Polymorphism means different forms. Explain Polymorphism in Java and provide examples to support
your answer.
Ans. Polymorphism is the ability of a function or an object to take on multiple forms. In OOP, polymorphism
allows an operation to exhibit different behaviours in different instances. The behaviour depends upon the
type of data used in the operation. For example, consider the operation of addition. For two numbers, the
operation will generate the sum and if the operands are strings, then the operation would produce a third
string by concatenation.
16. Explain the difference between Inheritance and Encapsulation with suitable examples.
Ans.
Encapsulation is a mechanism that binds the data and code (functions) together into a single unit. It keeps
them both safe from the outside world, preventing any unauthorised access or misuse. Take a real-life
example of a washing machine. The start button on the washing machine encapsulates lots of
complexity behind it. Here, the abstraction shows only the essential feature i.e., the Start button. The
encapsulation helps to hide all the internal details of washing, i.e., filling up the water, starting the drum,
rinsing, etc.
On the other hand, Inheritance is a powerful mechanism by which one class acquires the properties of
another class. For example, from the Birds class, specific types of birds can be inherited such as, Flying Birds.
The Flying Birds class needs to define only its own unique attributes, such as flying distance, timings of flying
and places where they fly. The rest of the generic attributes and behaviour are inherited from the Birds class.
www.bhuvantechs.com