0% found this document useful (0 votes)
21 views1 page

Rata Rata

The program collects five integer grades from the user and calculates the total and average. It then displays the grades, total, and average, and determines the pass grade based on the total score and individual grades. The grading system assigns grades A, B, C, or D based on specific criteria, or indicates failure if conditions are not met.

Uploaded by

Indra Wira
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views1 page

Rata Rata

The program collects five integer grades from the user and calculates the total and average. It then displays the grades, total, and average, and determines the pass grade based on the total score and individual grades. The grading system assigns grades A, B, C, or D based on specific criteria, or indicates failure if conditions are not met.

Uploaded by

Indra Wira
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

Program rat2;

uses crt;
var
a: array [1..5] of integer;
i,total : integer;
rata : real;
begin
clrscr;
total:=0;
for i:= 1 to 5 do
begin
write('Masukkan Nilai Mata kuliah ke-',i,' :');
readln(a[i]);
end;
writeln('');
writeln('NILAI DAN PERINGKAT ANDA');
writeln('========================');
for i := 1 to 5 do
begin
writeln(a[i]);
end;
for i:= 1 to 5 do
begin
total:= total +a[i];
end;
rata:=total/5;
writeln;
writeln('Total
=',total);
writeln('Rata - rata =',rat[Link]);
writeln('');
begin
if (a[i] >= 60) and (total > 340) then
writeln('Anda Lulus Dengan Grade A')
else
if (a[i] >= 60) and (total > 280) then
writeln('Anda Lulus Dengan Grade B')
else
if (a[i] >= 60) and (total > 240) then
writeln('Anda Lulus Dengan Grade C')
else
if (a[i] >= 60) and (total <= 240) then
writeln('Anda Lulus Dengan Grade D')
else
writeln('Anda Tidak lulus')
end;
readln;
end.

You might also like