Programming Paradigms.

Q3. What are programming paradigms? Give names of some popular programming paradigms.

Ans. By paradigm one means a way of thinking or doing things.

Paradigm means organizing principle of a program. It is an approach to programming.

A few popular programming paradigms are procedural programming, modular programming, structural programming, etc.

Programming Languages.

Q2. Write a short note on programming in two major types of languages.

Ans. The two major types of programming languages are:

  1. Low Level Language
  2. High Level Language

 

  1. Low Level Languages

Low Level languages (that is, machine languages and assembly languages) are machine-oriented and require extensive knowledge of computer circuitry.

Machine language, in which instructions are written in binary code (using 1 and 0), is the only language the computer can execute directly.

Assembly language, in which instructions are written using symbolic names for machine operations (for example, READ, ADD, STORE etc) and operands, makes programming less tedious than machine language programming. However, assembly program is then converted into machine language using assembler software.

  1. High Level Languages

High Level Languages, (HLLs), on other hand, offer English like keywords, constructs for sequence, selection (decision) and iteration (looping) and use of variables and constants. Thus it is very easy to program with such languages compared to low level languages. The programs written in HLLs are converted into machine language using complier or interpreter a s a computer can work with machine language only.

Polymorphism.

Q24. What is polymorphism? Give an example illustrating polymorphism.

Ans. Polymorphism is the ability for a message or data to be processed in more than one form.

For example, if you give 5+7, it results into 12, the sum of 5 and 7. And if you give ‘A’+’BC’, it results into ‘ABC’, the concatenated strings. The same operation symbol ‘+’ is able to distinguish between the two operations (su Read More …

Modularity.

Q20. What is modularity? What benefits does it offer?

Ans. Modularity is the property of a system that has been decomposed into a set of cohesive and loosely coupled modules.

Following are the benefits offered by modularity:

  • It reduces program’s complexity to some degree.
  • It creates a number of well-defined, documented boundaries within the program.

Baseclass and Subclass.

Q19. What is a baseclass? What is a subclass? What is the relationship between a baseclass and subclass?

Ans. A baseclass is a class whose properties are inherited by other classes (its subclasses).

A subclass is class which inherits properties from its base class.

A sub class has nearly all the properties of base class but the reverse of it is not true.