pascal:
program KetQuaTinHoc;
var
diem1, diem2, diem3, diem4: real;
diemTongKet: real;
begin
readln(diem1, diem2, diem3, diem4);
diemTongKet := (diem1 + diem2 + 2 * diem3 + 3 * diem4) / 7;
if diemTongKet >= 8 then
writeln('Gioi')
else if diemTongKet >= 6.5 then
writeln('Kha')
else if diemTongKet >= 5 then
writeln('Trung Binh')
else
writeln('Yeu');
end.
Python:
diem1, diem2, diem3, diem4 = map(float, input("Nhập 4 điểm cách nhau bởi khoảng trắng: ").split())
diem_tong_ket = (diem1 + diem2 + 2 * diem3 + 3 * diem4) / 7
if diem_tong_ket >= 8:
print("Giỏi")
elif diem_tong_ket >= 6.5:
print("Khá")
elif diem_tong_ket >= 5:
print("Trung Bình")
else:
print("Yếu")
SQL:
SELECT
ID,
Diem1,
Diem2,
Diem3,
Diem4,
(Diem1 + Diem2 + 2 * Diem3 + 3 * Diem4) / 7 AS DiemTongKet,
CASE
WHEN (Diem1 + Diem2 + 2 * Diem3 + 3 * Diem4) / 7 >= 8 THEN 'Giỏi'
WHEN (Diem1 + Diem2 + 2 * Diem3 + 3 * Diem4) / 7 >= 6.5 THEN 'Khá'
WHEN (Diem1 + Diem2 + 2 * Diem3 + 3 * Diem4) / 7 >= 5 THEN 'Trung Bình'
ELSE 'Yếu'
END AS KetQua
FROM
HocSinh;
EXCEL:
lm điểm tổng kết => VD ô E1 là điểm tổng kết
=IF(E1>=8, "Giỏi", IF(E1>=6.5, "Khá", IF(E1>=5, "Trung Bình", "Yếu")))