Ncert solutions for class 11 Computer Science Python Chapter 5 Programming Methodology are prepared by CBSE student eCARE expert to score good marks in class 11. Classes 11 Computer Science Python Chapter 5 Programming Methodology contain many topics which are very important to score good in class 11. There are some important topic mentioned below:
Crarity and Simplicity of Expression: In the early days most of the computer programs were written to carry out difficult and complex calculations. It is not so any more. However, you may still have to write programs involving complex calculations.
It is advised that if any expression becomes very big or very complex then you must write the same in two steps rather then doing it in one single step. This will make the expression simple and any programmer will be more accurate in writing simple expressions.
Simple expressions are also easily readable and can be understood by others without making any extra efforts. For example, a Statement like :
A = square root((xy/d)+(c+z)2 – (u*v) )/L may be written in two steps as :
A1 = xy/d
A2 = (c+z)2
A3 = u * v
A = square root(Al + A2 – A3)/L
Program maintenance is an important duty of programmers. It involves all steps from problem definition to program preparation. In certain organizations, programmers can do nothing but maintain the programs.
At the initial stage of computerization, an organization’s programming effort mostly goes into the development of new applications. As the number of installed programs grows, the programming effort shifts from program development to program maintenance, in fact, in many organizations, more than half of the programming effort is on program maintenance. An estimate shows that the cost of program maintenance is twice larger than that of initial development.
Define Clarity of source code.
The extent to which inherent language features support source code that is readable and understandable and that clearly reflects the underlying logical structure of the program.
Explain clarity of expression
Answer: Clarity refers to the overall readability of the program, with emphasis on program logic. It allows other programmers to follow the program, if the program is written clearly. It also makes the programmer to grasp his or her own program logic even after a long period of time.
Give an example of clarity of expression.
Suppose we wish to write a program to calculate the area of a circle. We require two variables; radius and area. Instead of writing r and a to represent the radius and area respectively, we use radius and area to represent themselves. It increases the readability of program, Similarly, the constant can be written as pi instead of denoting by p.
Explain types of comments.
There are two types of comments in a C+ + program; single line comment and multi-‘line comment. Single line comment begin with double slash (/ /) and end in the same line. We can write a program statement and a comment in same line. Whatever written after the / / is ignored by the compiler.
Write any two characteristic of comments.
Comments are not executed in a program. Since the compiler ignores comments, there will be no increase in the file size and execution time.
Write any two purpose of comments.
Indentation refers to the insertion of extra blank , spaces before declarations and statements. It enhances the readability of programs.
Explain logical error.
A logic error is a defect in the program that causes it to produce an incorrect result, but one that is not so blatant as to be detectable as a runtime error. (A logic error in one part of the program might eventually trigger a runtime error in some other part of the program, but those are separate errors.) An example would be a function that is supposed to return the larger of its two arguments but in fact returns the smaller:
def larger(m, n):
if (m > n):