pert15 pemrograman copy

Upload: bagus-fatkhurrozi

Post on 04-Jun-2018

236 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/13/2019 Pert15 Pemrograman Copy

    1/24

    Pemrograman

    1

    Williams, B.K, Stacy C. Sawyer (2007).Using Information Technology: APractical 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.463

  • 8/13/2019 Pert15 Pemrograman Copy

    2/24

    Learning Outcomes

    Pada akhir pertemuan ini, diharapkan mahasiswaakan mampu :

    menjelaskan apa itu pemrograman dan

    langkah-langkah dalam pemrograman(C2)

    2

  • 8/13/2019 Pert15 Pemrograman Copy

    3/24

    Outline Materi

    Programming: Procedural Clarify/define the problem Design the program

    Code the program Test the program Document and maintain the program

    Programming: OOP

    3

  • 8/13/2019 Pert15 Pemrograman Copy

    4/24

    Programming: A Five-Step Procedure

    A program is a list of instructions that the computermust 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-4

  • 8/13/2019 Pert15 Pemrograman Copy

    5/24

    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 objectcan perform

    Identify major program components and organize relatedfunctions and associated data into object classes

    This is the approach used by object-oriented languagessuch as Java, C#, Lisp, Visual Basic, and C++

    For more information on object-oriented programming,visit http://oopweb.com/ orhttp://java.sun.com/docs/books/tutorial/java/concepts/

    10-5

    http://oopweb.com/http://java.sun.com/docs/books/tutorial/java/concepts/http://java.sun.com/docs/books/tutorial/java/concepts/http://oopweb.com/
  • 8/13/2019 Pert15 Pemrograman Copy

    6/24

    Programming: A Five-Step

    Procedure A hierarchy chart

    10-6

  • 8/13/2019 Pert15 Pemrograman Copy

    7/24

    Programming: A Five-StepProcedure

    Panel 10.13 Pseudocode

    10-7

    STARTDO WHILE (SO LONG AS) THERE ARE RECORDS

    Read a customer billing account record

    IF todays date is greater than 30 days from

    date of last customer payment

    Calculate total amount dueCalculate 5% interest on amount due

    Add interest to total amount due to calculate

    Grand total

    Print on invoice overdue amount

    ELSE

    Calculate total amount dueENDIF

    Print out invoice

    END DO

    END

  • 8/13/2019 Pert15 Pemrograman Copy

    8/24

  • 8/13/2019 Pert15 Pemrograman Copy

    9/24

    Programming: A Five-StepProcedure

    Iteration and sequencecontrol structures

    10-9

  • 8/13/2019 Pert15 Pemrograman Copy

    10/24

    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 syn tax , or set of

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

    syntax errors Computers dont understand what you want , onlywhat you type in

    10-10

  • 8/13/2019 Pert15 Pemrograman Copy

    11/24

    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 usersto root out hidden errors

    10-11

  • 8/13/2019 Pert15 Pemrograman Copy

    12/24

    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 yourprogram

    Operator documentation for the people who run the largecomputers the program runs on so they know what to do ifthe program or computer malfunctions

    Programmer documentation for the next programmer whomust modify and maintain what you have written

    Maintain the program Fix any errors that are noticed once the program is inproduction

    Update the program to reflect new requirements

    10-12

  • 8/13/2019 Pert15 Pemrograman Copy

    13/24

    Object-Oriented & VisualProgramming

    In Object oriented Programming (OOP) data andprocessing instructions are combined into anobject that can be reused Object

    Self-contained module consisting of reusable code

    Message The instruction received by the object indicating it is time to

    perform an action

    Method The processing instructions within the object to perform thespecified action

    10-13

  • 8/13/2019 Pert15 Pemrograman Copy

    14/24

    Object-Oriented & VisualProgramming

    Black Box Objects are like a black box in that the

    actions and the objects are specified, butthe methods used are internal to the object

    This means the programmer that uses an object does notneed to know how the program inside the object does what itdoes

    For example, Microsoft Excel is like an object Most of us use Excel without understanding what the programmers

    at Microsoft did to make Excel work If we had to know that, it would take a lot longer to learn how to use

    Excel! Programmers who use objects can write programs a lot faster,

    because objects save so much work

    10-14

  • 8/13/2019 Pert15 Pemrograman Copy

    15/24

    Object-Oriented & VisualProgramming

    3 basic concepts of OOP Encapsulation

    One object contains (encapsulates) both Data Relevant processing instructions

    Inheritance One object can be used as the foundation for other objects Objects can be arranged in hierarchies classes and

    subclasses Objects can inherit actions and attributes from each other

    Polymorphism Allows a single definition to be used with different data typesand different functions

    Means a message produces different results depending onthe object it is sent to

    10-15

  • 8/13/2019 Pert15 Pemrograman Copy

    16/24

    Object-Oriented & VisualProgramming

    DoorsHave a Handle

    openclose

    Patio doors

    Have a slider slide open

    slide closed

    Front doors

    Have locks

    Car doorsHave locks

    Have windows

    10-16

    The Doorclass

    Actionsperformed by

    a door

    Subclasses ofdoors inheritfrom the doorclass, but alsohave their ownunique actionsand attributes

    Notice we only list theactions & attributes whenthey differ from those of

    class

    Example of

    InheritanceHierarchy withSpecialization

  • 8/13/2019 Pert15 Pemrograman Copy

    17/24

    Object-Oriented & VisualProgramming

    Visual Basic is an example of visualprogramming Using a mouse, the programmer drags and drops

    objects on screen

    The objects are arranged to make up the graphicaluser interface for the program being written By double-clicking on those objects, the programmer

    can get into a coding window and write the programsto control the actions and behaviors of those objects

    This makes it fast and easy to build prototype userinterfaces and get end-user approval before doing alot of programming

    10-17

    If you have Visual Basic installed on your schools computers, this would be agreat time to try it out.

  • 8/13/2019 Pert15 Pemrograman Copy

    18/24

    Markup & ScriptingLanguages

    A markup language is a kind of coding or tagsinserted into text that embeds details about thestructure and appearance of the text.

    Open up a text editor such as Notepad orWordpad, and enter the following text:

    Then save the file on your desktop. Name it sample.htm Now open your internet browser and view it by clicking file open

    and navigating to your desktop

    10-18

    My name is your name

    And I love this class!!!

  • 8/13/2019 Pert15 Pemrograman Copy

    19/24

    Markup & Scripting Languages

    So how did this Turn into this?

    By HTMLtags

    10-19

    My name is your name

  • 8/13/2019 Pert15 Pemrograman Copy

    20/24

    Markup & Scripting Languages

    HTML Hypertext markup language Used to create web pages Also lets you insert a hypertext link in a web page

    VRML Virtual Reality Modeling for Markup Language is used

    to create three-dimensional web pages includinginteractive animation

    Requires special VRML browser to view those pages

    10-20

  • 8/13/2019 Pert15 Pemrograman Copy

    21/24

    Markup & Scripting Languages

    XML eXtensible Markup Language is a metalanguage

    written in SGML that allows one to facilitate easydocument interchange on the internet

    XML lets you create your own tags XML statements define data content

    JavaScript Not the same language as Java An object-oriented scripting language that adds

    interactive functions to web pages

    10-21

  • 8/13/2019 Pert15 Pemrograman Copy

    22/24

    Markup & ScriptingLanguages

    ActiveX Developed by Microsoft as an alternative to

    Java for creating interactivity on web pages A set of controls or components that enable

    programs or content of almost any type to beembedded in a web page

    Often used by crackers to propagate virusesand/or trojans

    Before you allow an ActiveX component todownload from your browser to your PC,make sure you trust that website!

    10-22

  • 8/13/2019 Pert15 Pemrograman Copy

    23/24

    Markup & ScriptingLanguages

    Perl A general-purpose programming language

    developed for text manipulation.

    Developed in 1987 by Larry Wall Now used for web development, network

    programming, system administration, GUIdevelopment, other tasks

    Widely used for web server programs toperform automatic tasks such as updatinguser accounts and newsgroup postings

    10-23

  • 8/13/2019 Pert15 Pemrograman Copy

    24/24

    Kesimpulan

    24