java.1
Posted 123-haozijia
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了java.1相关的知识,希望对你有一定的参考价值。
student.java
package score;
public class Student
private String stunumber;
private String name;
private double mathematicsscore;
private double englishiscore;
private double networkscore;
private double databasescore;
private double softwarescore;
public void setStudent()
Student b=new Student();
b.setNumber("hao zijia");
b.setNumber("20183684");
b.setMscore(90);
b.setEscore(90);
b.setNscore(90);
b.setDscore(90);
b.setSscore(90);
public void getStudent()
Student b=new Student();
System.out.println("学生学号:");
b.getNumber();
System.out.println("学生姓名:");
b.getName();
System.out.println("1.高等数学成绩:");
b.getMscore();
System.out.println("2.大学英语成绩:");
b.getEscore();
System.out.println("3.计算机网络成绩:");
b.getNscore();
System.out.println("4.数据库成绩:");
b.getDscore();
System.out.println("5.软件工程成绩:");
b.getSscore();
public void setNumber(String number)
stunumber=number;
public void setName(String name)
this.name=name;
public void setMscore(double mscore)
mathematicsscore=mscore;
public void setEscore(double escore)
englishiscore=escore;
public void setNscore(double nscore)
networkscore=nscore;
public void setDscore(double dscore)
databasescore=dscore;
public void setSscore(double sscore)
softwarescore=sscore;
public String getNumber()
return stunumber;
public String getName()
return name;
public double getMscore()
return mathematicsscore;
public double getEscore()
return englishiscore;
public double getNscore()
return networkscore;
public double getDscore()
return databasescore;
public double getSscore()
return softwarescore;
public static void main(String[] args)
Student myScoreInformation=new Student();
myScoreInformation.setName("Haozijia");
myScoreInformation.setNumber("20183684");
myScoreInformation.setMscore(90);
myScoreInformation.setEscore(90);
myScoreInformation.setNscore(90);
myScoreInformation.setDscore(90);
myScoreInformation.setSscore(90);
myScoreInformation.getName();
myScoreInformation.getNumber();
myScoreInformation.getMscore();
myScoreInformation.getEscore();
myScoreInformation.getNscore();
myScoreInformation.getDscore();
myScoreInformation.getSscore();
ScoreManager.java
package score;
import java.util.ArrayList;
import java.util.Scanner;
public class ScoreManger
static Student s[] = new Student[4];
static Scanner scan=new Scanner(System.in);
public void setStudent()
Student b=new Student();
b.setNumber("hao zijia");
b.setNumber("20183684");
b.setMscore(90);
b.setEscore(90);
b.setNscore(90);
b.setDscore(90);
b.setSscore(90);
public void lurushow1()
System.out.println("***********************************");
System.out.println("石家庄铁道大学软件工程系学生学籍管理系统 2019 版");
System.out.println("学生考试成绩录入");
System.out.println("***********************************");
System.out.println("请输入学生学号:");
System.out.println("***********************************");
public static void lurustudent(ArrayList<Student> arry)
String stunumber;
while(true)
System.out.println("请输入学生学号:");
stunumber=scan.nextLine();
boolean flag=false;
for(int i=0;i<arry.size();i++)
Student s=arry.get(i);
if(s.getNumber().equals(stunumber))
flag = true;
break;
if(flag)
System.out.println("***********************************");
System.out.println("石家庄铁道大学软件工程系学生学籍管理系统 2019 版");
System.out.println("学生考试成绩录入");
System.out.println("***********************************");
s.getStudent();
System.out.println("***********************************");
else
break;
public void zhushow()
System.out.println("***********************************");
System.out.println("石家庄铁道大学软件工程系");
System.out.println("S学生学籍管理系统 2019 版");
System.out.println("***********************************");
System.out.println("1、 学生考试成绩录入");
System.out.println("2、 学生考试成绩修改");
System.out.println("3、 计算学生成绩绩点");
System.out.println("4、退出学籍管理系统");
System.out.println("***********************************");
public static void changestudent(ArrayList<Student> arry)
String stunumber1;
System.out.println("请选择要修改同学的成绩:");
System.out.println("***********************************");
System.out.println("学生考试成绩修改界面");
System.out.println("请输入学生学号");
System.out.println("***********************************");
stunumber1=scan.next();
for(int i=0;i<5;i++)
if(stunumber1.equals(s[i].getNumber()))
System.out.println("***********************************");
System.out.println("石家庄铁道大学软件工程系学生学籍管理系统 2019 版");
System.out.println("学生考试成绩录入");
System.out.println("***********************************");
s[i].getStudent();
System.out.println("该学生成绩已修改成功");
else
System.out.println("该学生不存在");
public static double jidian(double a)
if(a>=90)return 4.0;
if((a>=85)&&(a<=89.9))return 3.7;
if((a>=82)&&(a<=84.9))return 3.3;
if((a>=78)&&(a<=81.9))return 3.0;
if((a>=75)&&(a<=77.9))return 2.7;
if((a>=72)&&(a<=74.9))return 2.3;
if((a>=68)&&(a<71.9))return 2.0;
if((a>=66)&&(a<=67.9))return 1.7;
if((a>=64)&&(a<=65.9))return 1.5;
if((a>=60)&&(a<=63.9))return 1.0;
if(a<60)return 0;
return a;
public static void main(String[] args)
ArrayList<Student> arry=new ArrayList<>();
Student s[] = new Student[4];
s[0].setStudent();
s[1].setStudent();
s[2].setStudent();
s[3].setStudent();
s[4].setStudent();
ScoreManger a=new ScoreManger();
a.zhushow();
System.out.println("请输入选择的序号");
String stufunction=scan.nextLine();
switch(stufunction)
case"1":
a.lurushow1();
lurustudent(arry);
break;
case"2":
changestudent(arry);
break;
case"3":
double c1,c2,c3,c4,c5,d;
for(int i=0;i<5;i++)
c1=jidian(s[i].getMscore());
c2=jidian(s[i].getEscore());
c3=jidian(s[i].getNscore());
c4=jidian(s[i].getDscore());
c5=jidian(s[i].getSscore());
d=(c1+c2+c3+c4+c5)/5;
System.out.println("***********************************");
System.out.println("石家庄铁道大学软件工程系学生学籍管理系统 2019 版");
System.out.println("学生考试成绩绩点计算界面");
System.out.println("***********************************");
System.out.println("学号:");
System.out.println(s[i].getNumber());
System.out.println("姓名:");
System.out.println(s[i].getName());
System.out.println("1.高等数学成绩绩点:");
System.out.println(c1);
System.out.println("2.大学英语成绩绩点:");
System.out.println(c2);
System.out.println("3.计算机网络成绩绩点:");
System.out.println(c3);
System.out.println("4.数据库成绩绩点:");
System.out.println(c4);
System.out.println("5.软件工程成绩绩点:");
System.out.println(c5);
System.out.println("你的平均学分绩点:");
System.out.println(d);
if(d>=2)
System.out.println("你的学分绩点已达到毕业要求!");
else
System.out.println("你的学分绩点不满足毕业要求!");
System.out.println("***********************************");
System.out.println("是否返回主界面(Y/N)");
break;
case"4":
default:
System.out.println("***********************************");
System.out.println("谢谢使用石家庄铁道大学软件工程系学生学籍管理系统 2019 版");
System.out.println("制作人:郝子嘉");
System.out.println("***********************************");
System.exit(0);
break;
以上是关于java.1的主要内容,如果未能解决你的问题,请参考以下文章