static ScoreInformation s [] = new ScoreInformation [5];
static int a;
//主页面
static void choice(){
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("********************************");
}
//成绩录入页面
static void function1 (){
System.out.println("***************************************");
System.out.println(" 石家庄铁道大学软件工程系学生学籍管理系统2019版");
System.out.println(" 学生考试成绩录入");
System.out.println("***************************************");
}
//成绩修改
static void function2 (){
System.out.println("***************************************");
System.out.println(" 石家庄铁道大学软件工程系学生学籍管理系统2019版");
System.out.println(" 学生考试成绩修改界面");
System.out.println("***************************************");
}
//绩点计算界面
static void function3(){
System.out.println("***************************************");
System.out.println(" 石家庄铁道大学软件工程系学生学籍管理系统2019版");
System.out.println(" 学生考试成绩绩点计算界面");
System.out.println("***************************************");
}
//设置学号和姓名初值
static void seti() {
s[0]=new ScoreInformation();
s[0].setstunumber("20183792");
s[0].setname("宋鑫爱");
s[1]=new ScoreInformation();
s[1].setstunumber("20183793");
s[1].setname("王");
s[2]=new ScoreInformation();
s[2].setstunumber("20183794");
s[2].setname("张");
s[3]=new ScoreInformation();
s[3].setstunumber("20183795");
s[3].setname("李");
s[4]=new ScoreInformation();
s[4].setstunumber("20183796");
s[4].setname("吴");
}
//实现成绩录入功能
static void input(){
Scanner scan=new Scanner(System.in);
double mathematicsscore,englishiscore,networkscore,databasescore,softwarescore;
function1();
System.out.print("请输入学生学号:");
String number;
number=scan.next();
for(int i=0;i<5;i++){
if(number.equals(s[i].getstunumber())){
a=i;
break;
}
if(i==4) {
System.out.println("该学号不存在请重新输入");
input();
}
}
function1();
System.out.print("学生学号:");
System.out.println(s[a].getstunumber());
System.out.print("学生姓名:");
System.out.println(s[a].getname());
System.out.print("请输入高等数学成绩:");
mathematicsscore=scan.nextDouble();
function1();
System.out.print("请输入英语成绩");
englishiscore=scan.nextDouble();
function1();
System.out.print("请输入计算机网络成绩");
networkscore=scan.nextDouble();
function1();
System.out.print("请输入数据库成绩");
databasescore=scan.nextDouble();
function1();
System.out.print("请输入软件工程成绩");
softwarescore=scan.nextDouble();
function1();
System.out.println("学生学号:"+s[a].getstunumber());
System.out.println("学生姓名:"+s[a].getname());
System.out.println("高等数学成绩:"+mathematicsscore);
System.out.println("大学英语成绩:"+englishiscore);
System.out.println("计算机网络成绩:"+networkscore);
System.out.println("数据库成绩"+databasescore);
System.out.println("软件工程成绩:"+softwarescore);
System.out.println("该学生成绩已录入完毕,是否提交(Y/N");
System.out.println("**************************************");
String t;
t=scan.next();
if(t.equalsIgnoreCase("Y")){
s[a].setmathematicsscore(mathematicsscore);
s[a].setenglishiscore(englishiscore);
s[a].setnetworkscore(networkscore);
s[a].setdatabasescore(databasescore);
s[a].setsoftwarescore(softwarescore);
} else {
function1();
}
}
//实现成绩修改功能
static void change(){
function2();
System.out.print("请输入学生学号:");
Scanner scan=new Scanner(System.in);
double mathmaticsscore = 0,englishiscore = 0,networkscore=0,databasescore=0,softwarescore=0;
String t;
t=scan.next();
for(int i=0;i<5;i++){
if(t.equals(s[i].getstunumber())){
a=i;
break;
}
if(i==4) {
System.out.println("该学号不存在请重新输入");
change();
}
}
function1();
System.out.println("学生学号:"+s[a].getstunumber());
System.out.println("学生姓名:"+s[a].getname());
System.out.println("1. 高等数学成绩:"+s[a].getmathematicsscore());
System.out.println("2. 大学英语成绩:"+s[a].getenglishiscore());
System.out.println("3. 计算机网络成绩:"+s[a].getnetworkscore());
System.out.println("4. 数据库成绩"+s[a].getdatabasescore());
System.out.println("5. 软件工程成绩:"+s[a].getsoftwarescore());
System.out.print("请输入需要修改科目名称数字编号:");
int u;
u=scan.nextInt();
switch(u){
case 1:
function1();
System.out.println("学生学号:"+s[a].getstunumber());
System.out.println("学生姓名:"+s[a].getname());
System.out.print("请输入修改后高数成绩:");
mathmaticsscore=scan.nextDouble();
s[a].setmathematicsscore(mathmaticsscore);
break;
case 2:
function1();
System.out.println("学生学号:"+s[a].getstunumber());
System.out.println("学生姓名:"+s[a].getname());
System.out.print("请输入修改后英语成绩:");
englishiscore=scan.nextDouble();
s[a].setenglishiscore(englishiscore);
break;
case 3:
function1();
System.out.println("学生学号:"+s[a].getstunumber());
System.out.println("学生姓名:"+s[a].getname());
System.out.print("请输入修改后计算机网络成绩:");
networkscore=scan.nextDouble();
s[a].setnetworkscore(networkscore);
break;
case 4:
function1();
System.out.println("学生学号:"+s[a].getstunumber());
System.out.println("学生姓名:"+s[a].getname());
System.out.print("请输入修改后数据库成绩:");
databasescore=scan.nextDouble();
s[a].setdatabasescore(databasescore);
break;
case 5:
function1();
System.out.println("学生学号:"+s[a].getstunumber());
System.out.println("学生姓名:"+s[a].getname());
System.out.print("请输入修改后软件工程成绩:");
softwarescore=scan.nextDouble();
s[a].setsoftwarescore(softwarescore);
break;
}
function1();
System.out.println("学生学号:"+s[a].getstunumber());
System.out.println("学生姓名:"+s[a].getname());
System.out.println("高等数学成绩:"+s[a].getmathematicsscore());
System.out.println("大学英语成绩:"+s[a].getenglishiscore());
System.out.println("计算机网络成绩:"+s[a].getnetworkscore());
System.out.println("数据库成绩"+s[a].getdatabasescore());
System.out.println("软件工程成绩:"+s[a].getsoftwarescore());
System.out.println("该学生成绩已录入完毕,是否提交(Y/N");
System.out.println("**************************************");
String str;
str=scan.next();
if(str.equalsIgnoreCase("Y")) {
choice();
} else {
function2();
}
}
//实现学分绩点计算功能
static void calculate() {
function3();
System.out.print("请输入学生学号:");
Scanner scan=new Scanner(System.in);
String p;
p=scan.next();
double m = 0;
if(s[a].getmathematicsscore()<60)
m=0;
else if(s[a].getmathematicsscore()>=60&&s[a].getmathematicsscore()<=63.9)
m=1.0;
else if(s[a].getmathematicsscore()>=64&&s[a].getmathematicsscore()<=65.9)
m=1.5;
else if(s[a].getmathematicsscore()>=66&&s[a].getmathematicsscore()<=67.9)
m=1.7;
else if(s[a].getmathematicsscore()>=68&&s[a].getmathematicsscore()<=71.9)
m=2.0;
else if(s[a].getmathematicsscore()>=72&&s[a].getmathematicsscore()<=74.9)
m=2.3;
else if(s[a].getmathematicsscore()>=75&&s[a].getmathematicsscore()<=77.9)
m=2.7;
else if(s[a].getmathematicsscore()>=78&&s[a].getmathematicsscore()<=81.9)
m=3.0;
else if(s[a].getmathematicsscore()>=82&&s[a].getmathematicsscore()<=84.9)
m=3.3;
else if(s[a].getmathematicsscore()>=85&&s[a].getmathematicsscore()<=89.9)
m=3.7;
else if(s[a].getmathematicsscore()>=90)
m=4.0;
double e = 0;
if(s[a].getenglishiscore()<60)
e=0;
else if(s[a].getenglishiscore()>=60&&s[a].getenglishiscore()<=63.9)
e=1.0;
else if(s[a].getenglishiscore()>=64&&s[a].getenglishiscore()<=65.9)
e=1.5;
else if(s[a].getenglishiscore()>=66&&s[a].getenglishiscore()<=67.9)
e=1.7;
else if(s[a].getenglishiscore()>=68&&s[a].getenglishiscore()<=71.9)
e=2.0;
else if(s[a].getenglishiscore()>=72&&s[a].getenglishiscore()<=74.9)
e=2.3;
else if(s[a].getenglishiscore()>=75&&s[a].getenglishiscore()<=77.9)
e=2.7;
else if(s[a].getenglishiscore()>=78&&s[a].getenglishiscore()<=81.9)
e=3.0;
else if(s[a].getenglishiscore()>=82&&s[a].getenglishiscore()<=84.9)
e=3.3;
else if(s[a].getenglishiscore()>=85&&s[a].getenglishiscore()<=89.9)
e=3.7;
else if(s[a].getenglishiscore()>=90)
e=4.0;
double n = 0;
if(s[a].getnetworkscore()<60)
n=0;
else if(s[a].getnetworkscore()>=60&&s[a].getnetworkscore()<=63.9)
n=1.0;
else if(s[a].getnetworkscore()>=64&&s[a].getnetworkscore()<=65.9)
n=1.5;
else if(s[a].getnetworkscore()>=66&&s[a].getnetworkscore()<=67.9)
n=1.7;
else if(s[a].getnetworkscore()>=68&&s[a].getnetworkscore()<=71.9)
n=2.0;
else if(s[a].getnetworkscore()>=72&&s[a].getnetworkscore()<=74.9)
n=2.3;
else if(s[a].getnetworkscore()>=75&&s[a].getnetworkscore()<=77.9)
n=2.7;
僵尸符 else if(s[a].getnetworkscore()>=78&&s[a].getnetworkscore()<=81.9)
n=3.0;
else if(s[a].getnetworkscore()>=82&&s[a].getnetworkscore()<=84.9)
n=3.3;
else if(s[a].getnetworkscore()>=85&&s[a].getnetworkscore()<=89.9)
n=3.7;
else if(s[a].getnetworkscore()>=90)
n=4.0;
double d = 0;
if(s[a].getdatabasescore()<60)
d=0;
else if(s[a].getdatabasescore()>=60&&s[a].getdatabasescore()<=63.9)
d=1.0;
else if(s[a].getdatabasescore()>=64&&s[a].getdatabasescore()<=65.9)
d=1.5;
else if(s[a].getdatabasescore()>=66&&s[a].getdatabasescore()<=67.9)
d=1.7;
else if(s[a].getdatabasescore()>=68&&s[a].getdatabasescore()<=71.9)
d=2.0;
else if(s[a].getdatabasescore()>=72&&s[a].getdatabasescore()<=74.9)
d=2.3;
else if(s[a].getdatabasescore()>=75&&s[a].getdatabasescore()<=77.9)
d=2.7;
else if(s[a].getdatabasescore()>=78&&s[a].getdatabasescore()<=81.9)
d=3.0;
else if(s[a].getdatabasescore()>=82&&s[a].getdatabasescore()<=84.9)
d=3.3;
else if(s[a].getdatabasescore()>=85&&s[a].getdatabasescore()<=89.9)
d=3.7;
else if(s[a].getdatabasescore()>=90)
d=4.0;
double q = 0;
if(s[a].getsoftwarescore()<60)
q=0;
else if(s[a].getsoftwarescore()>=60&&s[a].getsoftwarescore()<=63.9)
q=1.0;
else if(s[a].getsoftwarescore()>=64&&s[a].getsoftwarescore()<=65.9)
q=1.5;
else if(s[a].getsoftwarescore()>=66&&s[a].getsoftwarescore()<=67.9)
q=1.7;
else if(s[a].getsoftwarescore()>=68&&s[a].getsoftwarescore()<=71.9)
q=2.0;
else if(s[a].getsoftwarescore()>=72&&s[a].getsoftwarescore()<=74.9)
q=2.3;
else if(s[a].getsoftwarescore()>=75&&s[a].getsoftwarescore()<=77.9)
q=2.7;
else if(s[a].getsoftwarescore()>=78&&s[a].getsoftwarescore()<=81.9)
q=3.0;
else if(s[a].getsoftwarescore()>=82&&s[a].getsoftwarescore()<=84.9)
q=3.3;
else if(s[a].getsoftwarescore()>=85&&s[a].getsoftwarescore()<=89.9)
q=3.7;
else if(s[a].getsoftwarescore()>=90)
q=4.0;
double ave=0;
ave=(m*4+e*3+n*4+d*3+q*2)/16;
function3();
System.out.println("学生学号:"+s[a].getstunumber());
System.out.println("学生姓名:"+s[a].getname());
System.out.println("高等数学成绩绩点:"+m);
System.out.println("大学英语成绩绩点:"+e);
System.out.println("计算机网络成绩绩点:"+n);
System.out.println("数据库成绩绩点"+d);
System.out.println("软件工程成绩绩点:"+q);
System.out.println("你的平均学分绩点为:"+String.format("%.2f",ave));
System.out.print("提示信息:");
if(ave>=2) {
System.out.println("你的学分绩点已达到毕业要求!");
}
else
{
System.out.println("你的学分绩点不满足毕业要求!");
}
System.out.println("是否返回系统主界面:(Y/N)");
System.out.println("*****************************");
String str;
str=scan.next();
if(str.equalsIgnoreCase("Y"))
{
choice();
}
}
//在主类中调用相应函数
public static void main(String[] args) {
seti();
while(true) {
choice();
int i;
Scanner scan=new Scanner(System.in);
i=scan.nextInt();
switch(i) {
case 1:
input();break;
case 2:
change();break;
僵尸符 case 3:
calculate();break;
case 4:
System.out.println("*********************************");
System.out.println("谢谢使用石家庄铁道大学软件工程系学生学籍管理系统2019版");
System.out.println(" 制作人:宋鑫爱");
System.out.println("*********************************");
break;
default:
System.out.println("该选项不存在");
}
}
}
}