-->

Sep 3, 2009

Designing Computer Program Algorithm



The algorithm is a formula or a series of steps to solve a particular problem. To be an algorithm, a set of rules should not be ambiguous and have time to stop the clear. We use algorithms every day. For example, a recipe for baking bread is an algorithm. Most of the programs, except for some artificial intelligence applications, consist of algorithms. In computer programming there is often a different algorithm to solve a given problem, in different circumstances of each algorithm have the advantages and disadvantages of its own. Finding an elegant algorithms -algorithms are simple and with few possible measures is a major challenge in programming.


The algorithm can be applied in various ways. In step program design, software designed in two small steps. First, determine the logic of the program through a top-down approach and modularization, using the chart hierarchy. Next, design the program logic in detail, both in terms of narrative, use traditional pseudecode, or graphically, using flow charts.


Very useful when a programmer uses an approach based on personal experience for programming. Programming is considered as an art, not science. However, now most programmers use a design approach called structured programming. Structured programming using top-down approach that breaks the program into the form of modules, and using standard logic devices called control structures (sequence, selection, and iteration case - sequence, selection, and iteration case).


The main objective of structured programming is to make the program more efficiently (with fewer lines of code) and more organized (more readable) and have the notation better, so having a clear description and correct.


1. Determine logic programs using top-down approach.


Determining the program logic, the same as the outline before you start writing theses. Design top-down programs conducted by elements of the process of identification, or modules, of a program and then solve them in order until the lowest level of detail. This design is used to perform the identification process of the program process steps, or modules. After the program was designed, the real coding was done from the bottom up by using the modular approach.


Modularization: modularization concept is very important. Modularization is very simple in the development of the program. because each part can be developed and tested separately. This module is a step of a program poses. Each module consists of program statements that have logical relationships. (Sometimes called sub-module or sub-routine program). Examples of modules can be programming instructions that simply say "Not a file, a record, and display on the display screen". It would be better if each module has only one function, just as the paragraph in the sentence "should have a complete thought". These rules limit the size and complexity of the module.


Program design top-down: The design of the program (top-down) can be described in a hierarchy chart. One chart hierarchy, or structure charts, describes the overall program objectives, with the identification process on all the modules required to achieve these great goals and relationships between modules. This chart works ranging from general to specific, starting from top level (high level) who saw something that must be done by a program. Furthermore, each layer to improve and expand the previous layer until the lower level can be made into a special programming modules. The program must run in order from one module to the next module until it is processed. There are three main modules that one street with three major operations of a computation -input, process and output.


2. Design in detail using or pseudecode and flowcharts.


After determining the logic of the program, then you can do in detail by using top-down programming and the hierarchy. There are two ways to create detail - to write and create images using pseudecode or flowcharts. Most projects use both.


Pseudecode:

Pseudecode is something program design method using human language statement to make description logic and flow of the process. Pseudecode as a framework or a form of a summary of the program you write.


Sometimes pseudecode only used to describe a particular purpose programming modules and general terms. By using terms such as IF, THEN, or IF NOT, pseudecode follow the rules of the control structure, an important aspect of structured programming.


Program flow chart:

Program flow chart is a chart that graphically displays the details of a series of steps (algorithm, or flow logic) needed to solve programming problems. This flow chart using standard symbols - symbols called ANSI (American National Standards Institute), who developed the institution symbol.


The symbol on the left of the image will appear clear. However, how do you see the logic of a program? How do you learn a program that really works? The answer is to use the control structure, as will be explained below.


Structure Control: When you define the logic behind something, you use words like if and then, later if not. (For example, without using the words above, you will learn the following lines: "If he comes, then we'll watch a movie, if not, I'll just tingal home and watch TV"). Control structure is also using words the same. Control structure or logical structure is a structure that controls the logical sequence in which instructions in the program execution. In designing a structured program, there are three control structures used to build the logic of a program, namely sequence, selection and iteration (or loop). This is the device you use to write structured programs and programming work outside. (Additional variations of the three basic structure is also used).


Comparing Three Third Control Structure in general control structure has one input and one expenditure. Control structure is inserted at a point and issued to another point. This helps to simplify the logic so that others can easily follow the trail of programmers to create programs to run. (Before this provision was passed, the programmer can have many variations, which leads to programs that can not understand the so-called spaghetti code.)


Let us consider three such controls.


Sequence control structure: The structure of control sequences, a statement of the other programs follow a logical sequence. Such as the example shown in the figure, there are two boxes ( "Statement" and "Statement"). One box might read "Open Files", and the other "Read A Record". No decisions have been made, there is no choice between "yes" or "no". Box logically follow one another in a sequential order.


Control structure selection: selection control structure -also called stricture IF - THEN -IF NOT - make a presentation option. This structure is applied followed by two lines when the program must make a decision. Sample selection structure is:


IF an employee work hours in one week is more than 40
THEN overtime hours equal to the number of hours to be the difference.


IF NOT employees do not have overtime hours.


Variation structure usual selection control is a case control structure. This structure offers more than one decision "yes or no". The structure of this case provides an alternative, or cases that can be displayed. (1case occurred IF, THEN do, 2 cases occurred IF, THEN follow the alternative "And so on.) Structure of control if a programmer does not have to make so many indications of the condition of IF-THEN-IF NOT separately.


Iteration control structures: In the selection of control structure, or a loop control structure, a process can be repeated as long as his condition remains true. There are two types of iterations strutur - DO UNTIL and DO WHILE. In this case, DO UNTIL dugunakan more often.


Example DO UNTIL structure is as follows:


Read employee records DO UNTIL there are no more employee records.


DO WHILE struktru examples are as follows:


Do employee records while [that is, as long as] there continue to be employee records.
What is the difference from the second iteration structure that? Here's why: if several statements necessary, you must decide when to stop repeating it. You can stop it at the beginning of the loop, by using the structure of DO WHILE. Or it can end at the end of the loop, by using the structure DO UNTIL. DO UNTIL iteration loop means the statement to be executed at least once, because in this case the iteration statement is executed before the program checks to stop.


Under Computer Science (CS)

Writted by : Kangmus // 12:44 AM
Kategori:

19 comments:

  1. HEHEHE pertamaaaaaaaaaaaaaaxxxxxzz

    ReplyDelete
  2. manstaaaaaaaaaaaabbbbsssss

    ReplyDelete
  3. hehehehe tulisan yang bagus hanya bahasa inggeris nya berat eeuy hehehe

    ReplyDelete
  4. SAHABATKU RAIH FITRAH DIRI menjadi MANUSIA SEUTUHNYA UNTUK MENGEMBALIKAN JATI DIRI BANGSA
    Salam Cinta Damai dan Kasih Sayang ‘tuk Sahabat Sahabatku terchayaaaaaank
    I Love U fulllllllllllllllllllllllll

    ReplyDelete
  5. Jika ada Mahasiswa di jurusan Komputer... yang pasti Web ini WAJIB menjadi referensi nya :)

    ReplyDelete
  6. waduh.... bahasanya ingrisnya berat banget. Pusing....?#@!

    ReplyDelete
  7. wah, bahasa algorithma itu yang bikin kepala saya serimng pusing, mas, hehe ... ndak mudheng2 saya, haks.

    ReplyDelete
  8. Ohoiii ... ngomong sunda aja ... or ... jowo ae ... :)

    ReplyDelete
  9. YAYAYAYA PAKE BAHASA SUNDA LEBIH KEREN

    ReplyDelete
  10. Salam Cinta Damai dan Kasih Sayang ‘tuk Sahabat Sahabatku terchayaaaaaaaaaank
    I Love U fulllllllllllllllllllllllllllllllllll

    ReplyDelete
  11. Algoritma?. Kepala saya selalu pening jika ketemu dengan yang satu ini. Apalagi ditulis dengan bahasa inggris...

    ReplyDelete
  12. Selamat idul fitri.
    Semoga kita semua keluar sebagai pemenang setelah sebulan penuh menjalankan ibadah puasa.
    Mohon maaf jika selama ini ada salah dan khilaf.
    Taqoballahuminna wa minkum. Minal aidzin wal faizin.

    Jangan lupa zakat fitrahnya!

    ReplyDelete