ch-2
ch-2
7. Define documentation.
Ans: The documentation includes the problem definition, design documents, a
description of the test perform, a history of the program development and its
different versions and a
user‟s manual.
Such a manual is designed for a naive user and illustrates the preparation of
input data, running the program and obtaining & interpreting the results.
8. What is program maintenance?
3
Ans: All activities that occur after a program operation are part of the program
maintenance.
Many large programs have long life span that often exceed the lifetime of the
hardware they run on.
Usually, the expenditure for the program maintenance will be more than the
developmental cost of the program
9. Define modular programming.
Ans: Modular Programming is the act of designing and writing programs as
functions (a large program is divided into the small individual components) that
each one performs, a single well-defined function, which has minimal
interaction between the sub-programs.
It means that the content of each function iscohesive and there is low coupling
between them.
There are two methods available for modular programming. They are: top-
down design and bottom-up design.
10. Differentiate between top down and bottom up methods of modular
programming.
Top-Down design Bottom-up design
The principles of top-down design Bottom-up design is just the opposite of top-
dictate that a program should be down design.
divided into a main module and It refers to a style of programming, in which,
its related module. an application is constructed with existing
Each module should also be primitives of the programming language and
divided into sub modules then gradually more and more complicated
according to software features are added till applications are written.
engineering and programming In other words, initiating the design with
style. simple modules and then build them into more
The division continues till the complex structures ending at the top is bottom-
module consists only of an up design
elementary process that is
intrinsically understood and
cannot be further sub-divided.
11. Explain types of errors with examples.
Ans: There are three types of errors generally occur during compilation and
running a program. They are
(i) Syntax error; (ii) Logical error; and
(iii) Runtime error.
12. How to maintain programs?
Ans: The program maintenance includes the following:
Finding and eliminating previously undetected program errors;
Modifying the current program, often to improve its performance, or to adapt to
new laws or government regulations, or to adapt to a new hardware, or to a new
operating system;
Adding new features or a better user interface, or new capabilities to the program;
And Updating the documentation.
Maintenance is an important part of the life cycle of a program. It is also important as
far as documentation is concerned, since any change pertaining to a program will
require updating of internal as well as external documentation. Maintenance
documentation will include results of the program development steps, design
4
Evaluation
Finally, the result should be examined in order to make sure that it is valid and that
the problem has been solved completely.
17. What is indentation? Explain with an example.
Ans: Leading white space (spaces and taps) at the beginning of each statement,
which is used to determine the group of statement, is known as „indentation‟.
Example
If A > B :
print „A is Big‟ # Block1
else:
print „B is Big‟ # Block2
In the above example,
if statements are a type of code block. If the „if‟ expression evaluates to true, then
Block1 is executed, otherwise, it executes Block2. Obviously, blocks can have
multiple lines. As long as they are all indented with the same amount of spaces, they
constitute one block.
18. What do you mean by debugging?
Ans: Debugging is the process of finding and correcting the errors in the program
code.
19. What is the use of self documenting code in programming?
Ans: The source code, which uses suitable name for the identifiers (variables and
methods), is called self-documenting code. Also, giving proper name for variables
and methods would tell the reader of your code clearly -what is it doing? Hence, a
good program must have a self-documenting code.
20. What is the purpose of giving meaningful name for identifiers?
Ans: A name is associated with a function or data object (constants and variables) and
used to refer to that function or data object, . Also, giving proper name for variables
and methods would tell the reader of your code clearly -what is it doing?
**************************************************************