先通过ScoreInformation来建立类来帮助存储记录信息。
package text20190909;
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 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 ScoreInformation(String stunumber, String name, double mathematicsscore, double englishiscore,
double networkscore, double databasescore, double softwarescore) {
super();
this.stunumber = stunumber;
this.name = name;
this.mathematicsscore = mathematicsscore;
this.englishiscore = englishiscore;
this.networkscore = networkscore;
this.databasescore = databasescore;
this.softwarescore = softwarescore;
}
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 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 ScoreInformation(String stunumber, String name, double mathematicsscore, double englishiscore,
double networkscore, double databasescore, double softwarescore) {
super();
this.stunumber = stunumber;
this.name = name;
this.mathematicsscore = mathematicsscore;
this.englishiscore = englishiscore;
this.networkscore = networkscore;
this.databasescore = databasescore;
this.softwarescore = softwarescore;
}
}
然后在同一个包内建立ScoreManagemnet来实现这个题目。
package text20190909;
import java.util.Scanner;
public class ScoreManagement {
static double b=0;
static ScoreInformation a[]=new ScoreInformation[10000];
static Scanner sr=null;
static String judge="Y";
static int sum=0;
static void menu1()//主菜单
{ System.out.println("***********************************************************");
System.out.println(" 石家庄铁道大学软件工程系 ");
System.out.println(" 学生学籍管理系统 2019 版 ");
System.out.println("*********************************************************** ");
System.out.println("1、 学生考试成绩录入 " +
"2、 学生考试成绩修改 " +
"3、 计算学生成绩绩点 " +
"4、退出学籍管理系统 ");
System.out.println("********************************************************** ");
}
static void menu2()
{System.out.println("*********************************************************** " +
" 石家庄铁道大学软件工程系学生学籍管理系统 2019 版 " +
" 学生考试成绩录入 " +
"*********************************************************** ");
import java.util.Scanner;
public class ScoreManagement {
static double b=0;
static ScoreInformation a[]=new ScoreInformation[10000];
static Scanner sr=null;
static String judge="Y";
static int sum=0;
static void menu1()//主菜单
{ System.out.println("***********************************************************");
System.out.println(" 石家庄铁道大学软件工程系 ");
System.out.println(" 学生学籍管理系统 2019 版 ");
System.out.println("*********************************************************** ");
System.out.println("1、 学生考试成绩录入 " +
"2、 学生考试成绩修改 " +
"3、 计算学生成绩绩点 " +
"4、退出学籍管理系统 ");
System.out.println("********************************************************** ");
}
static void menu2()
{System.out.println("*********************************************************** " +
" 石家庄铁道大学软件工程系学生学籍管理系统 2019 版 " +
" 学生考试成绩录入 " +
"*********************************************************** ");
}
public static void luru()//成绩录入
{ menu2();
System.out.print(" 请输入学生学号:");
sr=new Scanner(System.in);
String number;
int i,j=0;
double math,english,net,data,soft;
number=sr.next();
System.out.println("********************************************************** ");
for(i=0;i<sum;i++)
{
if(a[i].getStunumber().compareTo(number)==0)
{ System.out.println(" 学生学号:"+a[i].getStunumber());
System.out.println(" 学生姓名:"+a[i].getName());
System.out.print(" 请输入高等数学成绩:");
math=sr.nextDouble();
System.out.println(math);
System.out.print(" 请输入英语成绩:");
english=sr.nextDouble();
System.out.println(english);
System.out.print(" 请输入计算机网络成绩:");
net=sr.nextDouble();
System.out.println(net);
System.out.print(" 请输入数据库成绩:");
data=sr.nextDouble();
System.out.println(data);
System.out.print(" 请输入软件工程成绩:");
soft=sr.nextDouble();
System.out.println(soft);
menu2();
System.out.println(" 学生学号:"+a[i].getStunumber());
System.out.println(" 学生姓名:"+a[i].getName());
System.out.println(" 请输入高等数学成绩:"+math);
System.out.println(" 请输入英语成绩:"+english);
System.out.println(" 请输入计算机网络成绩:"+net);
System.out.println(" 请输入数据库成绩:"+data);
System.out.println(" 请输入软件工程成绩:"+soft);
System.out.println(" 该学生成绩已录入完毕,是否提交(Y/N)");
System.out.println("********************************************************** ");
judge=sr.next();
if(judge.compareTo("Y")==0)
{a[i].setMathematicsscore(math);
a[i].setEnglishiscore(english);
a[i].setNetworkscore(net);
a[i].setDatabasescore(data);
a[i].setSoftwarescore(soft);
}
}
else
j++;
}
if(j==sum)
{
System.out.println("该学号不存在");
}
while(j==sum)
{menu2();
System.out.print(" 请输入学生学号:");
number=sr.next();
System.out.println("********************************************************** ");
for(i=0;i<sum;i++)
{
if(a[i].getStunumber().compareTo(number)==0)
{ System.out.println(" 学生学号:"+a[i].getStunumber());
System.out.println(" 学生姓名:"+a[i].getName());
System.out.print(" 请输入高等数学成绩:");
math=sr.nextDouble();
System.out.println(math);
System.out.print(" 请输入英语成绩:");
english=sr.nextDouble();
System.out.println(english);
System.out.print(" 请输入计算机网络成绩:");
net=sr.nextDouble();
System.out.println(net);
System.out.print(" 请输入数据库成绩:");
data=sr.nextDouble();
System.out.println(data);
System.out.print(" 请输入软件工程成绩:");
soft=sr.nextDouble();
System.out.println(soft);
menu2();
System.out.println(" 学生学号:"+a[i].getStunumber());
System.out.println(" 学生姓名:"+a[i].getName());
System.out.println(" 请输入高等数学成绩:"+math);
System.out.println(" 请输入英语成绩:"+english);
System.out.println(" 请输入计算机网络成绩:"+net);
System.out.println(" 请输入数据库成绩:"+data);
System.out.println(" 请输入软件工程成绩:"+soft);
System.out.println(" 该学生成绩已录入完毕,是否提交(Y/N)");
System.out.println("********************************************************** ");
judge=sr.next();
if(judge.compareTo("Y")==0)
{a[i].setMathematicsscore(math);
a[i].setEnglishiscore(english);
a[i].setNetworkscore(net);
a[i].setDatabasescore(data);
a[i].setSoftwarescore(soft);
}
}
else
j++;
}}
}
static void menu3()
{System.out.println("*********************************************************** " +
" 石家庄铁道大学软件工程系学生学籍管理系统 2019 版 " +
" 学生考试成绩修改 " +
"*********************************************************** ");
}
public static void xiugai()
{ menu3();
System.out.print("请输入学生学号(八位):");
sr=new Scanner(System.in);
int i,j;
j=0;
String number;
double math = 0,english=0,net=0,data=0,soft=0;
number=sr.next();
for(i=0;i<sum;i++)
{ if(a[i].getStunumber().compareTo(number)==0)
{menu2();
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("********************************************************** ");
int n,m;
n=sr.nextInt();
switch(n)
{
case 1:menu2();
b=a[i].getMathematicsscore();
System.out.println(" 学生学号:"+a[i].getStunumber());
System.out.println(" 学生姓名:"+a[i].getName());
System.out.print(" 请输入修改后高等数学成绩:");
math=sr.nextDouble();
a[i].setMathematicsscore(math);
System.out.println(math);break;
case 2:menu2();
b=a[i].getEnglishiscore();
System.out.println(" 学生学号:"+a[i].getStunumber());
System.out.println(" 学生姓名:"+a[i].getName());
System.out.print(" 请输入修改后大学英语成绩:");
english=sr.nextDouble();
a[i].setEnglishiscore(english);
System.out.println(english);break;
case 3:menu2();
b=a[i].getNetworkscore();
System.out.println(" 学生学号:"+a[i].getStunumber());
System.out.println(" 学生姓名:"+a[i].getName());
System.out.print(" 请输入修改后计算机网络成绩:");
net=sr.nextDouble();
a[i].setNetworkscore(net);
System.out.println(net);break;
case 4:menu2();
b=a[i].getDatabasescore();
System.out.println(" 学生学号:"+a[i].getStunumber());
System.out.println(" 学生姓名:"+a[i].getName());
System.out.print(" 请输入修改后数据库成绩:"); data=sr.nextDouble();
a[i].setDatabasescore(data);
System.out.println(data);break;
case 5:menu2();
b=a[i].getSoftwarescore();
System.out.println(" 学生学号:"+a[i].getStunumber());
System.out.println(" 学生姓名:"+a[i].getName());
System.out.print(" 请输入修改后软件工程成绩:");
soft=sr.nextDouble();
a[i].setSoftwarescore(soft);
System.out.println(soft);break;
}
menu2();
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(" 该成绩已完成修改,是否提交Y/N");
System.out.println("********************************************************** ");
judge=sr.next();
if(judge.compareTo("Y")==0)
{switch(n)
{
case 1:a[i].setMathematicsscore(math);break;
case 2:a[i].setEnglishiscore(english);break;
case 3:a[i].setNetworkscore(net);break;
case 4:a[i].setDatabasescore(data);break;
case 5:a[i].setSoftwarescore(soft);break;
}
}
else
{switch(n)
{
case 1:a[i].setMathematicsscore(b);break;
case 2:a[i].setEnglishiscore(b);break;
case 3:a[i].setNetworkscore(b);break;
case 4:a[i].setDatabasescore(b);break;
case 5:a[i].setSoftwarescore(b);break;
}
}
}
else
j++;
}
if(j==sum)
{System.out.println("该学号不存在");}
while(j==sum)
{menu3();
number=sr.next();
for(i=0;i<sum;i++)
{ if(a[i].getStunumber().compareTo(number)==0)
{menu2();
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("********************************************************** ");
int n,m;
n=sr.nextInt();
switch(n)
{
case 1:menu2();
System.out.println(" 学生学号:"+a[i].getStunumber());
System.out.println(" 学生姓名:"+a[i].getName());
System.out.print(" 请输入修改后高等数学成绩:");
math=sr.nextDouble();
a[i].setMathematicsscore(math);
System.out.println(math);break;
case 2:menu2();
System.out.println(" 学生学号:"+a[i].getStunumber());
System.out.println(" 学生姓名:"+a[i].getName());
System.out.print(" 请输入修改后大学英语成绩:");
english=sr.nextDouble();
a[i].setEnglishiscore(english);
System.out.println(english);break;
case 3:menu2();
System.out.println(" 学生学号:"+a[i].getStunumber());
System.out.println(" 学生姓名:"+a[i].getName());
System.out.print(" 请输入修改后计算机网络成绩:");
net=sr.nextDouble();
a[i].setNetworkscore(net);
System.out.println(net);break;
case 4:menu2();
System.out.println(" 学生学号:"+a[i].getStunumber());
System.out.println(" 学生姓名:"+a[i].getName());
System.out.print(" 请输入修改后数据库成绩:");
data=sr.nextDouble();
a[i].setDatabasescore(data);
System.out.println(data);break;
case 5:menu2();
System.out.println(" 学生学号:"+a[i].getStunumber());
System.out.println(" 学生姓名:"+a[i].getName());
System.out.print(" 请输入修改后软件工程成绩:");
soft=sr.nextDouble();
a[i].setSoftwarescore(soft);
System.out.println(soft);break;
}
menu2();
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(" 该成绩已完成修改,是否提交Y/N");
System.out.println("********************************************************** ");
judge=sr.next();
if(judge.compareTo("Y")==0)
{switch(n)
{
case 1:a[i].setMathematicsscore(math);break;
case 2:a[i].setEnglishiscore(english);break;
case 3:a[i].setNetworkscore(net);break;
case 4:a[i].setDatabasescore(data);break;
case 5:a[i].setSoftwarescore(soft);break;
}
}
else
{switch(n)
{
case 1:a[i].setMathematicsscore(b);break;
case 2:a[i].setEnglishiscore(b);break;
case 3:a[i].setNetworkscore(b);break;
case 4:a[i].setDatabasescore(b);break;
case 5:a[i].setSoftwarescore(b);break;
}
}
}
else
j++;
}
}
}
public static void menu4()
{
System.out.println("*********************************************************** " +
" 石家庄铁道大学软件工程系学生学籍管理系统 2019 版 " +
" 学生考试成绩绩点修改 " +
"*********************************************************** ");
}
}
public static void menu4()
{
System.out.println("*********************************************************** " +
" 石家庄铁道大学软件工程系学生学籍管理系统 2019 版 " +
" 学生考试成绩绩点修改 " +
"*********************************************************** ");
}
public static double jidian(double a)
{double i=0;
if(a>=90)
{i=4.0;
}
else if(a>=85&&a<=89.9)
{i=3.7;
}
else if(a>=82&&a<=84.9)
{i=3.3;}
else if(a>=78&&a<=81.9)
{i=3.0;}
else if(a>=75&&a<=77.9)
{i=2.7;}
else if(a>=72&&a<=74.9)
{
i=2.3;
}
else if(a>=68&&a<=71.9)
{i=2.0;}
else if(a>=66&&a<=67.9)
{i=1.7;}
else if(a>=64&&a<=65.9)
{
i=1.5;
}
else if(a>=60&&a<=63.9)
{
i=1.0;
}
else if(a<=60)
{
i=0;
}
return i;
public static double jidian(double a)
{double i=0;
if(a>=90)
{i=4.0;
}
else if(a>=85&&a<=89.9)
{i=3.7;
}
else if(a>=82&&a<=84.9)
{i=3.3;}
else if(a>=78&&a<=81.9)
{i=3.0;}
else if(a>=75&&a<=77.9)
{i=2.7;}
else if(a>=72&&a<=74.9)
{
i=2.3;
}
else if(a>=68&&a<=71.9)
{i=2.0;}
else if(a>=66&&a<=67.9)
{i=1.7;}
else if(a>=64&&a<=65.9)
{
i=1.5;
}
else if(a>=60&&a<=63.9)
{
i=1.0;
}
else if(a<=60)
{
i=0;
}
return i;
}
public static double pingjun(double a1,double a2,double a3,double a4,double a5)
{double i=(a1*4+a2*3+a3*4+a4*3+a5*2)/16;
public static double pingjun(double a1,double a2,double a3,double a4,double a5)
{double i=(a1*4+a2*3+a3*4+a4*3+a5*2)/16;
return i;
}
public static void grade()
{menu4();
System.out.print("请输入学生学号(八位)");
String number;
int i;
int j=0;
sr=new Scanner(System.in);
number=sr.next();
for(i=0;i<sum;i++)
{ if(a[i].getStunumber().compareTo(number)==0)
{menu4();
System.out.println(" 学生学号:"+a[i].getStunumber());
System.out.println(" 学生姓名:"+a[i].getName());
System.out.println(" 1、高等数学绩点:"+jidian(a[i].getMathematicsscore()));
System.out.println(" 2、大学英语绩点:"+jidian(a[i].getEnglishiscore()));
System.out.println(" 3、计算机网络绩点"+jidian(a[i].getNetworkscore()));
System.out.println(" 4、数据库绩点"+jidian(a[i].getDatabasescore()));
System.out.println(" 5、软件工程绩点"+jidian(a[i].getSoftwarescore()));
System.out.println(" 你的平均绩点为:"+pingjun(jidian(a[i].getMathematicsscore()),jidian(a[i].getEnglishiscore()),jidian(a[i].getNetworkscore()),jidian(a[i].getDatabasescore()),jidian(a[i].getSoftwarescore())));
if(pingjun(jidian(a[i].getMathematicsscore()),jidian(a[i].getEnglishiscore()),jidian(a[i].getNetworkscore()),jidian(a[i].getDatabasescore()),jidian(a[i].getSoftwarescore()))>=2)
{
System.out.println(" 您的学分绩点已达要求!");
}
else
System.out.println(" 您的学分绩点不满足毕业要求!");
System.out.println(" 是否返回系统主界面:(Y/N)");
System.out.println("********************************************************** ");
judge=sr.next();
while(judge.compareTo("N")==0)
{}
}
else j++;
}
if(j==sum)
{System.out.println("该学号不存在");
}
while(j==sum)
{j=0;
menu4();
System.out.print("请输入学生学号");
number=sr.next();
{ if(a[i].getStunumber().compareTo(number)==0)
{menu4();
System.out.println(" 学生学号:"+a[i].getStunumber());
System.out.println(" 学生姓名:"+a[i].getName());
System.out.println(" 1、高等数学绩点:"+jidian(a[i].getMathematicsscore()));
System.out.println(" 2、大学英语绩点:"+jidian(a[i].getEnglishiscore()));
System.out.println(" 3、计算机网络绩点"+jidian(a[i].getNetworkscore()));
System.out.println(" 4、数据库绩点"+jidian(a[i].getDatabasescore()));
System.out.println(" 5、软件工程绩点"+jidian(a[i].getSoftwarescore()));
System.out.println(" 你的平均绩点为:"+pingjun(jidian(a[i].getMathematicsscore()),jidian(a[i].getEnglishiscore()),jidian(a[i].getNetworkscore()),jidian(a[i].getDatabasescore()),jidian(a[i].getSoftwarescore())));
if(pingjun(jidian(a[i].getMathematicsscore()),jidian(a[i].getEnglishiscore()),jidian(a[i].getNetworkscore()),jidian(a[i].getDatabasescore()),jidian(a[i].getSoftwarescore()))>=2)
{
System.out.println(" 您的学分绩点已达要求!");
}
else
System.out.println(" 您的学分绩点不满足毕业要求!");
System.out.println(" 是否返回系统主界面:(Y/N)");
System.out.println("********************************************************** ");
judge=sr.next();
while(judge.compareTo("N")==0)
{}
}
else j++;
}
if(j==sum)
{System.out.println("该学号不存在");
}
while(j==sum)
{j=0;
menu4();
System.out.print("请输入学生学号");
number=sr.next();
for(i=0;i<sum;i++)
{ if(a[i].getStunumber().compareTo(number)==0)
{menu4();
System.out.println(" 学生学号:"+a[i].getStunumber());
System.out.println(" 学生姓名:"+a[i].getName());
System.out.println(" 1、高等数学绩点:"+jidian(a[i].getMathematicsscore()));
System.out.println(" 2、大学英语绩点:"+jidian(a[i].getEnglishiscore()));
System.out.println(" 3、计算机网络绩点"+jidian(a[i].getNetworkscore()));
System.out.println(" 4、数据库绩点"+jidian(a[i].getDatabasescore()));
System.out.println(" 5、软件工程绩点"+jidian(a[i].getSoftwarescore()));
System.out.println(" 你的平均绩点为:"+pingjun(jidian(a[i].getMathematicsscore()),jidian(a[i].getEnglishiscore()),jidian(a[i].getNetworkscore()),jidian(a[i].getDatabasescore()),jidian(a[i].getSoftwarescore())));
if(pingjun(jidian(a[i].getMathematicsscore()),jidian(a[i].getEnglishiscore()),jidian(a[i].getNetworkscore()),jidian(a[i].getDatabasescore()),jidian(a[i].getSoftwarescore()))>=2)
{
System.out.println(" 您的学分绩点已达要求!");
}
else
System.out.println(" 您的学分绩点不满足毕业要求!");
System.out.println(" 是否返回系统主界面:(Y/N)");
System.out.println("********************************************************** ");
judge=sr.next();
while(judge.compareTo("N")==0)
{}
{ if(a[i].getStunumber().compareTo(number)==0)
{menu4();
System.out.println(" 学生学号:"+a[i].getStunumber());
System.out.println(" 学生姓名:"+a[i].getName());
System.out.println(" 1、高等数学绩点:"+jidian(a[i].getMathematicsscore()));
System.out.println(" 2、大学英语绩点:"+jidian(a[i].getEnglishiscore()));
System.out.println(" 3、计算机网络绩点"+jidian(a[i].getNetworkscore()));
System.out.println(" 4、数据库绩点"+jidian(a[i].getDatabasescore()));
System.out.println(" 5、软件工程绩点"+jidian(a[i].getSoftwarescore()));
System.out.println(" 你的平均绩点为:"+pingjun(jidian(a[i].getMathematicsscore()),jidian(a[i].getEnglishiscore()),jidian(a[i].getNetworkscore()),jidian(a[i].getDatabasescore()),jidian(a[i].getSoftwarescore())));
if(pingjun(jidian(a[i].getMathematicsscore()),jidian(a[i].getEnglishiscore()),jidian(a[i].getNetworkscore()),jidian(a[i].getDatabasescore()),jidian(a[i].getSoftwarescore()))>=2)
{
System.out.println(" 您的学分绩点已达要求!");
}
else
System.out.println(" 您的学分绩点不满足毕业要求!");
System.out.println(" 是否返回系统主界面:(Y/N)");
System.out.println("********************************************************** ");
judge=sr.next();
while(judge.compareTo("N")==0)
{}
}
}}}
public static void tuichu()
{ System.out.println("***********************************************************");
System.out.println(" 谢谢使用石家庄铁道大学软件工程系学生学籍管理系统 2019 版");
System.out.println(" 制作人:谷子腾");
System.out.println("*********************************************************** ");
}
public static void main(String[] args) {
int i,j;
String stunumber,name;
System.out.println("请输入5个学生的学号和姓名");
for(i=0;i<5;i++)
{
sr=new Scanner(System.in);
stunumber=sr.next();
name=sr.next();
a[i]=new ScoreInformation(stunumber,name,0,0,0,0,0);
sum++;
}
j=0;
while(j!=4)
{
menu1();
j=sr.nextInt();
switch(j)
{
case 1:luru();
while(judge.compareTo("N")==0)
{luru();
}
break;
case 2:xiugai();
while(judge.compareTo("N")==0)
{
xiugai();
};break;
case 3:grade();break;
case 4:tuichu();break;
default:break;
}
if(j==4)
{break;}
}
}
}
}}}
public static void tuichu()
{ System.out.println("***********************************************************");
System.out.println(" 谢谢使用石家庄铁道大学软件工程系学生学籍管理系统 2019 版");
System.out.println(" 制作人:谷子腾");
System.out.println("*********************************************************** ");
}
public static void main(String[] args) {
int i,j;
String stunumber,name;
System.out.println("请输入5个学生的学号和姓名");
for(i=0;i<5;i++)
{
sr=new Scanner(System.in);
stunumber=sr.next();
name=sr.next();
a[i]=new ScoreInformation(stunumber,name,0,0,0,0,0);
sum++;
}
j=0;
while(j!=4)
{
menu1();
j=sr.nextInt();
switch(j)
{
case 1:luru();
while(judge.compareTo("N")==0)
{luru();
}
break;
case 2:xiugai();
while(judge.compareTo("N")==0)
{
xiugai();
};break;
case 3:grade();break;
case 4:tuichu();break;
default:break;
}
if(j==4)
{break;}
}
}
}
1解题思路显示用一个单独的类来帮忙记录一下信息
2在ScoreManagement中使用几个类似于全局变量的ScoreInformation数组来计入学生的 信息,和用scanner全局null来减少次数,用judge的String类型帮忙记录Y和N。
3使用多个菜单来来刷屏帮助实现界面。
4在录入和 修改和绩点分别单独写了函数主要是用switch来分别使用不同选项来实现不同功能还用switch来实现Y/N的功能。
5算绩点就是通过两个普通函数来实现功能,是否符合毕业绩点直接使用if语句。
截图
主界面
成绩录入
2、成绩修改
3、成绩绩点
4、退出