码迷,mamicode.com
首页 > 编程语言 > 详细

java1

时间:2019-09-15 23:53:56      阅读:171      评论:0      收藏:0      [点我收藏+]

标签:flag   network   turn   ack   软件工程   修改   databases   tun   界面   

package STUDENTINFORMATION;
import java.util.Scanner;
class ScoreInformation
{
private String stunumber;
private String name;
private double mathematicsscore;
private double englishiscore;
private double networkscore;
private double databasescore;
private double softwarescore;
public ScoreInformation() {
}
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;
}
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 class ScoreManagement{
static Scanner sc=new Scanner(System.in);
static ScoreInformation []a=new ScoreInformation[5];
static void mm() {
a[0]=new ScoreInformation("20183785"," 莫1",0,0,0,0,0);
a[1]=new ScoreInformation("20183786"," 莫2",0,0,0,0,0);
a[2]=new ScoreInformation("20183787"," 莫3",0,0,0,0,0);
a[3]=new ScoreInformation("20183788"," 莫4",0,0,0,0,0);
a[4]=new ScoreInformation("20183789"," 莫5",0,0,0,0,0);
}
static int i;
public static void main(String [] args) {
mm();
for(;;) {
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 m = sc.nextInt();
switch(m){
case 1:
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();
boolean flag1=false;

for(i=0;i<5;i++)
if(n1.equals(a[i].getStunumber()))
{flag1=true;break;}
if(flag1) {
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].setEnglishiscore(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].getEnglishiscore());
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("录入成功!!");
else {
a[i].setMathematicsscore(0);
a[i].setEnglishiscore(0);
a[i].setNetworkscore(0);
a[i].setDatabasescore(0);
a[i].setSoftwarescore(0);
System.out.println("录入失败!!");
}
}
else {System.out.println("该学号不存在!!!");}

break;
case 2:
double d1,d2,d3,d4,d5;
d1=a[i].getMathematicsscore();
d2=a[i].getEnglishiscore();
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("***********************************************");
boolean flag2=false;

for( i=0;i<5;i++)
if(n3.equals(a[i].getStunumber()))
{flag2=true;break;}
if(flag2) {
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].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("***********************************************");
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].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("***********************************************");
System.out.println(" 该学生成绩录入完毕,是否提交(Y/N)");
String n2=sc.next();
if(n2.equals("Y"))
System.out.println("修改成功!!");
else {
a[i].setMathematicsscore(d1);
a[i].setEnglishiscore(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].setEnglishiscore(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].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("***********************************************");
System.out.println(" 该学生成绩录入完毕,是否提交(Y/N)");
String n4=sc.next();
if(n4.equals("Y"))
System.out.println("修改成功!!");
else {
a[i].setMathematicsscore(d1);
a[i].setEnglishiscore(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].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("***********************************************");
System.out.println(" 该学生成绩录入完毕,是否提交(Y/N)");
String n5=sc.next();
if(n5.equals("Y"))
System.out.println("修改成功!!");
else {
a[i].setMathematicsscore(d1);
a[i].setEnglishiscore(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].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("***********************************************");
System.out.println(" 该学生成绩录入完毕,是否提交(Y/N)");
String n6=sc.next();
if(n6.equals("Y"))
System.out.println("修改成功!!");
else {
a[i].setMathematicsscore(d1);
a[i].setEnglishiscore(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].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("***********************************************");
System.out.println(" 该学生成绩录入完毕,是否提交(Y/N)");
String n7=sc.next();
if(n7.equals("Y"))
System.out.println("修改成功!!");
else {
a[i].setMathematicsscore(d1);
a[i].setEnglishiscore(d2);
a[i].setNetworkscore(d3);
a[i].setDatabasescore(d4);
a[i].setSoftwarescore(d5);
System.out.println("录入失败!!");
}
break;
}


break;

case 3:

break;
case 4:
System.out.println("***********************************************************");
System.out.println(" 谢谢使用石家庄铁道大学软件工程系学生学籍管理系统 2019 版 ");
System.out.println(" 制作人:莫佳亮 ");
System.out.println("***********************************************************");
return;
default:
System.out.println("该选项不存在!!!");
break;
}
}
}}

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].getEnglishiscore()>=90)
t2=4.0;
else if(a[i].getEnglishiscore()>=85&&a[i].getEnglishiscore()<=89.9)
t2=3.7;
else if(a[i].getEnglishiscore()>=82&&a[i].getEnglishiscore()<=84.9)
t2=3.3;
else if(a[i].getEnglishiscore()>=78&&a[i].getEnglishiscore()<=81.9)
t2=3.0;
else if(a[i].getEnglishiscore()>=75&&a[i].getEnglishiscore()<=77.9)
t2=2.7;
else if(a[i].getEnglishiscore()>=72&&a[i].getEnglishiscore()<=74.9)
t2=2.3;
else if(a[i].getEnglishiscore()>=68&&a[i].getEnglishiscore()<=71.9)
t2=2.0;
else if(a[i].getEnglishiscore()>=66&&a[i].getEnglishiscore()<=67.9)
t2=1.7;
else if(a[i].getEnglishiscore()>=64&&a[i].getEnglishiscore()<=65.9)
t2=1.5;
else if(a[i].getEnglishiscore()>=60&&a[i].getEnglishiscore()<=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(" 该学生成绩录入完毕,是否提交(Y/N)");
System.out.println("***********************************************");}
String n6;
n6=sc.next();
if(n6.equals("N"))
{llll=true;}
else
break;
}
break;

java1

标签:flag   network   turn   ack   软件工程   修改   databases   tun   界面   

原文地址:https://www.cnblogs.com/ICDTAD/p/11525034.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!