package 考试;

/*信1807-8

* 20183798

* 向瑜

*/

import java.util.Scanner;

//ScoreInformation 类

class ScoreInformation {

private String stunumber;

private String name;

private double mathematicsscore;

private double englishscore;

private double networkscore;

private double databasescore;

private double softwarescore;

public ScoreInformation() {

}

public ScoreInformation(String stunumber, String name, double mathematicsscore, double englishscore,

double networkscore, double databasescore, double softwarescore) {

this.stunumber = stunumber;

this.name = name;

this.mathematicsscore = mathematicsscore;

this.englishscore = englishscore;

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 getenglishscore() {

return englishscore;

}

public void setenglishscore(double englishscore) {

this.englishscore = englishscore;

}

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;

}

}

class ScoreManagement {

static Scanner scan = new Scanner(System.in);

static Scanner sc = new Scanner(System.in);

static boolean ll = false;

static boolean l = false;

static ScoreInformation[] a = new ScoreInformation[5];

static void xiang() {

a[0] = new ScoreInformation("11111111", "向", 0, 0, 0, 0, 0);

a[1] = new ScoreInformation("22222222", "瑜", 0, 0, 0, 0, 0);

a[2] = new ScoreInformation("33333333", "向瑜", 0, 0, 0, 0, 0);

a[3] = new ScoreInformation("44444444", "瑜向", 0, 0, 0, 0, 0);

a[4] = new ScoreInformation("55555555", "向瑜向", 0, 0, 0, 0, 0);

}

static int i;

public static void enter() {

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(sc.nextDouble());

System.out.println("请输入大学英语成绩:");

a[i].setenglishscore(sc.nextDouble());

System.out.println("请输入计算机网络成绩:");

a[i].setnetworkscore(sc.nextDouble());

System.out.println("请输入数据库成绩:");

a[i].setdatabasescore(sc.nextDouble());

System.out.println("请输入软件工程成绩:");

a[i].setsoftwarescore(sc.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].getenglishscore());

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 = sc.next();

if (n2.equals("Y")) {

System.out.println("录入成功!!");

break;

} else {

a[i].setmathematicsscore(0);

a[i].setenglishscore(0);

a[i].setnetworkscore(0);

a[i].setdatabasescore(0);

a[i].setsoftwarescore(0);

System.out.println("录入失败!!");

ll = true;

}

} else {

System.out.println("该学号不存在!!!");

ll = true;

}

}

}

public static void updata() {

double d1, d2, d3, d4, d5;

d1 = a[i].getmathematicsscore();

d2 = a[i].getenglishscore();

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 = sc.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].getenglishscore());

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 = sc.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].getenglishscore());

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 = sc.next();

if (n2.equals("Y"))

System.out.println("修改成功!!");

else {

a[i].setmathematicsscore(d1);

a[i].setenglishscore(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].setenglishscore(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].getenglishscore());

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 = sc.next();

if (n4.equals("Y"))

System.out.println("修改成功!!");

else {

a[i].setmathematicsscore(d1);

a[i].setenglishscore(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(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].getenglishscore());

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 = sc.next();

if (n5.equals("Y"))

System.out.println("修改成功!!");

else {

a[i].setmathematicsscore(d1);

a[i].setenglishscore(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(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].getenglishscore());

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 = sc.next();

if (n6.equals("Y"))

System.out.println("修改成功!!");

else {

a[i].setmathematicsscore(d1);

a[i].setenglishscore(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].getenglishscore());

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 = sc.next();

if (n7.equals("Y"))

System.out.println("修改成功!!");

else {

a[i].setmathematicsscore(d1);

a[i].setenglishscore(d2);

a[i].setnetworkscore(d3);

a[i].setdatabasescore(d4);

a[i].setsoftwarescore(d5);

System.out.println("录入失败!!");

}

break;

}

}

public static void count() {

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 = sc.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].getenglishscore() >= 90)

t2 = 4.0;

else if (a[i].getenglishscore() >= 85 && a[i].getenglishscore() <= 89.9)

t2 = 3.7;

else if (a[i].getenglishscore() >= 82 && a[i].getenglishscore() <= 84.9)

t2 = 3.3;

else if (a[i].getenglishscore() >= 78 && a[i].getenglishscore() <= 81.9)

t2 = 3.0;

else if (a[i].getenglishscore() >= 75 && a[i].getenglishscore() <= 77.9)

t2 = 2.7;

else if (a[i].getenglishscore() >= 72 && a[i].getenglishscore() <= 74.9)

t2 = 2.3;

else if (a[i].getenglishscore() >= 68 && a[i].getenglishscore() <= 71.9)

t2 = 2.0;

else if (a[i].getenglishscore() >= 66 && a[i].getenglishscore() <= 67.9)

t2 = 1.7;

else if (a[i].getenglishscore() >= 64 && a[i].getenglishscore() <= 65.9)

t2 = 1.5;

else if (a[i].getenglishscore() >= 60 && a[i].getenglishscore() <= 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("***********************************************");

}

String n6;

n6 = sc.next();

if (n6.equals("N")) {

ll = true;

} else

break;

}

}

public static void quit() {

System.out.println("***********************************************************");

System.out.println("谢谢使用石家庄铁道大学软件工程系学生学籍管理系统 2019 版"); System.out.println("***********************************************************");

}

public static void main(String[] args) {

xiang();

int p = 0;

while (p != 4) {

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("***********************************************************");

p = scan.nextInt();

switch (p) {

case 1:

enter();

break;

case 2:

updata();

break;

case 3:

count();

break;

case 4:

quit();

break;

default:

System.out.println("输入错误请重新输入!");

}

}

}

}

最新文章

  1. C语言 独木舟问题
  2. 更改mysql中当前auto_increment的值的方法
  3. 【python cookbook】【字符串与文本】16.以固定的列数重新格式化文本
  4. 【转】在Source Insight中看Python代码
  5. 利用iOS8新特性计算cell的实际高度
  6. 关于cocos2dx 3.0升级崩溃报错(unable to load native library) 和(Fatal signal 11 (SIGSEGV) at 0x00000000)
  7. 智能生活 “视”不可挡——首届TCL杯HTML5智能电视开发大赛等你来挑战
  8. hunnu-11546--Sum of f(x)
  9. VS解决方案创建
  10. python3 数据类型
  11. jsp Servlet 文件上传
  12. Linux&#160;Linux下最大文件描述符设置
  13. 非常可乐 HDU1495
  14. [LeetCode] 747. Largest Number At Least Twice of Others_Easy
  15. ubuntu16.04搭建geodjango+postgresql+postgis的WebGIS框架(二))安装postgresql和postgis
  16. Git 别名(分布式版本控制系统)
  17. (转)话说C语言const用法
  18. [3] 球(Sphere)图形的生成算法
  19. struts1和struts2比较
  20. Codeforces Round #303 (Div. 2) B. Equidistant String 水题

热门文章

  1. initramfs机制
  2. 《Redis 设计与实现》读书笔记(二)
  3. Codeforces Round #588 (Div. 2) A. Dawid and Bags of Candies
  4. Waiting (TTFB) 时间
  5. 12 saltstack部署OpenStack
  6. [Shell] 分隔字符串为数组
  7. hdu6568 Math (概率dp)
  8. 【APUE】第3章 文件I/O (2) 函数creat、lseek、read、write使用说明
  9. mac使用jadx逆向app
  10. GIT上面有的分支,本地却无法检出,也看不到该分支