-->

学生学籍管理系统 2019 版

2021-01-14 03:52发布

package 学生成绩管理系统;


//20183594 申澳宇
public class ScoreInformation{
private String stunumber;
private String name;
private double mathematicsscore;
private double englishiscore;
private double networkscore;
private double databasescore;
private double softwarescore;


public String getStunumber(){
return stunumber;
}
public String getName(){

return name;

}
public double getMathematicsscore(){
return mathematicsscore;
}
public double getEnglishiscore(){
return englishiscore;
}
public double getNetworkscore(){
return networkscore;
}
public double getDatabasescore(){
return databasescore;
}
public double getSoftwarescore(){
return softwarescore;
}
public void setStunumber(String A){
this.stunumber = A;
}
public void setName(String A){
this.name = A;
}
public void setMathematicsscore(double A){
this.mathematicsscore = A;
}
public void setEnglishiscore(double A){
this.englishiscore = A;
}
public void setNetworkscore(double A){
this.networkscore = A;
}
public void setDatabasescore(double A){
this.databasescore = A;
}
public void setSoftwarescore(double A){
this.softwarescore = A;
}
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;
}
}

package 学生成绩管理系统;
import java.util.Scanner;
import 学生成绩管理系统.ScoreInformation;
public class ScoreManagement {
public static void main(String[] args) {
Scanner A = new Scanner(System.in);
ScoreInformation[] stu = new ScoreInformation[5];
stu[0] = new ScoreInformation("19991021", "Albert",1,1,1,1,1);
stu[1] = new ScoreInformation("19991022", "Jack",2,2,2,2,2);
stu[2] = new ScoreInformation("19991023", "Ternura",3,3,3,3,3);
stu[3] = new ScoreInformation("19991024", "Akihi",4,4,4,4,4);
stu[4] = new ScoreInformation("19991025", "Robot",5,5,5,5,5);
display(stu);
}
private static void display(ScoreInformation[] stu) {
Scanner A = new Scanner(System.in);
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 a = A.nextInt();
switch(a) {
case 1:record(stu);break;//录入
case 2:change(stu);break;//修改
case 3:calculate(stu);break;//计算
case 4:finish();break;//退出
default:
{
System.out.println("选项不存在");
display(stu);
break;
}
}
}
private static void record(ScoreInformation[] stu) {//录入
Scanner A = new Scanner(System.in);
System.out.println("***********************************************************");
System.out.println(" 石家庄铁道大学软件工程系学生学籍管理系统 2019 版 ");
System.out.println(" 学生考试成绩录入 ");
System.out.println("***********************************************************");
System.out.println(" 请输入学生学号:" );
System.out.println("***********************************************************");
Scanner B = new Scanner(System.in);
String number = B.nextLine();
int flag = 0,i;
for (i = 0; i < 5; i++)
{
if (number.equals(stu[i].getStunumber())) {
System.out.println("*********************************************");
System.out.println(" 石家庄铁道大学软件工程系学生学籍管理系统 2019 版 ");
System.out.println(" 学生学号:"+stu[i].getStunumber() );
System.out.println(" 学生姓名:"+stu[i].getName() );
System.out.println(" 请输入高等数学成绩:" );
System.out.println("***********************************************");
double math = B.nextDouble();
System.out.println(stu[i].getName() + "的高数成绩是:" + math);
System.out.print(" 请输入英语成绩:" );
double english = B.nextDouble();
System.out.println(stu[i].getName() + "的英语成绩是:" + english);
System.out.print(" 请输入计算机网络成绩:" );
double network = B.nextDouble();
System.out.println(stu[i].getName() + "的计算机网络成绩是:" + network);
System.out.print(" 请输入数据库成绩:" );
double data = B.nextDouble();
System.out.println(stu[i].getName() + "的数据库成绩是:" + data);
System.out.print(" 请输入的软件成绩:" );
double soft = B.nextDouble();
System.out.println("********************************************");
System.out.println(" 石家庄铁道大学软件工程系学生学籍管理系统 2019 版");
System.out.println(" 学生姓名:"+stu[i].getName());
System.out.println(" 高等数学成绩:"+math);
System.out.println(" 大学英语成绩:"+english);
System.out.println(" 计算机网络成绩:"+network);
System.out.println(" 数据库成绩:"+data);
System.out.println(" 软件工程成绩:"+soft);
System.out.print(" 该学生成绩已录入完毕,是否提交(Y/N)");
System.out.println("**********************************************");
if( B.next().equals("Y"))
{
stu[i].setEnglishiscore(english);
stu[i].setMathematicsscore(math);
stu[i].setDatabasescore(data);
stu[i].setNetworkscore(network);
stu[i].setSoftwarescore(soft);
display(stu);
} else
{
System.out.println("返回录入页面");
record(stu);
}
flag = 1;
}
}
// 如果没有该学生信息,提示重新输入。
if (flag == 0)
{
System.out.println("该学号不存在,请重新输入");
record(stu);
}
}
private static void change(ScoreInformation[] stu) {//修改
Scanner A = new Scanner(System.in);
System.out.println("***********************************************************");
System.out.println(" 石家庄铁道大学软件工程系学生学籍管理系统 2019 版 ");
System.out.println(" 学生考试成绩修改界面 ");
System.out.println("***********************************************************");
System.out.println(" 请输入学生学号: ");
System.out.println("***********************************************************");
Scanner B = new Scanner(System.in);
String number = B.nextLine();
int flag = 0;
for (int i = 0; i < 5; i++)
{
if (stu[i].getStunumber().equals(number))
{
System.out.println("***********************************************");
System.out.println("石家庄铁道大学软件工程系学生学籍管理系统 2019 版");
System.out.println("学生考试成绩录入");
System.out.println("*************************************************");
System.out.println(" 学生学号:"+stu[i].getStunumber());
System.out.println(" 学生姓名:"+stu[i].getName());
System.out.println(" 1、高等数学成绩:"+stu[i].getMathematicsscore());
System.out.println(" 2、大学英语成绩:" + stu[i].getSoftwarescore());
System.out.println(" 3、计算机网络成绩:" + stu[i].getNetworkscore());
System.out.println(" 4、数据库成绩:" + stu[i].getDatabasescore());
System.out.println(" 5、软件工程成绩:" + stu[i].getSoftwarescore());
System.out.println("**************************************************");
int select = A.nextInt();
double chang=0;
switch (select)
{
case 1:
System.out.println(" 学生考试成绩录入界面 ");
System.out.println("*****************************************");
System.out.println(" 学生学号:"+stu[i].getStunumber());
System.out.println(" 学生姓名:"+stu[i].getName());
System.out.print(" 请输入修改后的高数成绩:");
chang=A.nextDouble();
System.out.println("********************************************************");
System.out.println(" 石家庄铁道大学软件工程系学生学籍管理系统 ");
System.out.println("*********************************************************");
System.out.println(" 学生学号:"+stu[i].getStunumber());
System.out.println(" 学生姓名:"+stu[i].getName());
System.out.println(" 1、高等数学成绩:"+chang);
System.out.println(" 2、大学英语成绩:" + stu[i].getSoftwarescore());
System.out.println(" 3、计算机网络成绩:" + stu[i].getNetworkscore());
System.out.println(" 4、数据库成绩:" + stu[i].getDatabasescore());
System.out.println(" 5、软件工程成绩:" + stu[i].getSoftwarescore());
System.out.println("********************************************************");
System.out.print(" 该学生成绩已修改完毕,是否提交(Y/N)");
System.out.println("**********************************************************");
if(A.next().equals("Y")) {
stu[i].setMathematicsscore(chang);
display(stu);
}
else {
change(stu);
}
break;
case 2:
System.out.println(" 学生考试成绩录入界面 ");
System.out.println("*****************************************");
System.out.println(" 学生学号:"+stu[i].getStunumber());
System.out.println(" 学生姓名:"+stu[i].getName());
System.out.print(" 请输入修改后的大学英语成绩:");
chang=A.nextDouble();
System.out.println("********************************************************");
System.out.println(" 石家庄铁道大学软件工程系学生学籍管理系统 ");
System.out.println("*********************************************************");
System.out.println(" 学生学号:"+stu[i].getStunumber());
System.out.println(" 学生姓名:"+stu[i].getName());
System.out.println(" 1、高等数学成绩:"+stu[i].getMathematicsscore());
System.out.println(" 2、大学英语成绩:" + chang);
System.out.println(" 3、计算机网络成绩:" + stu[i].getNetworkscore());
System.out.println(" 4、数据库成绩:" + stu[i].getDatabasescore());
System.out.println(" 5、软件工程成绩:" + stu[i].getSoftwarescore());
System.out.println("********************************************************");
System.out.println(" 该学生成绩已修改完毕,是否提交(Y/N)");
System.out.println("**********************************************************");
if(A.next().equals("Y")) {
stu[i].setSoftwarescore(chang);
display(stu);
}
else {
change(stu);
}
break;
case 3:
System.out.println(" 学生考试成绩录入界面 ");
System.out.println("*****************************************");
System.out.println(" 学生学号:"+stu[i].getStunumber());
System.out.println(" 学生姓名:"+stu[i].getName());
System.out.print(" 请输入修改后的计算机网络成绩:");
chang=A.nextDouble();
System.out.println("********************************************************");
System.out.println(" 石家庄铁道大学软件工程系学生学籍管理系统 ");
System.out.println("*********************************************************");
System.out.println(" 学生学号:"+stu[i].getStunumber());
System.out.println(" 学生姓名:"+stu[i].getName());
System.out.println(" 1、高等数学成绩:"+stu[i].getMathematicsscore());
System.out.println(" 2、大学英语成绩:" + stu[i].getSoftwarescore());
System.out.println(" 3、计算机网络成绩:" + chang);
System.out.println(" 4、数据库成绩:" + stu[i].getDatabasescore());
System.out.println(" 5、软件工程成绩:" + stu[i].getSoftwarescore());
System.out.println("********************************************************");
System.out.print(" 该学生成绩已修改完毕,是否提交(Y/N)");
System.out.println("**********************************************************");
if(A.next().equals("Y")) {
stu[i].setNetworkscore(chang);
display(stu);
}
else {
change(stu);
}
break;
case 4:
System.out.println(" 学生考试成绩录入界面 ");
System.out.println("*****************************************");
System.out.println(" 学生学号:"+stu[i].getStunumber());
System.out.println(" 学生姓名:"+stu[i].getName());
System.out.print(" 请输入修改后的数据库成绩:");
chang=A.nextDouble();
System.out.println("********************************************************");
System.out.println(" 石家庄铁道大学软件工程系学生学籍管理系统 ");
System.out.println("*********************************************************");
System.out.println(" 学生学号:"+stu[i].getStunumber());
System.out.println(" 学生姓名:"+stu[i].getName());
System.out.println(" 1、高等数学成绩:"+stu[i].getMathematicsscore());
System.out.println(" 2、大学英语成绩:" + stu[i].getSoftwarescore());
System.out.println(" 3、计算机网络成绩:" + stu[i].getNetworkscore());
System.out.println(" 4、数据库成绩:" + chang);
System.out.println(" 5、软件工程成绩:" + stu[i].getSoftwarescore());
System.out.println("********************************************************");
System.out.print(" 该学生成绩已修改完毕,是否提交(Y/N)");
System.out.println("**********************************************************");
if(A.next().equals("Y")) {
stu[i].setDatabasescore(chang);
display(stu);
}
else {
change(stu);
}
break;
case 5:
System.out.println(" 学生考试成绩录入界面 ");
System.out.println("*****************************************");
System.out.println(" 学生学号:"+stu[i].getStunumber());
System.out.println(" 学生姓名:"+stu[i].getName());
System.out.print(" 请输入修改后的软件工程成绩:");
chang=A.nextDouble();
System.out.println("********************************************************");
System.out.println(" 石家庄铁道大学软件工程系学生学籍管理系统 ");
System.out.println("*********************************************************");
System.out.println(" 学生学号:"+stu[i].getStunumber());
System.out.println(" 学生姓名:"+stu[i].getName());
System.out.println(" 1、高等数学成绩:"+stu[i].getMathematicsscore());
System.out.println(" 2、大学英语成绩:" + stu[i].getSoftwarescore());
System.out.println(" 3、计算机网络成绩:" + stu[i].getNetworkscore());
System.out.println(" 4、数据库成绩:" + stu[i].getDatabasescore());
System.out.println(" 5、软件工程成绩:" + chang);
System.out.println("********************************************************");
System.out.print(" 该学生成绩已修改完毕,是否提交(Y/N)");
System.out.println("**********************************************************");
if(A.next().equals("Y")) {
stu[i].setSoftwarescore(chang);
display(stu);
}
else {
change(stu);
}
break;
default:
System.out.println("请输入正确信息");
change(stu);
break;
}
flag = 1;
}
}
if (flag == 0)
{
System.out.println("学号输入错误,请重新输入学号");
change(stu);
}
}
private static void calculate(ScoreInformation[] stu) {//计算绩点
System.out.println("***********************************************************");
System.out.println(" 石家庄铁道大学软件工程系学生学籍管理系统 2019 版 ");
System.out.println(" 学生考试成绩绩点计算界面 ");
System.out.println("***********************************************************");
System.out.println(" 请输入学生学号: ");
System.out.println("***********************************************************");
Scanner B = new Scanner(System.in);
String number = B.nextLine();
System.out.println("***********************************************************");
System.out.println(" 石家庄铁道大学软件工程系学生学籍管理系统 2019 版 ");
System.out.println(" 学生考试成绩绩点计算界面 ");
System.out.println("***********************************************************");
System.out.println(" 学生学号:"+number );
System.out.println("***********************************************************");
int i;
double mathematics=0,englishi=0,network=0,database=0,software=0;
for(i=0;i<5;i++)
if (stu[i].getStunumber().equals(number))
{
System.out.println(" 学生姓名:"+stu[i].getName());
{
System.out.println(" 学生姓名:"+stu[i].getName());
if(stu[i].getMathematicsscore()>=90) mathematics=4.0;
if(stu[i].getMathematicsscore()>=85&&stu[i].getMathematicsscore()<=89.9) mathematics=3.7;
if(stu[i].getMathematicsscore()>=82&&stu[i].getMathematicsscore()<=84.9) mathematics=3.3;
if(stu[i].getMathematicsscore()>=78&&stu[i].getMathematicsscore()<=81.9) mathematics=2.7;
if(stu[i].getMathematicsscore()>=75&&stu[i].getMathematicsscore()<=77.9) mathematics=2.3;
if(stu[i].getMathematicsscore()>=72&&stu[i].getMathematicsscore()<=74.9) mathematics=2.0;
if(stu[i].getMathematicsscore()>=68&&stu[i].getMathematicsscore()<=71.9) mathematics=1.7;
if(stu[i].getMathematicsscore()>=66&&stu[i].getMathematicsscore()<=67.9) mathematics=1.5;
if(stu[i].getMathematicsscore()>=64&&stu[i].getMathematicsscore()<=65.9) mathematics=1.0;
if(stu[i].getMathematicsscore()<60) mathematics=0;
System.out.println(" 1.高等数学成绩绩点:"+mathematics);
if(stu[i].getEnglishiscore()>=90) englishi=4.0;
if(stu[i].getEnglishiscore()>=85&&stu[i].getEnglishiscore()<=89.9) englishi=3.7;
if(stu[i].getEnglishiscore()>=82&&stu[i].getEnglishiscore()<=84.9) englishi=3.3;
if(stu[i].getEnglishiscore()>=78&&stu[i].getEnglishiscore()<=81.9) englishi=2.7;
if(stu[i].getEnglishiscore()>=75&&stu[i].getEnglishiscore()<=77.9) englishi=2.3;
if(stu[i].getEnglishiscore()>=72&&stu[i].getEnglishiscore()<=74.9) englishi=2.0;
if(stu[i].getEnglishiscore()>=68&&stu[i].getEnglishiscore()<=71.9) englishi=1.7;
if(stu[i].getEnglishiscore()>=66&&stu[i].getEnglishiscore()<=67.9) englishi=1.5;
if(stu[i].getEnglishiscore()>=64&&stu[i].getEnglishiscore()<=65.9) englishi=1.0;
if(stu[i].getEnglishiscore()<60) englishi=0;
System.out.println(" 2.大学英语成绩绩点:"+englishi);
if(stu[i].getNetworkscore()>=90) network=4.0;
if(stu[i].getNetworkscore()>=85&&stu[i].getNetworkscore()<=89.9) network=3.7;
if(stu[i].getNetworkscore()>=82&&stu[i].getNetworkscore()<=84.9) network=3.3;
if(stu[i].getNetworkscore()>=78&&stu[i].getNetworkscore()<=81.9) network=2.7;
if(stu[i].getNetworkscore()>=75&&stu[i].getNetworkscore()<=77.9) network=2.3;
if(stu[i].getNetworkscore()>=72&&stu[i].getNetworkscore()<=74.9) network=2.0;
if(stu[i].getNetworkscore()>=68&&stu[i].getNetworkscore()<=71.9) network=1.7;
if(stu[i].getNetworkscore()>=66&&stu[i].getNetworkscore()<=67.9) network=1.5;
if(stu[i].getNetworkscore()>=64&&stu[i].getNetworkscore()<=65.9) network=1.0;
if(stu[i].getNetworkscore()<60) network=0;
System.out.println(" 3.计算机网络成绩绩点:"+network);
if(stu[i].getDatabasescore()>=90) database=4.0;
if(stu[i].getDatabasescore()>=85&&stu[i].getDatabasescore()<=89.9) database=3.7;
if(stu[i].getDatabasescore()>=82&&stu[i].getDatabasescore()<=84.9) database=3.3;
if(stu[i].getDatabasescore()>=78&&stu[i].getDatabasescore()<=81.9) database=2.7;
if(stu[i].getDatabasescore()>=75&&stu[i].getDatabasescore()<=77.9) database=2.3;
if(stu[i].getDatabasescore()>=72&&stu[i].getDatabasescore()<=74.9) database=2.0;
if(stu[i].getDatabasescore()>=68&&stu[i].getDatabasescore()<=71.9) database=1.7;
if(stu[i].getDatabasescore()>=66&&stu[i].getDatabasescore()<=67.9) database=1.5;
if(stu[i].getDatabasescore()>=64&&stu[i].getDatabasescore()<=65.9) database=1.0;
if(stu[i].getDatabasescore()<60) database=0;
System.out.println(" 4.数据库成绩绩点:"+database);
if(stu[i].getSoftwarescore()>=90) software=4.0;
if(stu[i].getSoftwarescore()>=85&&stu[i].getSoftwarescore()<=89.9) software=3.7;
if(stu[i].getSoftwarescore()>=82&&stu[i].getSoftwarescore()<=84.9) software=3.3;
if(stu[i].getSoftwarescore()>=78&&stu[i].getSoftwarescore()<=81.9) software=2.7;
if(stu[i].getSoftwarescore()>=75&&stu[i].getSoftwarescore()<=77.9) software=2.3;
if(stu[i].getSoftwarescore()>=72&&stu[i].getSoftwarescore()<=74.9) software=2.0;
if(stu[i].getSoftwarescore()>=68&&stu[i].getSoftwarescore()<=71.9) software=1.7;
if(stu[i].getSoftwarescore()>=66&&stu[i].getSoftwarescore()<=67.9) software=1.5;
if(stu[i].getSoftwarescore()>=64&&stu[i].getSoftwarescore()<=65.9) software=1.0;
if(stu[i].getSoftwarescore()<60) software=0;
System.out.println(" 5.软件工程成绩绩点:"+software);
double average=0;average=(mathematics*4+englishi*3+network*4+database*3+software*2)/16;
String result=String.format("%.2f",average);
System.out.println(" 你的平均学分绩点为:"+result);
if(average>=2)
System.out.println("提示信息:你的学分绩点已达到毕业要求!");
else
System.out.println("提示信息:你的学分绩点不满足毕业要求!");
System.out.println(" 是否返回系统主界面:(Y/N)");
System.out.println("**************************************");
if(B.next().equals("Y")) {
display(stu);
}
}
}
}
static void finish() {//退出
System.out.println("********************************************");
System.out.println(" 石家庄铁道大学软件工程系学生学籍管理系统2019版");
System.out.println(" 制作人:申澳宇");
System.out.println("********************************************");
}

}

 

 

 

 

 

 

 

 

 

 

 先定义 ScoreInformation 类,其中包括七个私有变量(stunumber,name, mathematicsscore, englishiscore,networkscore, databasescore,softwarescore)。

再存入五个学生的信息,再利用if和switch语句实现   :学生考试成绩录入, 学生考试成绩修改,计算学生成绩绩点,退出学籍管理系统,的功能。

这次小考验让我发现了自己很多的不足,很多Java基本语法都不知道,以后要自己找时间补补。













 

标签: