Sie sind auf Seite 1von 7

CHARACTERSTICS OF GOOD PROGRAMMING

The good programming must be implemented for the better solution of the problem. A program is called a good programming if it has some specific characteristics such as: Requires less space: The program must consume less space in the memory so that the execution does not consume much time. This can be done by using loops and conditions. Takes Less time to execute: The program must be written in such a way that the time consumed by it must be less.

Modification: The program must always be such that the modifications can be done easily. It must be as simple as possible so that it can be easily understood and modified. Portability: The program must run on all the machines without any changes or modifications.

8. TYPES OF ERRORS
There are four types of errors that can occur in the program Syntax Errors Semantic Errors Logical Errors Run Time Errors

Syntax Error Every programming language has a set of rules that must be followed. To write the code the exact method or rules are set. If any grammatical mistake or error is made by breaking the rules or method then it is called syntax error. Missing of semicolon (;), missing of brackets () can be syntax error. Semantic Error Any mistake made in the expression or logic of the code is called the Semantic error. If the expression C=a+b is written as a+b=c then it is a semantic error because the operation performed must be always written in right side. Logical Errors If the errors are made during the conditional or looping statements and the translation to the machine language creates error then the error is called the logical error. Run Time Errors The error may sometime cause during the runtime after the coding such errors are called runtime errors. Example can be if a division operation is performed and if the denominator value is given as zero then the answer cannot be found. Such error is called Divide by Zero Error. Ex: c=a/b If in this operation the user gives the b value as 0 then it causes run time error and program is not executed.

9. APPROACHES TO PROBLEM SOLVING


The problems in the system can be solved in many different approaches. The approaches in problem solving are: Top Down Design Stepwise Refinement Bottom Up Design Programming techniques Unstructured Programming

Procedural Programming Modular Programming Object Oriented Programming

Top Down Design Top-Down Design is a methodology that starts at the highest level of a design concept and proceeds towards the lowest level. The main problem is divided into sub problems and then again the sub problems are further divided until it becomes easy to find the solution.

The advantage of the top down analysis is that it provides dividing of the task and finding the solution of the task at the end. By this the solution can be found easily. Ex: Temperature conversion from centigrade to Fahrenheit.

Stepwise Refinement

In this kind of approach the problem is divided into steps and the solution is found in each step.

Bottom Up Design This approach is the opposite of the top down analysis. The bottom-up approach is most useful when the low-level details of the problem are known in advance, but the overall problem isnt necessarily. You start by taking procedures that you have already developed (reusing them), and connecting them together so as to produce a new procedure that solves a more complex problem. These new procedures can then be combined to produce solutions to yet more complex problems, and so on. The disadvantage of the approach is that it the details of the low level must be known before. Programming techniques The following programming techniques can be used to solve the problem:

Unstructured Programming A program in a non-structured language usually consists of sequentially

ordered commands, or statements, usually one in each line. The lines are usually numbered or may have labels: this allows the flow of execution to jump to any line in the program. The unstructured programming has lots of disadvantages when the program is large.

Procedural Programming

Procedural language is a computer programming language that specifies a series of well-structured steps and procedures within its programming context to compose a program. It contains a systematic order of statements, functions and commands to complete a computational task or program. Procedural language segregates a program within variables, functions, statements and conditional operators. Procedures or functions are implemented on the data and variables to perform a task. These procedures can be called / invoked anywhere between the program hierarchy and by other procedures as well. A program written in procedural language contains one or more procedures.

Procedural language is one of the most common programming languages in use with notable languages such as C/C++, Java, ColdFusion and PASCAL.

Modular Programming In this type of programming the complicated problem is divided into small unit called as modules. The module contains certain part of the coding which performs the operation. By this the program works in a effective way and it is easy find the errors of the program.

The advantages of using modular programming: Fewer bug because each set of programming commands is shorter Algorithm is more easily understood Many programmers can be employed, one on each of the modules Programmers can use their expertise on particular techniques

Testing can be more thorough on each of the modules Allows library programs to be inserted All of which saves time and means the finished program can be completed more quickly

Object Oriented Programming

Structured programming is a subset of procedural programming that enforces a logical structure on the program being written to make it more efficient and easier to understand and modify. Structured programming frequently employs a top-down design model, in which developers map out the overall program structure into separate subsections. A defined function or set of similar functions is coded in a separate module or sub module.

Das könnte Ihnen auch gefallen