• Twitter
  • Technocrati
  • stumbleupon
  • flickr
  • digg
  • youtube
  • facebook

Follow our Network

Contoh Program Sederhana TPW bag. 6

0

Label:

Reaksi: 

Assalammu'alaikum Wr. Wb
Selamat Hari Raya Idul Fitri...meskipun telat hehehehehe..
Kali ini saya share ilmu lagi nih..seperti biasa tentang bahasa pemrograman TPW..!!
Mangga..diraos...

------------------------------------------------------------------
Program Honor_Jam;
Uses wincrt;
Const
Gol_a=250;
Gol_b=200;
Gol_c=150;
Gol_d=100;
Var
Nama:string[15];
Gol:char;
I,jam, honor:integer;
Total:real;


Begin
Write('Masukan nama  :  ' );readln(nama);
Write('Masukan gol (a - d) :');readln(gol);
Write('Jumlah Jam  :');readln(jam);
Writeln;
For i:=1 to length(nama) do
Nama[i]:=upcase(nama[i]);

Writeln('Total Honor');
Writeln('Nama:  ',nama);
Writeln('Golongan: ',gol);
Case gol of
'a':begin
  honor:=gol_a*jam;
  total:=honor;
if jam > 10 then
 begin
  writeln('Honor  : ',honor);
 writeln('Potongan :  5%');
total:=honor-(honor*0.05);
end;
writeln('Total Honor: ',total:0:0);
end;
'b':begin
  honor:=gol_b*jam;
  total:=honor;
  if jam > 20 then
  begin
  writeln('Honor  : ',honor);
  writeln('Potongan : 5%');
   total:=honor-(honor*0.05);
end;
writeln('Total Honor: ',total:0:0);
end;
'c':writeln('Honor: ',gol_c*jam);
'd':writeln('Honor : ', gol_d*jam);
Else
  Writeln('Anda salah memasukkan golongan!');
End;

End.
---------------------------------------------------------------------

oke..kalian boleh Copas..asal cantumkan sumbernya..
syukron.. h_h

Comments (0)

Posting Komentar

Social Media

  • Subscribe via email

    Enter your email address:

    Delivered by FeedBurner

    Techno 4 U