Program Mengitung jumlah huruf,kecil,kapttal,spasi,konsonan dan vokal dgn QB

‘ NOVITA DWI WULANDARI

DIM mk AS STRING, A AS INTEGER, b(50) AS STRING, c(50) AS STRING
DIM VK AS INTEGER, sp AS INTEGER, ks AS INTEGER, HB AS INTEGER, hk AS INTEGER

CLS
COLOR 5

INPUT “silakan masukkan kata:”, mk
A = LEN(mk)

FOR I = 1 TO A
J = I

NEXT I

PRINT
PRINT
FOR I = 1 TO A

b(I) = MID$(mk, I, 1)
c(I) = UCASE$(b(I))
IF c(I) = “A” OR c(I) = “I” OR c(I) = “U” OR c(I) = “E” OR c(I) = “O” THEN
VK = VK + 1
ELSEIF c(I) = ” ” THEN
sp = sp + 1
ELSE
ks = ks + 1
END IF
IF c(I) = b(I) THEN
HB = HB + 1
ELSEIF c(I) b(I) THEN
hk = hk + 1
END IF

NEXT I
J = J – sp
HB = HB – sp

PRINT “Jumlah seluruh huruf=”; J
PRINT “Jumlah Huruf kecil = “; hk
PRINT “Jumlah Huruf Kapital = “; HB
PRINT “Jumlah Huruf Vokal = “; VK
PRINT “Jumlah Spasi = “; sp
PRINT “Jumlah Huruf Konsonan = “; ks

END

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s