课堂小测
Posted zzmds
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了课堂小测相关的知识,希望对你有一定的参考价值。
/*信1805-3
20183769
赵常恒*/
package 课堂小测;
import java.util.*;
class ScoreInformation
private String stunumber;
private String name;
private double mathematicsscore;
private double englishiscore;
private double networkscore;
private double databasescore;
private double softwarescore;
public ScoreInformation()
public ScoreInformation(String stunumber,String name,double mathematicsscore,double englishiscore,double networkscore,double databasescore,double softwarescore)
this.stunumber=stunumber;
this.name=name;
this.mathematicsscore=mathematicsscore;
this.englishiscore=englishiscore;
this.networkscore=networkscore;
this.databasescore=databasescore;
this.softwarescore=softwarescore;
public String getstunumber()
return stunumber;
public void setstunumber(String stunumber)
this.stunumber=stunumber;
public String getname()
return name;
public void setname(String name)
this.name=name;
public double getmathematicsscore()
return mathematicsscore;
public void setmathematicsscore(double mathematicsscore)
this.mathematicsscore=mathematicsscore;
public double getenglishiscore()
return englishiscore;
public void setenglishiscore(double englishiscore)
this.englishiscore=englishiscore;
public double getnetworkscore()
return networkscore;
public void setnetworkscore(double networkscore)
this.networkscore=networkscore;
public double getdatabasescore()
return databasescore;
public void setdatabasescore(double databasescore)
this.databasescore=databasescore;
public double getsoftwarescore()
return softwarescore;
public void setsoftwarescore(double softwarescore)
this.softwarescore=softwarescore;
public class ScoreManagement
static Scanner input=new Scanner(System.in);
static boolean ll=false;
static boolean l=false;
static ScoreInformation []a=new ScoreInformation[5];
static void zzm()
a[0]=new ScoreInformation("20183770"," 0",0,0,0,0,0);//用数组存储5个成员和每个成员的初值
a[1]=new ScoreInformation("20183771"," 1",0,0,0,0,0);
a[2]=new ScoreInformation("20183772"," 2",0,0,0,0,0);
a[3]=new ScoreInformation("20183773"," 3",0,0,0,0,0);
a[4]=new ScoreInformation("20183774"," 4",0,0,0,0,0);
static int i;
public static void main(String [] args)
zzm();
for(;;)
System.out.println("***********************************************************");
System.out.println("石家庄铁道大学软件工程系 ");
System.out.println("学生学籍管理系统 2019 版 ");
System.out.println("***********************************************************");
System.out.println("1、 学生考试成绩录入 ");
System.out.println("2、 学生考试成绩修改 ");
System.out.println("3、 计算学生成绩绩点 ");
System.out.println("4、退出学籍管理系统 ");
System.out.println("***********************************************************");
int m = input.nextInt();
switch(m)
case 1:
while(ll=true)
System.out.println("***********************************************************");
System.out.println("***********************************************");
System.out.println("石家庄铁道大学软件工程系学生学籍管理系统2019版");
System.out.println("学生考试成绩录入");
System.out.println("***********************************************");
System.out.println("请输入学生学号:");
System.out.println("***********************************************");
String n1=sc.next();
for(i=0;i<5;i++)
if(n1.equals(a[i].getstunumber()))
l=true;break;
if(l)
System.out.println("***********************************************");
System.out.println("石家庄铁道大学软件工程系学生学籍管理系统2019版");
System.out.println("学生考试成绩录入");
System.out.println("***********************************************");
System.out.println("学生学号:"+a[i].getstunumber());
System.out.println("学生姓名:"+a[i].getname());
System.out.println("请输入高等数学成绩:");
a[i].setmathematicsscore(input.nextDouble());
System.out.println("请输入大学英语成绩:");
a[i].setenglishiscore(input.nextDouble());
System.out.println("请输入大学计算机网络成绩:");
a[i].setnetworkscore(input.nextDouble());
System.out.println("请输入大学数据库成绩:");
a[i].setdatabasescore(input.nextDouble());
System.out.println("请输入大学软件工程成绩:");
a[i].setsoftwarescore(input.nextDouble());
System.out.println("***********************************************");
System.out.println("***********************************************");
System.out.println("石家庄铁道大学软件工程系学生学籍管理系统2019版");
System.out.println("学生考试成绩录入");
System.out.println("***********************************************");
System.out.println("学生学号:"+a[i].getstunumber());
System.out.println("学生姓名:"+a[i].getname());
System.out.println("高等数学成绩:"+a[i].getmathematicsscore());
System.out.println("大学英语成绩:"+a[i].getenglishiscore());
System.out.println("计算机网络成绩:"+a[i].getnetworkscore());
System.out.println("数据库成绩:"+a[i].getdatabasescore());
System.out.println("软件工程成绩:"+a[i].getsoftwarescore());
System.out.println("该学生成绩录入完毕,是否提交(Y/N)");
System.out.println("***********************************************");
String n2=input.next();
if(n2.equals("Y"))
System.out.println("录入成功!!");
break;
else
a[i].setmathematicsscore(0);
a[i].setenglishiscore(0);
a[i].setnetworkscore(0);
a[i].setdatabasescore(0);
a[i].setsoftwarescore(0);
System.out.println("录入失败!!");
ll=true;
else System.out.println("该学号不存在!!!");
ll=true;
break;
case 2:
double d1,d2,d3,d4,d5;
d1=a[i].getmathematicsscore();
d2=a[i].getenglishiscore();
d3=a[i].getnetworkscore();
d4=a[i].getdatabasescore();
d5=a[i].getsoftwarescore();
System.out.println("***********************************************");
System.out.println(" 石家庄铁道大学软件工程系学生学籍管理系统2019版");
System.out.println(" 学生考试成绩修改界面");
System.out.println("***********************************************");
System.out.println(" 请输入学生学号:");
String n3=input.next();
System.out.println("***********************************************");
for( i=0;i<5;i++)
if(n3.equals(a[i].getstunumber()))
l=true;break;
if(l)
System.out.println("石家庄铁道大学软件工程系学生学籍管理系统2019版");
System.out.println("学生考试成绩录入");
System.out.println("***********************************************");
System.out.println("学生学号:"+a[i].getstunumber());
System.out.println("学生姓名:"+a[i].getname());
System.out.println("1,高等数学成绩:"+a[i].getmathematicsscore());
System.out.println("2,大学英语成绩:"+a[i].getenglishiscore());
System.out.println("3,计算机网络成绩:"+a[i].getnetworkscore());
System.out.println("4,数据库成绩:"+a[i].getdatabasescore());
System.out.println("5,软件工程成绩:"+a[i].getsoftwarescore());
System.out.println("***********************************************");
System.out.println("请选择需要修改的选项");
int k = input.nextInt();
switch(k)
case 1:
System.out.println("***********************************************");
System.out.println(" 石家庄铁道大学软件工程系学生学籍管理系统2019版");
System.out.println(" 学生考试成绩录入");
System.out.println("***********************************************");
System.out.println(" 学生学号:"+a[i].getstunumber());
System.out.println(" 学生姓名:"+a[i].getname());
System.out.println(" 请输入修改后的高等数学成绩:");
System.out.println("***********************************************");
a[i].setmathematicsscore(sc.nextDouble());
System.out.println("***********************************************");
System.out.println("石家庄铁道大学软件工程系学生学籍管理系统2019版");
System.out.println("学生考试成绩录入");
System.out.println("***********************************************");
System.out.println("学生学号:"+a[i].getstunumber());
System.out.println("学生姓名:"+a[i].getname());
System.out.println("1,高等数学成绩:"+a[i].getmathematicsscore());
System.out.println("2,大学英语成绩:"+a[i].getenglishiscore());
System.out.println("3,计算机网络成绩:"+a[i].getnetworkscore());
System.out.println("4,数据库成绩:"+a[i].getdatabasescore());
System.out.println("5,软件工程成绩:"+a[i].getsoftwarescore());
System.out.println("***********************************************");
System.out.println(" 该学生成绩录入完毕,是否提交(Y/N)");
String n2=input.next();
if(n2.equals("Y"))
System.out.println("修改成功!!");
else
a[i].setmathematicsscore(d1);
a[i].setenglishiscore(d2);
a[i].setnetworkscore(d3);
a[i].setdatabasescore(d4);
a[i].setsoftwarescore(d5);
System.out.println("录入失败!!");
break;
case 2:
System.out.println("***********************************************");
System.out.println(" 石家庄铁道大学软件工程系学生学籍管理系统2019版");
System.out.println(" 学生考试成绩录入");
System.out.println("***********************************************");
System.out.println(" 学生学号:"+a[i].getstunumber());
System.out.println(" 学生姓名:"+a[i].getname());
System.out.println(" 请输入修改后的大学英语成绩:");
System.out.println("***********************************************");
a[i].setEnglishiscore(input.nextDouble());
System.out.println("***********************************************");
System.out.println("石家庄铁道大学软件工程系学生学籍管理系统2019版");
System.out.println("学生考试成绩录入");
System.out.println("***********************************************");
System.out.println("学生学号:"+a[i].getstunumber());
System.out.println("学生姓名:"+a[i].getname());
System.out.println("1,高等数学成绩:"+a[i].getmathematicsscore());
System.out.println("2,大学英语成绩:"+a[i].getenglishiscore());
System.out.println("3,计算机网络成绩:"+a[i].getnetworkscore());
System.out.println("4,数据库成绩:"+a[i].getdatabasescore());
System.out.println("5,软件工程成绩:"+a[i].getsoftwarescore());
System.out.println("***********************************************");
System.out.println(" 该学生成绩录入完毕,是否提交(Y/N)");
String n4=input.next();
if(n4.equals("Y"))
System.out.println("修改成功!!");
else
a[i].setmathematicsscore(d1);
a[i].setenglishiscore(d2);
a[i].setnetworkscore(d3);
a[i].setdatabasescore(d4);
a[i].setsoftwarescore(d5);
System.out.println("录入失败!!");
break;
case 3:
System.out.println("***********************************************");
System.out.println(" 石家庄铁道大学软件工程系学生学籍管理系统2019版");
System.out.println(" 学生考试成绩录入");
System.out.println("***********************************************");
System.out.println(" 学生学号:"+a[i].getstunumber());
System.out.println(" 学生姓名:"+a[i].getname());
System.out.println(" 请输入修改后的计算机网络成绩:");
System.out.println("***********************************************");
a[i].setnetworkscore(input.nextDouble());
System.out.println("***********************************************");
System.out.println("石家庄铁道大学软件工程系学生学籍管理系统2019版");
System.out.println("学生考试成绩录入");
System.out.println("***********************************************");
System.out.println("学生学号:"+a[i].getstunumber());
System.out.println("学生姓名:"+a[i].getname());
System.out.println("1,高等数学成绩:"+a[i].getmathematicsscore());
System.out.println("2,大学英语成绩:"+a[i].getenglishiscore());
System.out.println("3,计算机网络成绩:"+a[i].getnetworkscore());
System.out.println("4,数据库成绩:"+a[i].getdatabasescore());
System.out.println("5,软件工程成绩:"+a[i].getsoftwarescore());
System.out.println("***********************************************");
System.out.println(" 该学生成绩录入完毕,是否提交(Y/N)");
String n5=input.next();
if(n5.equals("Y"))
System.out.println("修改成功!!");
else
a[i].setmathematicsscore(d1);
a[i].setenglishiscore(d2);
a[i].setnetworkscore(d3);
a[i].setdatabasescore(d4);
a[i].setsoftwarescore(d5);
System.out.println("录入失败!!");
break;
case 4:
System.out.println("***********************************************");
System.out.println(" 石家庄铁道大学软件工程系学生学籍管理系统2019版");
System.out.println(" 学生考试成绩录入");
System.out.println("***********************************************");
System.out.println(" 学生学号:"+a[i].getstunumber());
System.out.println(" 学生姓名:"+a[i].getname());
System.out.println(" 请输入修改后的数据库成绩:");
System.out.println("***********************************************");
a[i].setdatabasescore(input.nextDouble());
System.out.println("***********************************************");
System.out.println("石家庄铁道大学软件工程系学生学籍管理系统2019版");
System.out.println("学生考试成绩录入");
System.out.println("***********************************************");
System.out.println("学生学号:"+a[i].getstunumber());
System.out.println("学生姓名:"+a[i].getmame());
System.out.println("1,高等数学成绩:"+a[i].getmathematicsscore());
System.out.println("2,大学英语成绩:"+a[i].getenglishiscore());
System.out.println("3,计算机网络成绩:"+a[i].getnetworkscore());
System.out.println("4,数据库成绩:"+a[i].getdatabasescore());
System.out.println("5,软件工程成绩:"+a[i].getsoftwarescore());
System.out.println("***********************************************");
System.out.println(" 该学生成绩录入完毕,是否提交(Y/N)");
String n6=input.next();
if(n6.equals("Y"))
System.out.println("修改成功!!");
else
a[i].setmathematicsscore(d1);
a[i].setenglishiscore(d2);
a[i].setnetworkscore(d3);
a[i].setdatabasescore(d4);
a[i].setsoftwarescore(d5);
System.out.println("录入失败!!");
break;
case 5:
System.out.println("***********************************************");
System.out.println(" 石家庄铁道大学软件工程系学生学籍管理系统2019版");
System.out.println(" 学生考试成绩录入");
System.out.println("***********************************************");
System.out.println(" 学生学号:"+a[i].getstunumber());
System.out.println(" 学生姓名:"+a[i].getname());
System.out.println(" 请输入修改后的软件工程成绩:");
System.out.println("***********************************************");
a[i].setSoftwarescore(sc.nextDouble());
System.out.println("***********************************************");
System.out.println("石家庄铁道大学软件工程系学生学籍管理系统2019版");
System.out.println("学生考试成绩录入");
System.out.println("***********************************************");
System.out.println("学生学号:"+a[i].getstunumber());
System.out.println("学生姓名:"+a[i].getname());
System.out.println("1,高等数学成绩:"+a[i].getmathematicsscore());
System.out.println("2,大学英语成绩:"+a[i].getenglishiscore());
System.out.println("3,计算机网络成绩:"+a[i].getnetworkscore());
System.out.println("4,数据库成绩:"+a[i].getdatabasescore());
System.out.println("5,软件工程成绩:"+a[i].getsoftwarescore());
System.out.println("***********************************************");
System.out.println(" 该学生成绩录入完毕,是否提交(Y/N)");
String n7=input.next();
if(n7.equals("Y"))
System.out.println("修改成功!!");
else
a[i].setmathematicsscore(d1);
a[i].setenglishiscore(d2);
a[i].setnetworkscore(d3);
a[i].setdatabasescore(d4);
a[i].setsoftwarescore(d5);
System.out.println("录入失败!!");
break;
break;
case 3:
while(ll=true)
double t1,t2,t3,t4,t5;
System.out.println("***********************************************");
System.out.println(" 石家庄铁道大学软件工程系学生学籍管理系统2019版");
System.out.println(" 学生考试成绩绩点计算界面 ");
System.out.println("***********************************************");
System.out.println(" 请输入学生学号:");
String n4=input.next();
System.out.println("***********************************************");
for( i=0;i<5;i++)
if(n4.equals(a[i].getstunumber()))
l=true;break;
if(l)
if(a[i].getmathematicsscore()>=90)
t1=4.0;
else if(a[i].getmathematicsscore()>=85&&a[i].getmathematicsscore()<=89.9)
t1=3.7;
else if(a[i].getmathematicsscore()>=82&&a[i].getmathematicsscore()<=84.9)
t1=3.3;
else if(a[i].getmathematicsscore()>=78&&a[i].getmathematicsscore()<=81.9)
t1=3.0;
else if(a[i].getMathematicsscore()>=75&&a[i].getmathematicsscore()<=77.9)
t1=2.7;
else if(a[i].getmathematicsscore()>=72&&a[i].getmathematicsscore()<=74.9)
t1=2.3;
else if(a[i].getmathematicsscore()>=68&&a[i].getmathematicsscore()<=71.9)
t1=2.0;
else if(a[i].getmathematicsscore()>=66&&a[i].getmathematicsscore()<=67.9)
t1=1.7;
else if(a[i].getmathematicsscore()>=64&&a[i].getmathematicsscore()<=65.9)
t1=1.5;
else if(a[i].getmathematicsscore()>=60&&a[i].getmathematicsscore()<=63.9)
t1=1.0;
else
t1=0;
if(a[i].getenglishiscore()>=90)
t2=4.0;
else if(a[i].getenglishiscore()>=85&&a[i].getenglishiscore()<=89.9)
t2=3.7;
else if(a[i].getenglishiscore()>=82&&a[i].getenglishiscore()<=84.9)
t2=3.3;
else if(a[i].getenglishiscore()>=78&&a[i].getenglishiscore()<=81.9)
t2=3.0;
else if(a[i].getenglishiscore()>=75&&a[i].getenglishiscore()<=77.9)
t2=2.7;
else if(a[i].getenglishiscore()>=72&&a[i].getenglishiscore()<=74.9)
t2=2.3;
else if(a[i].getenglishiscore()>=68&&a[i].getenglishiscore()<=71.9)
t2=2.0;
else if(a[i].getenglishiscore()>=66&&a[i].getenglishiscore()<=67.9)
t2=1.7;
else if(a[i].getenglishiscore()>=64&&a[i].getenglishiscore()<=65.9)
t2=1.5;
else if(a[i].getenglishiscore()>=60&&a[i].getenglishiscore()<=63.9)
t2=1.0;
else
t2=0;
if(a[i].getnetworkscore()>=90)
t3=4.0;
else if(a[i].getnetworkscore()>=85&&a[i].getnetworkscore()<=89.9)
t3=3.7;
else if(a[i].getnetworkscore()>=82&&a[i].getnetworkscore()<=84.9)
t3=3.3;
else if(a[i].getnetworkscore()>=78&&a[i].getnetworkscore()<=81.9)
t3=3.0;
else if(a[i].getnetworkscore()>=75&&a[i].getnetworkscore()<=77.9)
t3=2.7;
else if(a[i].getnetworkscore()>=72&&a[i].getnetworkscore()<=74.9)
t3=2.3;
else if(a[i].getnetworkscore()>=68&&a[i].getnetworkscore()<=71.9)
t3=2.0;
else if(a[i].getnetworkscore()>=66&&a[i].getnetworkscore()<=67.9)
t3=1.7;
else if(a[i].getnetworkscore()>=64&&a[i].getnetworkscore()<=65.9)
t3=1.5;
else if(a[i].getnetworkscore()>=60&&a[i].getnetworkscore()<=63.9)
t3=1.0;
else
t3=0;
if(a[i].getdatabasescore()>=90)
t4=4.0;
else if(a[i].getdatabasescore()>=85&&a[i].getdatabasescore()<=89.9)
t4=3.7;
else if(a[i].getdatabasescore()>=82&&a[i].getdatabasescore()<=84.9)
t4=3.3;
else if(a[i].getdatabasescore()>=78&&a[i].getdatabasescore()<=81.9)
t4=3.0;
else if(a[i].getdatabasescore()>=75&&a[i].getdatabasescore()<=77.9)
t4=2.7;
else if(a[i].getdatabasescore()>=72&&a[i].getdatabasescore()<=74.9)
t4=2.3;
else if(a[i].getdatabasescore()>=68&&a[i].getdatabasescore()<=71.9)
t4=2.0;
else if(a[i].getdatabasescore()>=66&&a[i].getdatabasescore()<=67.9)
t4=1.7;
else if(a[i].getdatabasescore()>=64&&a[i].getdatabasescore()<=65.9)
t4=1.5;
else if(a[i].getdatabasescore()>=60&&a[i].getdatabasescore()<=63.9)
t4=1.0;
else
t4=0;
if(a[i].getnetworkscore()>=90)
t5=4.0;
else if(a[i].getnetworkscore()>=85&&a[i].getnetworkscore()<=89.9)
t5=3.7;
else if(a[i].getnetworkscore()>=82&&a[i].getnetworkscore()<=84.9)
t5=3.3;
else if(a[i].getnetworkscore()>=78&&a[i].getnetworkscore()<=81.9)
t5=3.0;
else if(a[i].getnetworkscore()>=75&&a[i].getnetworkscore()<=77.9)
t5=2.7;
else if(a[i].getnetworkscore()>=72&&a[i].getnetworkscore()<=74.9)
t5=2.3;
else if(a[i].getnetworkscore()>=68&a[i].getnetworkscore()<=71.9)
t5=2.0;
else if(a[i].getnetworkscore()>=66&&a[i].getnetworkscore()<=67.9)
t5=1.7;
else if(a[i].getnetworkscore()>=64&&a[i].getnetworkscore()<=65.9)
t5=1.5;
else if(a[i].getnetworkscore()>=60&&a[i].getnetworkscore()<=63.9)
t5=1.0;
else
t5=0;
double tt,ttt;
tt=(t1*4+t2*3+t3*4+t4*3+t5*2)/16;
ttt=(double)math.round(tt*100)/100;
System.out.println("***********************************************");
System.out.println(" 石家庄铁道大学软件工程系学生学籍管理系统2019版");
System.out.println(" 学生考试成绩录入");
System.out.println("***********************************************");
System.out.println(" 学生学号:"+a[i].getstunumber());
System.out.println(" 学生姓名:"+a[i].getname());
System.out.println(" 高等数学绩点:"+t1);
System.out.println(" 高等数学绩点:"+t2);
System.out.println(" 计算机网络绩点:"+t3);
System.out.println(" 数据库绩点:"+t4);
System.out.println(" 软件工程绩点:"+t5);
System.out.println(" 你的平均绩点绩点:"+ttt);
if(tt>=2)
System.out.println(" 你的学分绩点达到毕业水平");
else
System.out.println(" 你的学分绩点没有达到毕业水平");
System.out.println(" 该学生成绩录入完毕,是否提交(Y/N)");
System.out.println("***********************************************");
String n6;
n6=sc.next();
if(n6.equals("N"))
ll=true;
else
break;
break;
case 4:
System.out.println("***********************************************************");
System.out.println(" 谢谢使用石家庄铁道大学软件工程系学生学籍管理系统 2019 版 ");
System.out.println(" 制作人:赵常恒 ");
System.out.println("***********************************************************");
return;
default:
System.out.println("该选项不存在!!!");
break;
//最后修改时间:2019.9.12
以上是关于课堂小测的主要内容,如果未能解决你的问题,请参考以下文章