本程序只適合某些大學中學年評定獎學金 算加權成績:
考慮到MATLAB基於數據處理的能力比較強,選擇MATLAB
MATLAB 程序
%% 此程序只適合計算當前學生均已參加所有考試:
%% MATLAB程序實現學生成績評價,導入EXCEL,導出EXCEL
clear all;
clc;
%讀取excel表格純學生課程成績
marks=xlsread('C:\Users\流星幻影\Desktop\marks.xls','F5:CA32');
xuefen=xlsread('C:\Users\流星幻影\Desktop\marks.xls','F4:CA4');
%% 計算marks矩陣的維數
[people,object]=size(marks);
%% 存儲;
studmarks=zeros(people,3);
%% 計算學生成績
for(i=1:people)
for(j=1:object)
if(marks(i,j)~=0)
studmarks(i,2)=studmarks(i,2)+xuefen(j);%計算學生的總學分
end
studmarks(i,1)= studmarks(i,1)+marks(i,j)*xuefen(j);%計算學生的總成績
end
studmarks(i,3)= studmarks(i,1)/studmarks(i,2);%計算學生的加權成績
end
%% 將學生的總成績,總學分,加權成績存於學生成績一覽表中
xlswrite('C:\Users\流星幻影\Desktop\學生成績一覽表.xlsx',studmarks,'CE5:CG32');