BASIC 语言学分统计程序

申明敬告: 本站不保证该用户上传的文档完整性,不预览、不比对内容而直接下载产生的反悔问题本站不予受理。

文档介绍

BASIC 语言学分统计程序

学 生 成 绩 基 本 统 计 系 统BASIC 程 序 清 单(统计项目:分数段,各科名次(可列出并列名次,单科可折扣),全班总分,全班人平,)10CLS:KEYOFF:15COLOR14,1:LOCATE7,16:PRINT"=======================";20LOCATE8,16:PRINT"||";25LOCATE9,16:PRINT"|欢迎使用本成绩统计系统|";30LOCATE10,16:PRINT"||";31LOCATE11,16:PRINT"|";:COLOR13,1:PRINT"程序设计:鲍治国版本号:1.00";:COLOR14,1:PRINT"|";32LOCATE12,16:PRINT"||";35LOCATE13,16:PRINT"|按下回车键进入统计|";40LOCATE14,16:PRINT"||";45LOCATE15,16:PRINT"========================";50LOCATE13,58:LINEINPUT"";A$:COLOR7,055CLS60COLOR15,12:LOCATE9,23:PRINT"=====================================";65LOCATE10,23:PRINT"||";70LOCATE11,23:PRINT"||";75LOCATE12,23:PRINT"||";80LOCATE13,23:PRINT"||";85LOCATE14,23:PRINT"||";90LOCATE15,23:PRINT"=====================================";95LOCATE11,33:PRINT"请输入学生人数:"100LOCATE13,33:PRINT"请输入成绩科数:"105LOCATE11,50:LINEINPUT"";RS$:RS=VAL(RS$)110LOCATE13,50:LINEINPUT"";KS$:KS=VAL(KS$):COLOR7,0115'======================定义数组======================120DIMXH(RS,KS+1),FS(RS,KS+1),MC(RS,KS+1),KM$(KS+1),FSD(10,KS),FSD$(10),BZF(KS)125CLS130'======================输入学科======================135LOCATE5,24:COLOR15,12:PRINT"请输入科目名称:":COLOR14,0140FORK=1TOKS145LOCATEK*2+7,3:PRINTK;"";:LINEINPUT"";KM$:KM$(K)=LEFT$(KM$,2)+""+RIGHT$(KM$,2)150LOCATEK*2+7,16:PRINT"折扣吗?[Y/N]:N";:LOCATE,32:LINEINPUT"";Y$(K)155IFY$(K)="Y"ORY$(K)="y"THENLOCATEK*2+7,38:LINEINPUT"请输入折扣百分比:[X%]X=";B$:B(K)=VAL(B$)160NEXTK165KM$(0)="学号":KM$(KS+1)="总分"170CLS:POKE1605,1:POKE1606,26175COLOR15,1:LOCATE25,1:PRINT"如果前一个数据输入错误,请你按下Q\n键后回车,则可以修改前一个数据。";180'=====================显示表头======================185COLOR15,12:LOCATE1,1:PRINT"     "190FORK=0TOKS195LOCATE1,INT(80/(KS+2)*K+5):PRINTKM$(K);200NEXTK205PRINT:PRINT:PRINT:COLOR7,0210POKE1605,3:POKE1606,23215'=======================输入分数===========================220V=3225FORI=1TORS230FORJ=0TOKS+1235IFJ=0THENLOCATEV,INT(80/(KS+2)*J+6):PRINTI;:FS(I,0)=I:GOTO265240LOCATEV,INT(80/(KS+2)*J+6):LINEINPUT"";FS$:FS(I,J)=VAL(FS$)245IFFS$="q"ORFS$="Q"THENFS(I,KS+1)=FS(I,KS+1)-FS(I,J-1):J=J-1:GOTO240250IFJ=KS+1THEN265255FS(I,KS+1)=FS(I,KS+1)+FS(I,J)265NEXTJ266IFV>=21THENV=21:PRINT270V=V+1275NEXTI280FORI=1TORS285FORJ=1TOKS290BZF(J)=BZF(J)+FS(I,J)295NEXT:NEXT300COLOR15,1:PRINT"=============基===本===数===据=================";305COLOR7,0:PRINT:LOCATE,3:COLOR12,0:PRINT"全班总分:";:COLOR10,0310FORI=1TOKS315LOCATE,INT(80/(KS+2)*I+4):PRINTUSING"####.##";BZF(I);320NEXTI325PRINT330LOCATE,3:COLOR12,0:PRINT"全班人平:";:COLOR10,0335FORI=1TOKS340LOCATE,INT(80/(KS+2)*I+5):PRINTUSING"###.##";INT((BZF(I)/RS)*100+.5)/100;345NEXTI350COLOR7,0355'===================统计分数段=======================360FORI=1TOKS365FORJ=1TORS370E=INT((FS(J,I)-55)/5)375IFE<1THENFSD(1,I)=FSD(1,I)+1:GOTO430380ONEGOTO385,390,395,400,405,410,415,420,425385FSD(2,I)=FSD(2,I)+1:GOTO430390FSD(3,I)=FSD(3,I)+1:GOTO430395FSD(4,I)=FSD(4,I)+1:GOTO430400FSD(5,I)=FSD(5,I)+1:GOTO430405FSD(6,I)=FSD(6,I)+1:GOTO430410FSD(7,I)=FSD(7,I)+1:GOTO430\n415FSD(8,I)=FSD(8,I)+1:GOTO430420FSD(9,I)=FSD(9,I)+1:GOTO430425FSD(10,I)=FSD(10,I)+1430NEXT:NEXT435PRINT440FORI=1TORS445FS(I,KS+1)=0450FORJ=1TOKS455IFY$(J)="Y"ORY$(J)="y"THENFS(I,KS+1)=FS(I,KS+1)+(FS(I,J)*(B(J)/100)):GOTO465460FS(I,KS+1)=FS(I,KS+1)+FS(I,J)465NEXTJ470NEXTI475'===================显示分数段=======================480FSD$(1)="59分以下":FSD$(2)="60----64":FSD$(3)="65----69":FSD$(4)="70----74":FSD$(5)="75----79":FSD$(6)="80----84":FSD$(7)="85----89":FSD$(8)="90----94":FSD$(9)="95----99":FSD$(10)="100分"485COLOR15,1:PRINT"==========分===数===段==(单位:人)===========";490COLOR7,0:PRINT495FORI=1TO10500COLOR12,0:LOCATE,3:PRINTFSD$(I);:COLOR10,0505FORJ=1TOKS510LOCATE,INT(80/(KS+2)*J+6):PRINTFSD(I,J);515NEXTJ520PRINT525NEXTI530COLOR15,1:PRINT"=======================================================";535COLOR7,0540POKE1605,3:POKE1606,25545COLOR7,0550'====================分数排序========================555'初始化序号--------------------------------------560FORI=1TORS565FORJ=1TOKS+1570XH(I,J)=I575NEXTJ580NEXTI585'排序--------------------------------------------590FORK=1TOKS+1595'分数初步排序------------------------------------600FORI=1TORS-1605 FORJ=I+1TORS610IFFS(I,K)XH(J,K)THENSWAPXH(I,K),XH(J,K):SWAPFS(I,K),FS(J,K):SWAPMC(I,K),MC(J,K)720NEXTJ725NEXTI730NEXTK732POKE1605,1:POKE1606,26735COLOR15,12:LOCATE25,1:PRINT"按下C键然后回车,显示学生各科成绩名次";740LOCATE25,70:LINEINPUT"";A$:IFA$<>"C"ANDA$<>"c"THEN735745COLOR7,0:CLS750POKE1605,1:POKE1606,26755'显示名次表======================================760COLOR15,12:LOCATE1,1:PRINT"  "765FORK=0TOKS+1770IFK=0THENLOCATE1,5:PRINTKM$(K);:GOTO780775LOCATE1,INT(80/(KS+2)*K):PRINTKM$(K);"名次";780NEXTK785IFRS>21THENCOLOR15,1:POKE1606,26:LOCATE25,1:PRINT"学生成绩名次表未列完,请按任意一键继续列出。(紫色为并列名次)";790COLOR7,0795'------------------------------------------------800IFRS<19THENPRINT:PRINT:PRINT:COLOR7,0805POKE1605,3:POKE1606,23810V=3815'------------------------------------------------820FORN=1TORS825LOCATEV,6:PRINTUSING"###";N;830FORK=1TOKS+1835LOCATEV,INT(80/(KS+2)*K):PRINTUSING"###.##";FS(N,K);:PRINT"";837T=MC(N,K)840IFMC(N,K)<0THENCOLOR13,0ELSECOLOR14,0842IFMC(N,K)<0THENT=MC(N,K)*(-1)845PRINTUSING"###";T;:COLOR10,0:PRINT"";CHR$(179);:COLOR7,0\n850NEXTK855IFV=22THENLINEINPUT"";A$860V=V+1:IFV>=23THENV=3865NEXTN870COLOR12,0:PRINT"*******************************************":PRINT"名次表已列完毕"875PRINT"":COLOR7,0880POKE1606,26:LOCATE25,1:COLOR15,12:PRINT"如果你想重新显示学生各科成绩名次表,请按Y键,结束请按N键。";:LOCATE25,75:LINEINPUTA$:COLOR7,0885IFA$<>"Y"ANDA$<>"y"ANDA$<>"N"ANDA$<>"n"THEN880890IFA$="Y"ORA$="y"THEN745:COLOR7,0895CLS:COLOR15,12:LOCATE10,23:PRINT"=====================================";900LOCATE11,23:PRINT"|继续进行下一次统计吗?(Y/N)|";905LOCATE12,23:PRINT"=====================================";910LOCATE11,56:LINEINPUTA$915IFA$<>"Y"ANDA$<>"y"ANDA$<>"N"ANDA$<>"n"THEN910920IFA$="Y"ORA$="y"THENCOLOR7,0:RUN55925COLOR7,0:CLS:COLOR15,1:LOCATE10,23:PRINT"==============================";930LOCATE11,23:PRINT"|谢谢使用|";935LOCATE12,23:PRINT"============================================";940FORI=1TO500000!:NEXTI945POKE1605,1:POKE1606,25:COLOR7,0:CLS:KEYON
查看更多

相关文章

您可能关注的文档