Beranda > KEAMANAN KOMPUTER > Program menghitung jumlah huruf

Program menghitung jumlah huruf

Program Pascal menghitung jumlah huruf dalam kalimat :

Code program:

program menghitung_jumlah_huruf_dlm_kalimat;

uses wincrt;

var n:array[1..26] of integer;

i,j:integer;

kata : String;

begin

writeln(‘           Tugas Keamanan Komputer               ‘);

writeln(‘=================================================’);

writeln(‘= Program menghitung jumlah huruf dalam kalimat =’);

writeln(‘= Oleh: 1. Moh Nasir             (070411100103) =’);

writeln(‘=      2. Rahmat aidil Fitri R. (070411100135)  =’);

writeln(‘=================================================’);

writeln(”);

for i:=1 to 26 do n[i]:=0;

write(‘Ketikkan sebuah kalimat : ‘);readln(kata);

writeln(”);

writeln(‘Jumlah tiap huruf dlm kalimat :’);

writeln(‘=============================’);

for i:=1 to length(kata) do

for j:=1 to 26 do

if ord(upcase(kata[i]))=64+j then

inc(n[j]);

for i:=1 to 13 do

writeln(chr(64+2*i-1),’ = ‘,n[2*i-1],’ ‘,chr(64+2*i),’=’,n[2*i]);

writeln(‘=============================’);

end.

Hasil Running Program

  1. Maret 14, 2010 pukul 3:32 am

    good job sir….!!!

  1. No trackbacks yet.

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

%d blogger menyukai ini: