Senin, 20 Oktober 2008

Segitiga Angka Terbalik

Menentukan dapat tidaknya diskon

Algoritma menentukan dapat tidaknya diskon
Deklarasi
x: integer
Deskripsi
read (x)
if (x > 100000)
write ("Dapat diskon")
else
write("Tidak dapat diskon")
endif

Menentukan Bil. Positif or Negatif

Algoritma menentukan bil. posifif or negtif
Deklarasi
x: integer
Deskripsi
read (x)
if (x > 0)
write ("Bil. Positif")
else if (x<0)
write ("Bil. Negatif")
else
write("bil. netral")
endif
~Program dan Output

Menentukan Bil. Terbesar

Algoritma bil. terbesar
Deklarasix, y: integer
Deskripsi
read (x)
read (y)
if (x > y)
write ( x )
else if (x < y)
write ( y )
else
write("bil. sama besar")
endif

~Progrm dan Output

Selasa, 14 Oktober 2008

Segitiga (TM4)

~Algoritma

Deklarasi
tinggi, baris, colom : integer
tinggi : 3
Deskripsi
for baris <- 1 to tinggi do
for colom <- tinggi down to baris
write("*")
colom <- colom-1
baris <- baris+1
~Flowchart

~Program dan Output