viết chương trình tính điểm cho học sinh và cho biết học lực của học sinh( nhập điểm toán, lý, hóa, văn, anh, điểm trung bình)
Viết chương trình sử dụng chương trình con để tính điểm trung bình 3 môn Toán Văn Anh của năm bạn học sinh biết điểm từng bạn được nhập từ bàn phím
uses crt;
var a,b,c,tb:array[1..100]of real;
i,n:integer;
begin
clrscr;
n:=5;
for i:=1 to n do
begin
readln(a[i],b[i],c[i]);
end;
for i:=1 to n do
tb[i]:=(a[i]+b[i]+c[i])/3;
for i:=1 to n do
writeln('Diem trung binh cua ban thu ',i,' la: ',tb[i]:4:2);
readln;
end.
Viết chương trình nhập vào điểm các môn toán , tin, anh. Tính và thông báo ra màn hình điểm trung bình 3 môn và dựa vào điểm trung bình hãy xếp loại cho học sinh đó ( Biết rằng học sinh giỏi nếu điểm tất cả các môn đều trên 6,5 và điểm trung bình trên 8, học sinh khá nếu điểm các môn trên 5 và điểm trung bình trên 6,5, còn lại là học sinh trung bình) (C++)
#include <bits/stdc++.h>
using namespace std;
double a,b,c,tb;
int main()
{
cin>>a>>b>>c;
tb=(a+b+c)/3;
cout<<fixed<<setprecision(1)<<tb<<endl;
if (tb>=8) cout<<"Gioi";
else if ((6.5<=tb) and (tb<8)) cout<<"Kha";
else if ((5<=tb) and (tb<=6.5)) cout<<"Trung Binh";
else cout<<"Chua dat";
return 0;
}
var t,dt,a,tb: real;
begin
write('Nhap diem mon Toan: '); readln(t);
write('nhap diem mon Tin: '); readln(dt);
write('Nhap diem mon Anh: '); readln(a);
if (a<=0) or (a>=10) or (t<=0) or (t>=10) or (dt<=0) or (dt>=10) then
repeat
writeln('Khong hop le, nhap lai: ');
write('Nhap diem mon Toan: '); readln(t);
write('nhap diem mon Tin: '); readln(dt);
write('Nhap diem mon Anh: '); readln(a);
until (a>=0) and (a<=10) and (t>=0) and (t<=10) and (dt>=0) and (dt<=10);
tb:=(t+dt+a)/3;
writeln('Diem trung binh: ',tb:2:1);
if (dt>=6.5) and (t>=6.5) and (a>=6.5) and (tb>=8) then writeln('Gioi') else
if (dt>=5) and (t>=5) and (a>=5) and (tb>=6.5) then writeln('Kha') else writeln('Trung binh');
end.
uses crt;
var toan,tin,anh,tb:real;
kt:integer;
begin
clrscr;
repeat
write('Nhap diem Toan:'); readln(toan);
write('Nhap diem Tin:'); readln(tin);
write('Nhap diem Anh:'); readln(anh);
until (0<=toan) and (toan<=10) and (0<=tin) and (tin<=10) and (0<=anh) and (anh<=10);
tb:=(toan+tin+anh)/3;
writeln('Diem trung binh cua 3 mon la: ',tb:4:2);
kt:=0;
if (tb>=8) and (toan>=6.5) and (tin>=6.5) and (anh>=6.5) then kt:=1;
if (6.5<=tb) and (tb<8) and (5<=toan) and (toan<6.5) and (5<=tin) and (tin<6.5) and (5<=anh) and (anh<6.5) then kt:=2;
if kt=0 then writeln('Hoc sinh trung binh');
if kt=1 then writeln('Hoc sinh gioi');
if kt=2 then writeln('Hoc sinh kha');
readln;
end.
Bài 3: Viết chương trình nhập vào họ tên, điểm văn, điểm tóan, điểm anh văn của 1 học sinh. Sau đó in ra màn hình: họ tên, điểm trung bình, xếp lọai của học sinh đó (trên 1 dòng). Cho biết:
- Điểm trung bình: (điểm văn + điểm tóan + điểm anh văn) / 3
- Xếp loại: Giỏi, nếu điểm trung bình >= 9.0
Khá, nếu 7.0 <= điểm trung bình < 9.0
Trung bình, nếu 5.0 <= điểm trung bình < 7.0
Yếu, nếu điểm trung bình < 5.0
#include <bits/stdc++.h>
using namespace std;
double a,b,c,tb;
int main()
{
cin>>a>>b>>c;
tb=(a+b+c)/3;
cout<<fixed<<setprecision(1)<<tb<<endl;
if (tb>=8) cout<<"Gioi";
else if ((6.5<=tb) and (tb<8)) cout<<"Kha";
else if ((5<=tb) and (tb<=6.5)) cout<<"Trung Binh";
else cout<<"Chua dat";
return 0;
}
Viết chương trình nhập từ bàn phím điểm toán lí hóa của 1 học sinh, tính điểm trung bình 3 môn đó. Dựa vào điểm trung bình xếp loại học lực và đưa ra màn hình. Đưa ra màn hình điểm thấp ,cao nhất, điểm trung bình
Cần gấp ạ giúp em với
E cảm ơn!
Viết chương trình nhập từ bàn phím điểm môn tiếng Anh và môn Vật lý của n học sinh tính trung bình cộng môn tiếng Anh và môn lý của cả lớp
program TinhTBCMon;
var
n, i: integer;
diemAnh, diemVL, tongDiemAnh, tongDiemVL: real;
begin
tongDiemAnh := 0;
tongDiemVL := 0;
write('Nhap so hoc sinh: ');
readln(n);
for i := 1 to n do
begin
write('Nhap diem Tieng Anh cua hoc sinh ', i, ': ');
readln(diemAnh);
tongDiemAnh := tongDiemAnh + diemAnh;
write('Nhap diem Vat ly cua hoc sinh ', i, ': ');
readln(diemVL);
tongDiemVL := tongDiemVL + diemVL;
end;
writeln('Diem trung binh mon Tieng Anh cua lop la: ', tongDiemAnh/n:0:2);
writeln('Diem trung binh mon Vat ly cua lop la: ', tongDiemVL/n:0:2);
readln;
end.
viết chương trình sử dụng biến mảng, thực hiện các công việc sau:
- Nhập từ bàn phím danh sách HỌ TÊN, điểm trung bình môn TOÁN,VĂN,TIN của các bạn học sinh trong lớp
- Tính điểm trung bình của từng học sinh.
- Tìm học sinh có điểm trung bình cao nhất.
viết chương trình sử dụng biến mảng, thực hiện các công việc sau:
- Nhập từ bàn phím danh sách HỌ TÊN, điểm trung bình môn TOÁN,VĂN,TIN của các bạn học sinh trong lớp
- Tính điểm trung bình của từng học sinh.
- Tìm học sinh có điểm trung bình cao nhất.
Viết chương trình nhập điểm tuyển sinh lớp 10, cho phép nhập vào 3 môn
Văn, Toán, Anh. Sau đó in ra điểm tổng kết (điểm tổng kết được tính như sau:
diemtongket= Văn*2 + Toán*2 + Anh) và thông báo kết quả thi của học sinh như
sau: Nếu điểm tổng kết >=38 thì thông báo “Chuc mung ban da thi dau tuyen
sinh!”, ngược lại thì thông báo “Ban da thi rot, chuc may man lan sau!”
#include <bits/stdc++.h>
using namespace std;
double a,b,c,tb;
int main()
{
cin>>a>>b>>c;
tb=(a+b)*2+c;
if (tb>=38) cout<<"Chuc man ban da thi dau tuyen sinh";
else cout<<"Ban da thi rot, chuc may man lan sau";
return 0;
}