Home » » Bagaimana COntoh Pembuatan Program Algoritma Pembulatan Nilai Integer Secara Otomatis

Bagaimana COntoh Pembuatan Program Algoritma Pembulatan Nilai Integer Secara Otomatis

Posted by DEC Development Education and Culture on Friday, 7 December 2012


program Nilai_Akhir;
 
uses
  WinCrt;
var
tugas,mid,final,nilai:real;
nilai1:integer;


begin
clrscr;
writeln('masukkan nilai tugas=');
readln (tugas);
writeln ('masukkan nilai mid=') ;
readln (mid) ;
writeln ('masukkan nilai final=') ;
readln (final) ;
nilai :=0.3*tugas+0.3*mid+0.4*final ;
writeln ('total nilai=',nilai :4:2);
nilai1:=trunc(nilai);
case nilai1 of
80..100:writeln('Nilai A');
71..79:writeln('Nilai B');
61..70:writeln('Nilai C');
51..60:writeln('Nilai D');
0..50:writeln('Nilai E');
end;

END.


0 comments:

Post a Comment

RECENT POST

Popular Posts

Powered by Blogger.
.comment-content a {display: none;}