Bahasa-bahasa Pemrograman Pertemuan 25

advertisement
Matakuliah
Tahun
Versi
: T0604-Pengantar Teknologi Informasi
: 2008
: 2.0/0.0
Pertemuan 25
Bahasa-bahasa Pemrograman
Sumber:
Chapter 10. System Analysis &
Programming: S/W Development,
Programming, & Languages, p.497
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-007-110768-6
1
Learning Outcomes
Pada akhir pertemuan ini, diharapkan mahasiswa
akan mampu :
• menjelaskan apa itu pemrograman dan
langkah-langkah dalam pemrograman
(C2)
2
Outline Materi
• Programming: A Five-Step Procedure
• 5 Generations of Programming Languages
• Programming Languages Used Today
3
Programming: A FiveStep Procedure
•
A program is a list of instructions that the computer must
follow to process data into information
• The five steps are
1. Clarify/define the problem
a.
b.
c.
d.
e.
f.
Clarify the program objectives & users
Clarify outputs
Clarify inputs
Clarify processing tasks
Study the feasibility of the program
Document the analysis
2. Design the program
3. Code the program
4. Test the program
10-4
Programming: A FiveStep 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-5
Programming: A Five-Step
Procedure
• A hierarchy chart
10-6
Programming: A Five-Step
Procedure
START
• Panel 10.13
• Pseudocode
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-7
Programming: A Five-Step
Procedure
● PANEL 10.14
Example of a program
flowchart and
explanation of
flowchart symbols
This example represents a
flowchart for a payroll
program.
10-8
Programming: A Five-Step
Procedure
• Iteration and sequence
control structures
10-9
Programming: A FiveStep 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-10
Programming: A FiveStep 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-11
Programming: A FiveStep 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
10-12
Kesimpulan
13
Download