Hãy viết chương trình nhập điểm chương trình của 1 bạn học sinh trong lớp. Và đưa ra xếp loại học lực của ban đó.
Cho biết:
TB > 8,0 : giỏi
6,5 < TB < 8,0 : khá
5,0 < TB < 6,5 : trung bình
3,5 < TB < 5,0 : yếu
còn lại : kém
Giải thích: TB: Điểm trung bình của học sinh
Uses CRT;
Var TB : real;
BEGIN
clrscr;
repeat
begin
write('Moi ban nhap diem trung binh: ');
Readln(TB);
end;
until (TB>0) and (TB<10);
If (TB >= 8) then write('hoc luc gioi') else
If (TB>=6.5) then write('hoc luc kha') else
If (TB>5) then write('hoc luc trung binh') else
If (TB>3.5) then write('hoc luc yeu') else
write('hoc luc kem');
Readln;
END.
Uses CRT;
Var TB : real;
Begin
clrscr;
Readln(TB);
If TB >= 8 then write('hoc luc gioi') else
If 6.5<=TB<8 then write('hoc luc kha') else
If 5<=TB<6.5 then write('hoc luc trung binh') else
If 3.5<=TB<5 then write('hoc luc yeu') else
write('hoc luc kem');
Readln;
End.