Anda di halaman 1dari 39

An Overview of Computer, Logic,

and Software Development


Minggu 1

Program Studi S1 Sistem Informasi


Fakultas Teknologi Informasi dan Industri
Institut Teknologi Telkom Surabaya
Tim Dosen (continued)

Nama Agus Sulistya Yupit Sudianto

Kelas IS-04-01 IS-04-02

Program Studi Sistem Informasi Sistem Informasi


Social Computing, Maching
Bidang Keahlian Learning, Empirical Enterprise Architecture, IoT
Software Engineering
sulistya@ittelkom-
Email yupit@ittelkom-sby.ac.id
sby.ac.id

ALGORITMA DAN PEMROGRAMAN


Tim Dosen

Nama Mochamad Nizar Palefi Ma'ady

Kelas IS-04-03, IS-04-04

Program Studi Sistem Informasi

Bidang Keahlian Visualisasi, Sains Data, Riset Operasi

Email nizar@ittelkom-sby.ac.id

ALGORITMA DAN PEMROGRAMAN


Aturan Kuliah

o Jika ada yang ingin ditanyakan atau didiskusikan,


mahasiswa diperbolehkan mengirim whatsapp
dengan aturan sebagai berikut:
− Gunakan bahasa yang baik, benar, dan sopan.
− Diawali dengan tulisan nama pengirim.

o Jika ada keperluan disampaikan sebelum


perkuliahan.

ALGORITMA DAN PEMROGRAMAN


Reference Book

o Main
1. Joyce Farrell (2015). Programming Logic and Design
Comprehensive Version (8th ed.).
2. Swaroop C H. (2017). Byte of Python.
3. William Punch dan Richard Enbody (2013) The Practice of
Computing (2nd ed)
o Supporting
1. Tony Gaddis (2013). Programming Logic and Design (3rd ed).

ALGORITMA DAN PEMROGRAMAN


Rencana Pembelajaran Semester (RPS)
No. Minggu Bentuk Pembelajaran Materi Bobot Nilai

Pengenalan Komputer, Bahasa Pemrograman, Algoritma,


1 Minggu 1 Kuliah Daring 5%
Flowchart

Kuliah Daring Sejarah Python, Pengenalan Python, Hello World, Variabel,


2 Minggu 2 5%
Operator, Input, Output
Praktikum Daring
Kuliah Daring
3 Minggu 3 Flowgorithm, Percabangan 5%
Praktikum Daring
Kuliah Daring
4 Minggu 4 Flowgorithm, Perulangan 5%
Praktikum Daring
5 Minggu 5 Kuis Materi Minggu 1 - 4 5%
Kuliah Daring
6 Minggu 6 Array, List, Tuple, Set, Dictionary 5%
Praktikum Daring
Kuliah Daring
7 Minggu 7 Fungsi, Local Variabel, Global Variabel, Return Value 5%
Praktikum Daring
8 Minggu 8 UTS 25%

ALGORITMA DAN PEMROGRAMAN


Rencana Pembelajaran Semester (RPS)
(continued)

No. Minggu Bentuk Pembelajaran Materi Bobot Nilai

9 Minggu 9 Kuliah Daring Python untuk dunia industri -


Kuliah Daring
10 Minggu 10 Class, File 5%
Praktikum Daring
Kuliah Daring
11 Minggu 11, 12, 13 Searching dan Sorting 10%
(Small Group Discussion)
Kuliah Daring
12 Minggu 14, 15 Final Project
(Project Based Learning) 25%
13 Minggu 16 UAS

ALGORITMA DAN PEMROGRAMAN


Outline

o Understanding Computer Components and Operations


o Understanding the Programming Process
o Using Flowchart Symbols and Pseudocode Statements
o Using and Naming Variables
o Managing Large Flowcharts
o Assigning Values to Variables

ALGORITMA DAN PEMROGRAMAN


Understanding Computer Components and
Operations
o Hardware and software: the two major components of any
computer system
o Hardware: equipment or devices
o Software: programs that contain instructions for the computer
o Four major operations in a computer:
− Input
− Processing
− Output
− Storage

ALGORITMA DAN PEMROGRAMAN


Understanding Computer Components and
Operations (continued)
o Input devices: allow data to enter the computer
− Mouse, keyboard, scanner

o Processing: working on the data


− Organizing data
− Checking data for accuracy
− Mathematical or other manipulations on data

o Central Processing Unit (CPU): hardware that performs


the tasks

ALGORITMA DAN PEMROGRAMAN


Understanding Computer Components and
Operations (continued)
o Output devices: provide data to the user
− Printer, monitor, speakers

o Programming language: special language containing


instructions for the computer
− Visual Basic, Java, C#, C++, COBOL, Python

o Syntax: rules governing word usage and punctuation in


the language

ALGORITMA DAN PEMROGRAMAN 11


Understanding Computer Components and
Operations (continued)
o Machine language: controls the computer’s on/off
circuitry
o Compiler or interpreter: software that translates
programming languages to machine language
o Program must be free of syntax errors to be run, or
executed, on a computer.
o To function properly, the logic must be correct.

ALGORITMA DAN PEMROGRAMAN 12


Understanding Computer Components and
Operations (continued)
o What is wrong with this logic for making a cake?
Get a bowl
Stir
Add two eggs
Add a gallon of gasoline
Bake at 350 degrees for 45 minutes
Add three cups of flour

ALGORITMA DAN PEMROGRAMAN 13


Understanding Computer Components and
Operations (continued)
o Logic errors, or semantic errors, are more difficult to
locate than syntax errors
o Logic for multiplying a number by 2 (includes input,
processing, and output statements)
input myNumber
set myAnswer = myNumber * 2
Output myAnswer

ALGORITMA DAN PEMROGRAMAN 14


Understanding Computer Components and
Operations (continued)
o Two storage categories: internal and external
o Internal storage:
− Main memory, random access memory (RAM)
− Located inside the computer system
− Volatile: contents are lost when power goes down
o External storage:
− Persistent: contents are relatively permanent
− Floppy drive, hard drive, flash media, magnetic tape
− Located outside the computer system

ALGORITMA DAN PEMROGRAMAN 15


Understanding the Programming Process

o Seven programming phases:


1. Understand the problem
2. Plan the logic
3. Code the program
4. Use software to translate the program to machine language
5. Test the program
6. Put the program into production
7. Maintain the program

ALGORITMA DAN PEMROGRAMAN


Understanding the Programming Process

Understanding the Problem

o May be the most difficult phase


o Users may not be able to articulate their needs well
o User needs may be changing frequently
o Programmers may have to learn the user’s functional job
tasks
o Failure to understand the problem is the major cause of
most project failures

ALGORITMA DAN PEMROGRAMAN


Understanding the Programming Process

Planning the Logic

o Plan the steps that the program will take


o Use tools such as flowcharts and pseudocode
o Flowchart: a pictorial representation of the logic steps
o Pseudocode: Natural language representation of the
logic
o Walk through the logic before coding by desk-checking
the logic

ALGORITMA DAN PEMROGRAMAN


Understanding the Programming Process

Coding the Program

o Select the programming language


− Some languages more efficient for certain tasks
− All languages handle input, arithmetic processing, output, other
standard functions
− Logic can be executed in any number of languages

o Write the instructions


o Planning generally more difficult than coding

ALGORITMA DAN PEMROGRAMAN


Understanding the Programming Process

Use Software to Translate the Program into


Machine language
o Programmers write instructions in high-level languages
that resemble a natural language
o Compilers or interpreters change the programs into a
low-level machine language that can be executed
o Syntax errors are identified by the compiler or
interpreter

ALGORITMA DAN PEMROGRAMAN


Understanding the Programming Process

Use Software to Translate the Program into


Machine language (continued)

ALGORITMA DAN PEMROGRAMAN


Understanding the Programming Process

Testing the Program

o Execute it with sample data and check results


o Identify logic errors and correct them
o Choose test data carefully to exercise all branches of the
logic

ALGORITMA DAN PEMROGRAMAN


Understanding the Programming Process

Putting the Program into Production

o Might mean simply running the program once


o Process might take months if program is used on regular
basis or is part of larger development
- Train data-entry people and users
- Change existing data

o Conversion: entire set of actions organization must take


to switch over to new program(s)

ALGORITMA DAN PEMROGRAMAN


Using Flowchart Symbols and Pseudocode
Statements
o Flowchart: pictorial representation of the logic
o Pseudocode: English-like representation of the logic
− Example:
start
input myNumber.
set myAnswer = myNumber * 2.
output myAnswer.
stop

ALGORITMA DAN PEMROGRAMAN 24


Using Flowchart Symbols and Pseudocode
Statements (continued)

ALGORITMA DAN PEMROGRAMAN


Managing Large Flowcharts

o Flowchart connector symbol:


− Marks a logic transfer to another location in the flowchart
− Transfer location can be on the same page or on another page
− On-page symbol: a circle with a number or letter to identify the
matching transfer location
− Off-page symbol: a square with a pointed bottom, containing page
number and a number of letter to identify the matching transfer location

ALGORITMA DAN PEMROGRAMAN 26


Managing Large Flowcharts (continued)

Flowchart using the connector

ALGORITMA DAN PEMROGRAMAN 27


Using Flowchart Symbols and Pseudocode
Statements (continued)

Input symbol Processing symbol

Output symbol

ALGORITMA DAN PEMROGRAMAN 28


Using Flowchart Symbols and Pseudocode
Statements (continued)

Flowchart and pseudocode of program that doubles a number

ALGORITMA DAN PEMROGRAMAN 29


Using and Naming Variables

o Variable: a memory location whose contents can vary; also


called an identifier
o Each programming language has its own rules for naming
identifiers, including:
− Legal characters
− Maximum length
− Use of upper- or lowercase

o Variable name must be a single word, but can be formed


from several words
− rate, interestRate, interest_rate

ALGORITMA DAN PEMROGRAMAN


Using and Naming Variables (continued)

o Choose meaningful names for variables


o Improves the readability and maintainability of code

Suitability of suggested variable names for an employee’s last name

ALGORITMA DAN PEMROGRAMAN 31


Assigning Values to Variables
o Assignment statement:
− Assigns a value to a variable
− Variable must appear on the left side, value on the right side of
the assignment operator
− Right side may be an expression that will be evaluated before
storing the value in the variable
o Assignment operator: the equal sign (=) in most languages
o Variable:
− Memory location: has an address and a value
− Value (contents) is used for various operations

ALGORITMA DAN PEMROGRAMAN 32


Understanding Data Types

o Two basic data types:


− Text
− Numeric

o Numeric data stored by numeric variables


o Text data stored by string, text, or character variables
o Constants:
− Values that do not change while the program is running
− Have identifiers, and can be used like variables for calculations,
but cannot be assigned new values

ALGORITMA DAN PEMROGRAMAN 33


Understanding Data Types (continued)

o Some programming languages implement several


numeric data types, such as:
− Integer: whole numbers only
− Floating-point: fractional numeric values with decimal points

o Character or string data is represented as characters


enclosed in quotation marks
− “x”, “color”

o Data types must be used appropriately

ALGORITMA DAN PEMROGRAMAN 34


Understanding Data Types (continued)

Some examples of legal and illegal assignments

ALGORITMA DAN PEMROGRAMAN 35


Understanding the Evolution of Programming
Techniques
o Programming began in the 1940s, using memory
addresses and machine code directly
o Higher-level languages were developed to allow English-
like instructions
o Older programs were “monolithic,” and ran from
beginning to end
o Newer programs contain modules that can be combined
to form programs

ALGORITMA DAN PEMROGRAMAN 36


Understanding the Evolution of Programming
Techniques (continued)
o Two major programming techniques:
− Procedural programming
− Object-oriented programming
o Procedural programming: focuses on the procedures
that programmers create
o Object-oriented programming: focuses on objects that
represent real-world things and their attributes and
behaviors
o Both techniques employ reusable program modules

ALGORITMA DAN PEMROGRAMAN 37


Tugas 1 - Mandiri

o Tugas dikerjakan individu


o Dikumpulkan sebelum pertemuan Minggu 2

ALGORITMA DAN PEMROGRAMAN


Tugas 1 - Mandiri

1. Sebutkan dan jelaskan empat operasi utama


yang ada didalam komputer.
2. Sebutkan dan jelaskan kelebihan dan
kekurangan bahasa pemrograman yang anda
ketahui (minimal 3).
3. Sebutkan dan jelaskan 7 fase Pemrograman.
4. Gambarkan dan jelaskan notasi-notasi yang
digunakan dalam flowchart.

ALGORITMA DAN PEMROGRAMAN

Anda mungkin juga menyukai