Programming Methodology
Programming Methodology
Programming Methodology
Q. What is a program?
A program is a set of instructions developed to perform a task. Each
instruction acts as a command for the computer. A program is developed using a
programming language.
2. Run-time error: Run-time errors are those that appear while executing the
code. The code will have no syntax errors, but will not be executed.
In computers, a run-time error describes the operation of a computer
program, the duration of its execution, from beginning to termination. The
term is also used as a short form when referring to a runtime library, a
program or library of basic codes, that are used by a particular computer
language to manage a program written in that language while it is running
for example, the user might have correctly written a line of code to open a
file, but if the file is corrupted, the application cannot carry out the open
function, and it stops running. We can fix most run-time errors by rewriting
the incorrect code, compiling and then running it.
3. Logical error: Logical errors occur when desired or expected results are not
obtained during program execution due to bugs in code. With logical errors,
the program runs, but produces incorrect results. For example, the
programmer has used a division operator instead of multiplication operator
in a subroutine developed for income tax calculation and hence gives
incorrect output. Logical errors are generally the hardest type to fix, since it
is not always clear where they originate.
UNIT 4 PROGRAMMING METHODOLOGY PAGE |4
(JAVID AHMAD DAR: LEC. COMPUTER SCIENCE)
(OPTIONAL QUESTIONS)
Q. Define a flowchart.
A flowchart is a pictorial representation of an algorithm. A flowchart
presents two aspects of a program's logic:
1. The operations required to solve a problem.
2. The sequence in which these operations are to be performed.
This is done by using a set of symbols, each representing specific operation that
can be executed.
Connector: Represents an entry from, or an exit to, another part of the program
flowchart.