1 Pertemuan 25 Bahasa-bahasa Pemrograman Matakuliah: T0604-Pengantar Teknologi Informasi Tahun: 2008...

Preview:

Citation preview

1

Pertemuan 25

Bahasa-bahasa Pemrograman

Matakuliah : T0604-Pengantar Teknologi Informasi

Tahun : 2008

Versi : 2.0/0.0

Williams, B.K, Stacy C. Sawyer (2007). Using Information Technology: A Practical Introduction to Computers & Communications. Seventh Edition, McGraw-Hill, New York. ISBN-13: 978-0-07-110768-6

Sumber: Chapter 10. System Analysis & Programming: S/W Development, Programming, & Languages, p.497

2

Learning Outcomes

Pada akhir pertemuan ini, diharapkan mahasiswa

akan mampu :

• menjelaskan apa itu pemrograman dan langkah-langkah dalam pemrograman (C2)

3

Outline Materi

• Programming: A Five-Step Procedure

• 5 Generations of Programming Languages

• Programming Languages Used Today

10-4

Programming: A Five-Step Procedure

• A program is a list of instructions that the computer must follow to process data into information

• The five steps are1. Clarify/define the problem

a. Clarify the program objectives & usersb. Clarify outputsc. Clarify inputsd. Clarify processing taskse. Study the feasibility of the programf. Document the analysis

2. Design the program3. Code the program4. Test the program

10-5

Programming: A Five-Step Procedure

• Step 2: Design the program– Create an algorithm or set of steps to solve the

problem• Traditional structured programming approach

– Determine program logic using top-down approach & modules– Design details using pseudocode or flow charts

• Alternative object-oriented approach– Use “Use Case” approach to determine program objects, object

inheritance, and actions or functions each object can perform– Identify major program components and organize related

functions and associated data into object classes– This is the approach used by object-oriented languages such

as Java, C#, Lisp, Visual Basic, and C++– For more information on object-oriented programming, visit

http://oopweb.com/ or http://java.sun.com/docs/books/tutorial/java/concepts/

10-6

Programming: A Five-Step Procedure

• A hierarchy chart

10-7

Programming: A Five-Step Procedure

• Panel 10.13

• Pseudocode

START

DO WHILE (SO LONG AS) THERE ARE RECORDS

Read a customer billing account record

IF today’s date is greater than 30 days from

date of last customer payment

Calculate total amount due

Calculate 5% interest on amount due

Add interest to total amount due to calculate

Grand total

Print on invoice overdue amount

ELSE

Calculate total amount due

ENDIF

Print out invoice

END DO

END

10-8

Programming: A Five-Step Procedure

● PANEL 10.14Example of a programflowchart andexplanation offlowchart symbolsThis example represents aflowchart for a payrollprogram.

10-9

Programming: A Five-Step Procedure

• Iteration and sequence

control structures

10-10

Programming: A Five-Step Procedure

• Step 3: Code the program– Translate the logic requirements into a programming

language– Programming language is a set of rules that tells the

computer what operations to do– Each programming language has a syntax, or set of

grammatical rules to follow to write valid expressions• Syntax rules must be followed or there will be

syntax errors• Computers don’t understand what you want, only

what you type in

10-11

Programming: A Five-Step Procedure

• Step 4: Test the program– Desk checking is done by the programmer who

checks for syntax errors and logic errors– Debugging is the process of detecting, locating, and

removing all errors in a computer program– Beta testing is the process of testing the program

using real data• One phase of testing uses correct data• Once the program works, the next phase of

testing uses invalid data and untrained users to root out hidden errors

10-12

Programming: A Five-Step Procedure

• Step 5: Document & Maintain the program– Documentation is written descriptions of what a program is and

how to fix it– There are several types of documentation that should be written

• User documentation – for the people who will use your program

• Operator documentation – for the people who run the large computers the program runs on – so they know what to do if the program or computer malfunctions

• Programmer documentation – for the next programmer who must modify and maintain what you have written

– Maintain the program• Fix any errors that are noticed once the program is in

production• Update the program to reflect new requirements

13

Kesimpulan

Recommended