You are on page 1of 6

LAPORAN TUGAS KE-I ALGORITMA DAN PEMROGAMAN ALGORITMA AND FLOWCHART #2

Disusun oleh : Jauhari Indra Pratama Kelas G 12520244006

PENDIDIKAN TEKNIK INFORMATIKA FAKULTAS TEKNIK UNIVERSITAS NEGERI YOGYAKARTA TAHUN 2013

Assingment 1. Write an algorithm in pseudocode that finds the average of two numbers 2. Write an algorithm to change a numeric grade to a letter grade. 3. Write an algorithm to find the largest of a set of numbers. You do not know the number of numbers. 4. Write an algorithm to find the largest of 1000 numbers.

The Answer 1. An algoritma that find average of two number a. Start b. Input data : n1,n2 c. Find the average : Sum(n1+n2) Average Sum/2 d. Save A e. Output A f. Finish
Start Start

Input n1,n2
Sum n1+n2 Average Sum/2 Save Average Output Average Finish Sum n1+n2 Average Sum/2 n1,n2

Average

Finish

2. An algoritm to change the numeric grade to a letter grade a. Start b. Input : n c. Change numeric to a letter grade : If n>=0 & n<50 then n=E ElseIf n>=50 & n<60 then n=D ElseIf n>=60 & n<75 then n=C ElseIf n>=75 & n<85 then n=B ElseIf n<=85 & n<=100 then n=A Else Nilai yang anda Masukkan Salah End If d. Save : n e. Output : n f. Finish
Start

Start Input n Do the following step : If n>=0 & n<50 then n=E Input n

ElseIf n>=50 & n<60 then n=D ElseIf n>=60 & n<75 then n=C ElseIf n>=75 & n<85 then n=B ElseIf n<=75 & n<=100 then n=A
Else Nilai yang anda Masukkan Salah End If Save n Output n

If n>=0 & n<50 then n=E

ElseIf n>=50 & n<60 then n=D ElseIf n>=60 & n<75 then n=C ElseIf n>=75 & n<85 then n=B ElseIf n<=75 & n<=100 then n=A
Else Nilai yang anda Masukkan Salah End IF

Output n

FInish

3. an algorithm to find the largest of a set of numbers. You do not know the number of numbers. a. Start b. Input : banyak data, data1,data2.----data ke-i c. Find the large number i 0 jbanyak data kdata1 pk+1 repeat the following step while i j : if k>l then y=k else y=l i=i+1 k=k+1 p=p+1 End While d. output : y e. Finish

start

Start

Input : banyak data, data1,data2.---data ke-i


Find the large number

Input : banyak data, data1,data2.---data ke-i i 0 jbanyak data kdata1 pk+1 repeat the following step while i j :if k>l then y=k else y=l i=i+1 k=k+1 p=p+1 End While
Output x

i 0 jbanyak data kdata1 pk+1 repeat the following step while i j : if k>l then y=k else y=l i=i+1 k=k+1 p=p+1 End While
output y Finish

4. An algorithm to find the largest of 1000 numbers a. Start b. Input : data1,data2,----,data ke-1000 c. Find the largest data i 1 j 0 p k data ke-i repeat the following step while j<=1000 : If k>k+1 then y =k Else y = k+1 i=i+1 End While d. Output : y e. Finish

start
Start Input data1,data2,----,data ke-1000 Find the large number

Input data1,data2,----,data ke-1000

i 1 j 0 p k data ke-i repeat the following step while j<=1000 : If k>k+1 then y =k Else y = k+1 i=i+1 End While
output y finish

i 1 j 0 p k data ke-i repeat the following step while j<=1000 : If k>k+1 then y =k Else y = k+1 i=i+1 End While i=i+1

Output y

finish

Daftar Pustaka
Kadir Abdul 2012 Algoritma dan pemrograman menggunakan Java Penerbit Andi Yogyakarta

You might also like