Sabtu, 17 April 2010

Program Animasi Pakai Java

import java.awt.event.*;
import java.awt.*;
class Animasi_Text extends Thread implements ActionListener,WindowListener{
Frame F=new Frame();
Button btPlay,btStop,btClose;
Label L;
Panel P;
public void actionPerformed(ActionEvent a){
String e=a.getActionCommand();
if(e.equals("Play")){
start();
}
else if(e.equals("Stop")){
suspend();}
else if(e.equals("Close")){
System.exit(0);}
}
public void initKomp(){
btStop = new Button("Stop");
btPlay = new Button("Play");
btClose = new Button("Close");

program KHS pakai Pascal

program khs;
uses wincrt;
var
i,n,jum:integer;
nim :string[8];
nama :string[25];
matakul:array[1..10] of string[25];
kode :array[1..10] of string[7];
sks :array[1..10] of integer;
begin
write('masukan nim :');readln(nim);
write('masukan nama :');readln(nama);
write('masukan n matakul:');readln(n);
for i:=1 to n do
begin
write('Matakul ke-',i,':');readln(matakul[i]);
write('Kode :');readln(kode[i]);
write('Sks :');readln(sks[i]);
jum:=jum+sks[i];
end;
writeln(' ');
writeln(' Kartu Hasil Study (KHS) ');
writeln(' ');
writeln('Nomhs / Nama Mahasiswa :');
writeln( nim,' / ',nama);
writeln('-----------------------------------------------------');
writeln(' No | Kode | MataKul | Sks ');
writeln('-----------------------------------------------------');
for i:= 1 to n do
writeln( i:5,' |',kode[i]:6,' |',matakul[i]:9,' ','|',sks[i]:5);
writeln('-----------------------------------------------------');
writeln(' Total Sks :',jum);
writeln('-----------------------------------------------------');
readln;
end.