Get Gifs at CodemySpace.com


------------------------------------------------------


Get Gifs at CodemySpace.com



---------------------------------------------------------
<html> <title>Membuat program kalkulator sederhana menggunakan textbox 

Jumat, 07 Oktober 2011

Pascal

uses wincrt; var i:integer; begin For i:=1 to 5 do begin writeln (i); writeln ('pascal'); end; end.

Tugas..............!!!

program no_1; Uses Wincrt ; Var I : Integer ; K : String ; Begin Writeln ('Masukkan kalimat yg akan ditampilkan :') ; Readln (K) ; Writeln ('Masukkan jumlah penampilan :') ; Readln (I) ; For I := 1 To I Do Writeln (k) ; End. Program no_2; Uses Wincrt ; Var I,J : Integer ; K,K2 : String ; Begin Writeln ('Masukkan kalimat yg akan ditampilkan :') ; Readln (K) ; Writeln ('Masukkan kalimat kedua yg ditampilkan :') ; Readln (K2) ; Writeln ('Masukkan nilai 1 :') ; Readln (I) ; Writeln ('Masukkan nilai 2 :') ; Readln (J) ; For I := 1 To I Do Begin For J := 1 To J Do Write (K :8 , K2 :3) ; Writeln ; End; End.¬¬ Program No_3; Uses Wincrt ; var num :array[1..10] of longint; i,j,n,batas:integer; begin readln(n); num[1]:=1; writeln(1); for i:=1 to n do begin batas:=(i+1) div 2; if not odd(i) then num[batas+1]:=num[batas]*2; for j:=batas downto 2 do num[j]:=num[j]+num[j-1]; for j:=1 to batas do write(num[j],' '); if not odd(i) then write(num[batas+1],' '); for j:=batas downto 1 do write(num[j],' '); writeln; end; end.¬¬ Program no_4; Uses wincrt; Var x,i,j : integer; Begin j := x*i; Readln (x); For i := j*i to x do Writeln (i:8, i*x:8); i := j*x; Readln (i); For i := x*j to i do i := x * j; For j := i*x to j do j := i * x; For x := j*i to x do x := j * i; Writeln (x); readln (j); End. Program No_4; uses wincrt; var matriks1, matriks2, matriks_hasil1, matriks_hasil2: array[1..3, 1..3] of integer; i, j,k,l: integer; begin Randomize; for i :=1 to 3 do for j:=1 to 3 do begin matriks1[i,j]:=random(5); matriks2[i,j]:=random(5); end; writeln('Matriks 1'); for i:=1 to 3 do begin for j:=1 to 3 do begin write(matriks1[i,j]:5); end; writeln; end; writeln('Matriks 2'); for i:=1 to 3 do begin for j:=1 to 3 do begin write(matriks2[i,j]:5); end; writeln; end; for i:=1 to 3 do for j:=1 to 3 do begin l:=0; for k:=1 to 3 do l:=l + matriks1[i,k] * matriks2[k,j]; matriks_hasil1[i,j]:=l; matriks_hasil2[i,j]:=matriks1[i,j]+matriks2[i,j]; end; writeln('Hasil perkalian matriks 1 dan matriks 2'); for i:=1 to 3 do begin for j:=1 to 3 do begin write(matriks_hasil1[i,j]:5); end; writeln; end; end.

Kamis, 06 Oktober 2011

Menghitung gaji karyawan

Program Menghitung_Gaji_Karyawan; Uses Wincrt; Var Nama_Karyawan:string; Gaji_Pokok:real; Jumlah_Anak:longint; Tunjangan_Istri,Tunjangan_anak,Gaji_Keseluruhan,Pajak,Gaji_Akhir:real; Begin Write ('Masukkan Nama Karyawan: ');readln (Nama_Karyawan); Write ('Masukkan Gaji Pokok=Rp ');readln (Gaji_Pokok); Write ('Masukkan Jumlah anak= ');readln (Jumlah_Anak); Tunjangan_Istri:=0.15*Gaji_Pokok; Tunjangan_Anak:=Jumlah_Anak*0.20*Gaji_Pokok; Gaji_Keseluruhan:=Gaji_Pokok+Tunjangan_Istri+Tunjangan_Anak; Pajak:=0.15*Gaji_Keseluruhan; Gaji_Akhir:=Gaji_Keseluruhan-Pajak; Writeln ('Tunjangan Istri =Rp ',(Tunjangan_Istri):15:2); Writeln ('Tunjangan anak =Rp ',(Tunjangan_Anak):15:2); Writeln ('Gaji Keseluruhan =Rp ',(Gaji_Keseluruhan):15:2); Writeln ('Pajak =Rp ',(Pajak):15:2); Writeln ('Gaji Akhir =Rp ',(Gaji_Akhir):15:2); End.

membuat piramit bintang,, Agus

program bintang_piramid; uses wincrt; var c,a,b,n : integer; begin write ('masukkan angka : ');readln(n); writeln; if n mod 2 = 0 then for a := 1 to (n div 2) do begin for b := 1 to (n div 2)-a do write (' '); for c := 1 to (a*2) do write ('*'); writeln; end else for a := 1 to (n div 2)+1 do begin for b := 1 to (n div 2)+(1-a) do write (' '); for c := 1 to (a*2)-1 do write ('*'); writeln; end; end.

mengukur suhu..

Program Konversi_Suhu; Uses WinCrt; var f,c,r : real; a,ul : char; procedure farein_celcius; begin Writeln('Program Konversi Fareinheit Ke Celcius'); Writeln('======================================'); Writeln; Write('Masukan Suhu dalam Farenheit: ');readln(f); c:=5/9*(f-32); Writeln; Writeln('Jadi Suhu Dalam Celcius Adalah: ',c:4:2); end; procedure farein_reamur; begin Writeln('Program Konversi Fareinheit Ke Reamur'); Writeln('====================================='); Writeln; Write('Masukan Suhu dalam Farenheit: ');readln(f); r:=4/9*(f-32); Writeln; Writeln('Jadi Suhu Dalam Reamur Adalah: ',r:4:2); end; procedure celcius_farein; begin Writeln('Program Konversi Celcius Ke Fareinheit'); Writeln('======================================'); Writeln; Write('Masukan Suhu dalam Celcius: ');readln(c); f:=(9/5)*c+32; Writeln; Writeln('Jadi Suhu Dalam Fareinheit Adalah: ',f:4:2); end; procedure celcius_reamur; begin Writeln('Program Konversi Celcius ke Reamur'); Writeln('=================================='); Writeln; Write('Masukan Suhu dalam Celcius: ');readln(c); r:=(4/5)*c; Writeln; Writeln('Jadi Suhu Dalam Reamur Adalah: ',r:4:2); end; procedure reamur_celcius; begin writeln('Program Konversi Reamur ke Celcius'); Writeln('=================================='); Writeln; Write('Masukan Suhu dalam Reamur: ');readln(r); c:=(5/4)*r; Writeln; Writeln('Jadi Suhu Dalam Celcius Adalah: ',c:4:2); end; procedure reamur_farein; begin writeln('Program Konversi Reamur ke Fareinheit'); Writeln('====================================='); Writeln; Write('Masukan Suhu dalam Reamur: ');readln(r); f:= (9/4)*r+32; Writeln; Writeln('Jadi Suhu Dalam Fareinheit Adalah: ',f:4:2); end; begin repeat clrscr; writeln ('Program konversi suhu'); writeln; writeln ('1. fareinheit - celcius'); writeln ('2. fareinheit - reamur'); writeln ('3. celcius - reamur'); writeln ('4. celcius - fareinheit'); writeln ('5. reamur - celcius'); writeln ('6. reamur - farenheit'); writeln; write ('pilih nomor konversi : '); read (a); writeln; case a of '1' : farein_celcius; '2' : farein_reamur; '3' : celcius_reamur; '4' : celcius_farein; '5' : reamur_celcius; '6' : reamur_farein; else writeln ('Nomor yang anda masukkan salah'); end; Writeln;Writeln; Write('Mau Coba Lagi [Y/T]: ');Readln(ul); Until Upcase(ul) = 'Y'; End.