东北大学吧 关注:250,648贴子:4,684,200
  • 12回复贴,共1

#求教#教务处查不了绩点了后续

只看楼主收藏回复

听说教务处查不了绩点了,学过编程的文科生心里痒痒
用turbo pascal 7.0编了个程,
求各位软件计算机大佬批评指正。
program JIDIANJISUAN;
type
arrtype1=array[1..1000]of integer;
arrtype2=array[1..1000]of real;
var
GPA:real;
Chongkao,Guake:arrtype1;
Xuefen,Chengji,GPAn:arrtype2;
a,b,c,d,e,f,g,h,i,j:integer;
x,x1,y,z,z1:integer;
den,num:real;
begin
writeln('Welcome to use GPA calculator, please follow the instructions.');
writeln('And,"You"=95,"Liang"=85,"Zhong"=75,"Jige"=65,"Bujige"=0,"Hege"=80,"Buhege"=0');
writeln('If you failed a course and attended to a make-up examination,');
writeln('then the grade is 0, and the number of re examinations is 2');
for x:=1 to 1000 do
Chongkao[X]:=1;
x1:=1;
writeln('Please input the number of your courses in the first semester:');
readln(a);
if a>0 then
for x:=1 to a do
begin
writeln('Please input the grade, point of course',x1);
readln(Chengji[x],Xuefen[x]);
inc(x1);
end;
writeln('If you failed some courses, please input the number,if not, please input 0:');
readln(z);
if z>0 then
begin
writeln('please input each order number of your failed course and press Enter:');
for z1:=1 to z do
begin
readln(Guake[z1]);
Chongkao[Guake[z1]]:=2;
end;
end;
x1:=1;
writeln('Please input the number of your courses in the second semester:');
readln(b);
if b>0 then
for x:=a+1 to a+b do
begin
writeln('Please input the grade, point of course',x1);
readln(Chengji[x],Xuefen[x]);
inc(x1);
end;
writeln('If you failed some courses, please input the number,if not, please input 0:');
readln(z);
if z>0 then
begin
writeln('please input each order number of your failed course and press Enter:');
for z1:=1 to z do
begin
readln(Guake[a+1+z1]);
Chongkao[Guake[a+1+z1]]:=2;
end;
end;
x1:=1;
writeln('Please input the number of your courses in the third semester:');
readln(c);
if c>0 then
for x:=a+b+1 to a+b+c do
begin
writeln('Please input the grade, point of course',x1);
readln(Chengji[x],Xuefen[x]);
inc(x1);
end;
writeln('If you failed some courses, please input the number,if not, please input 0:');
readln(z);
if z>0 then
begin
writeln('please input each order number of your failed course and press Enter:');
for z1:=1 to z do
begin
readln(Guake[a+b+1+z1]);
Chongkao[Guake[a+b+1+z1]]:=2;
end;
end;
x1:=1;
writeln('Please input the number of your courses in the fourth semester:');
readln(d);
if d>0 then
for x:=a+b+c+1 to a+b+c+d do
begin
writeln('Please input the grade, point of course',x1);
readln(Chengji[x],Xuefen[x]);
inc(x1);
end;
writeln('If you failed some courses, please input the number,if not, please input 0:');
readln(z);
if z>0 then
begin
writeln('please input each order number of your failed course and press Enter:');
for z1:=1 to z do
begin
readln(Guake[a+b+c+1+z1]);
Chongkao[Guake[a+b+c+1+z1]]:=2;
end;
end;
x1:=1;
writeln('Please input the number of your courses in the fifth semester:');
readln(e);
if e>0 then
for x:=a+b+c+d+1 to a+b+c+d+e do
begin
writeln('Please input the grade, point of course',x1);
readln(Chengji[x],Xuefen[x]);
inc(x1);
end;
writeln('If you failed some courses, please input the number,if not, please input 0:');
readln(z);
if z>0 then
begin
writeln('please input each order number of your failed course and press Enter:');
for z1:=1 to z do
begin
readln(Guake[a+b+c+d+1+z1]);
Chongkao[Guake[a+b+c+d+1+z1]]:=2;
end;
end;
x1:=1;
writeln('Please input the number of your courses in the sixth semester:');
readln(f);
if f>0 then
for x:=a+b+c+d+e+1 to a+b+c+d+e+f do
begin
writeln('Please input the grade, point of course',x1);
readln(Chengji[x],Xuefen[x]);
inc(x1);
end;
writeln('If you failed some courses, please input the number,if not, please input 0:');
readln(z);
if z>0 then
begin
writeln('please input each order number of your failed course and press Enter:');
for z1:=1 to z do
begin
readln(Guake[a+b+c+d+e+1+z1]);
Chongkao[Guake[a+b+c+d+e+1+z1]]:=2;
end;
end;
x1:=1;
writeln('Please input the number of your courses in the seventh semester:');
readln(g);
if g>0 then
for x:=a+b+c+d+e+f+1 to a+b+c+d+e+f+g do
begin
writeln('Please input the grade, point of course',x1);
readln(Chengji[x],Xuefen[x]);
inc(x1);
end;
writeln('If you failed some courses, please input the number,if not, please input 0:');
readln(z);
if z>0 then
begin
writeln('please input each order number of your failed course and press Enter:');
for z1:=1 to z do
begin
readln(Guake[a+b+c+d+e+f+1+z1]);
Chongkao[Guake[a+b+c+d+e+f+1+z1]]:=2;
end;
end;
x1:=1;
writeln('Please input the number of your courses in the eighth semester:');
readln(h);
if h>0 then
for x:=a+b+c+d+e+f+g+1 to a+b+c+d+e+f+g+h do
begin
writeln('Please input the grade, point of course',x1);
readln(Chengji[x],Xuefen[x]);
inc(x1);
end;
writeln('If you failed some courses, please input the number,if not, please input 0:');
readln(z);
if z>0 then
begin
writeln('please input each order number of your failed course and press Enter:');
for z1:=1 to z do
begin
readln(Guake[a+b+c+d+e+f+g+1+z1]);
Chongkao[Guake[a+b+c+d+e+f+g+1+z1]]:=2;
end;
end;
x1:=1;
writeln('Please input the number of your courses in the ninth semester:');
readln(i);
if i>0 then
for x:=a+b+c+d+e+f+g+h+1 to a+b+c+d+e+f+g+h+i do
begin
writeln('Please input the grade, point of course',x1);
readln(Chengji[x],Xuefen[x]);
inc(x1);
end;
writeln('If you failed some courses, please input the number,if not, please input 0:');
readln(z);
if z>0 then
begin
writeln('please input each order number of your failed course and press Enter:');
for z1:=1 to z do
begin
readln(Guake[a+b+c+d+e+f+g+h+1+z1]);
Chongkao[Guake[a+b+c+d+e+f+g+h+1+z1]]:=2;
end;
end;
x1:=1;
writeln('Please input the number of your courses in the tenth semester:');
readln(j);
if j>0 then
for x:=a+b+c+d+e+f+g+h+i+1 to a+b+c+d+e+f+g+h+i+j do
begin
writeln('Please input the grade, point of course',x1);
readln(Chengji[x],Xuefen[x]);
inc(x1);
end;
writeln('If you failed some courses, please input the number,if not, please input 0:');
readln(z);
if z>0 then
begin
writeln('please input each order number of your failed course and press Enter:');
for z1:=1 to z do
begin
readln(Guake[a+b+c+d+e+f+g+h+i+1+z1]);
Chongkao[Guake[a+b+c+d+e+f+g+h+i+1+z1]]:=2;
end;
end;
den:=0;
num:=0;
for y:=1 to x do
begin
GPAn[y]:=Chengji[y]/10-5;
end;
for y:=1 to x do
den:=den+Xuefen[y]*Chongkao[y];
for y:=1 to x do
num:=num+GPAn[y]*Xuefen[y];
GPA:=num/den;
writeln('Your GPA is:',GPA:6:6);
readln;
end.


IP属地:北京1楼2017-01-12 15:29回复
    这是啥


    IP属地:辽宁来自Android客户端2楼2017-01-12 15:38
    回复
      这是啥


      IP属地:福建来自Android客户端3楼2017-01-12 15:58
      回复
        这是啥


        来自Android客户端4楼2017-01-12 15:59
        回复


          IP属地:青海来自Android客户端6楼2017-01-12 16:03
          回复
            高中也去听了下pascal ,发现不太感兴趣就没去了


            来自Android客户端8楼2017-01-12 17:07
            收起回复
              老哥。。我感觉你可以媲美大多数计算机在校生了


              IP属地:海南来自Android客户端9楼2017-01-12 18:09
              回复
                我看懂了重考,挂科


                IP属地:北京来自Android客户端11楼2017-01-12 18:46
                回复
                  没学过pascal,并且现在都用C++或java


                  IP属地:澳大利亚来自Android客户端12楼2017-01-12 18:55
                  回复
                    这是啥


                    IP属地:北京来自Android客户端13楼2017-01-12 19:07
                    回复
                      技术活,当赏


                      IP属地:辽宁来自WindowsPhone客户端14楼2017-01-12 20:06
                      回复
                        没必要来贴吧贴代码呀


                        来自Android客户端16楼2017-01-13 01:23
                        回复