package  作业2;

//信1805-1   杨一帆  20183608

public class ScoreInformation1 {

    private String stunumber;
private String name;
private double mathematicsscore=4;
private double englishiscore=3;
private double networkscore=4;
private double databasescore=3;
private double softwarescore=2; public ScoreInformation1() {
super();
// TODO Auto-generated constructor stub
} public ScoreInformation1(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;
} 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;
}
} package 作业2; import java.util.Scanner; public class ScoreManagement1 { public static void main(String[] args)
{ ScoreInformation1[] stu =new ScoreInformation1[5]; stu[0]=new ScoreInformation1("20183606", "晏雯慧", 4, 3, 4, 3, 2);
stu[1]=new ScoreInformation1("20183607", "徐姣美", 4, 3, 4, 3, 2);
stu[2]=new ScoreInformation1("20183608", "杨一帆", 4, 3, 4, 3, 2);
stu[3]=new ScoreInformation1("20183609", "胡海靖", 4, 3, 4, 3, 2);
stu[4]=new ScoreInformation1("20183610", "冯静妃", 4, 3, 4, 3, 2); //ScoreManagement1 S1=new ScoreManagement1();
exit(stu);
} String name;
static double mathematicsscore;
static double englishiscore;
static double networkscore;
static double databasescore;
static double softwarescore; public static void exit(ScoreInformation1[] stu)
{
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 n;
Scanner s=new Scanner(System.in);
n=s.nextInt();
if(n==1)
{
luru(stu);
}
else if(n==2)
{
xiugai(stu);
}
else if(n==3)
{
jidian(stu);
}
else if(n==4)
{
tuichu(stu);
}
else
{
System.out.println("该选项不存在");
exit(stu);
}
}
public static void tuichu(ScoreInformation1[] stu)
{
System.out.println("******************");
System.out.println("谢谢使用石家庄铁道大学软件工程系学生学籍管理系统 2019 版");
System.out.println("制作人:杨一帆");
System.out.println("*******************");
} public static void luru(ScoreInformation1[] stu)
{
int flag=1; System.out.println("*********************");
System.out.println("石家庄铁道大学软件工程系" );
System.out.println( "学生学籍管理系统 2019 版");
System.out.println("**********************");
System.out.println("请输入学生的学号");
System.out.println("************************"); Scanner sc=new Scanner(System.in);
String number=sc.nextLine(); for(int i=0;i<5;i++)
{ if(number.equals(stu[i].getstunumber()))
{
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("请输入高数成绩");
System.out.println("**********************"); Scanner s1=new Scanner(System.in);
double mathematicsscore=s1.nextDouble(); System.out.println("请输入大学英语成绩"); Scanner s2=new Scanner(System.in);
double englishiscore=s2.nextDouble(); System.out.println("请输入计算机网络成绩");
Scanner s3=new Scanner(System.in);
double networkscore=s3.nextDouble(); System.out.println("请输入数据库成绩");
Scanner s4=new Scanner(System.in);
double databasescore=s4.nextDouble(); System.out.println("请输入软件工程的成绩");
Scanner s5=new Scanner(System.in);
double softwarescore=s5.nextDouble(); 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("高数成绩"+mathematicsscore);
System.out.println("英语成绩"+englishiscore);
System.out.println("计算机网络成绩"+networkscore);
System.out.println("数据库成绩"+databasescore);
System.out.println("软件工程成绩"+softwarescore);
System.out.println("该学生成绩已录入完毕,是否提交(Y/N)");
System.out.println("*******************************"); Scanner s6=new Scanner(System.in);
String a=s6.next(); if(a.equals("Y"))
{
stu[i].setmathematicsscore(mathematicsscore);
stu[i].setenglishiscore(englishiscore);
stu[i].setnetworkscore(networkscore);
stu[i].setsoftwarescore(softwarescore);
stu[i].setdatabasescore(databasescore); exit(stu);
}
else
{
System.out.println("重新返回成绩录入界面");
exit(stu);
} flag=1; }
}
if(flag==0)
{
System.out.println("没有这位学生");
exit(stu);
} }
public static void xiugai(ScoreInformation1[] stu)
{
System.out.println("*******************************************");
System.out.println(" 石家庄铁道大学软件工程系学生学籍管理系统 2019 版 ");
System.out.println(" 学生考试成绩修改界面 ");
System.out.println("*******************************************");
System.out.println(" 请输入学生学号 ");
System.out.println("*******************************************"); Scanner a1=new Scanner(System.in);
String number1 = a1.next(); int t = 0;
for(int i=0;i<5;i++)
{
if(stu[i].getstunumber().equals(number1))
{
t=i;
}
} System.out.println("***********************************");
System.out.println(" 石家庄铁道大学软件工程系学生学籍管理系统 2019 版 ");
System.out.println(" 学生考试成绩录入 ");
System.out.println("**********************************");
System.out.println("学生学号:"+stu[t].getstunumber());
System.out.println("学生姓名:"+stu[t].getname());
System.out.println("1、高数成绩"+stu[t].getmathematicsscore());
System.out.println("2、英语成绩"+stu[t].getenglishiscore());
System.out.println("3、计算机网络成绩"+stu[t].getnetworkscore());
System.out.println("4、数据库成绩"+stu[t].getdatabasescore());
System.out.println("5、软件工程成绩"+stu[t].getsoftwarescore());
System.out.println("请输入要修改的序号");
System.out.println("***********************************"); int a;
Scanner s8=new Scanner(System.in);
a=s8.nextInt();
if(a==1)
{
System.out.println("************************");
System.out.println("学生学号:"+stu[t].getstunumber());
System.out.println("学生姓名:"+stu[t].getname());
System.out.println("请输入修改后的高数成绩"); Scanner a2=new Scanner(System.in);
mathematicsscore=a2.nextDouble();
stu[t].setmathematicsscore(mathematicsscore); System.out.println("***********************************");
System.out.println(" 石家庄铁道大学软件工程系学生学籍管理系统 2019 版 ");
System.out.println(" 学生考试成绩录入 ");
System.out.println("**********************************");
System.out.println("学生学号:"+stu[t].getstunumber());
System.out.println("学生姓名:"+stu[t].getname());
System.out.println("1、高数成绩"+mathematicsscore);
System.out.println("2、英语成绩"+stu[t].getenglishiscore());
System.out.println("3、计算机网络成绩"+stu[t].getnetworkscore());
System.out.println("4、数据库成绩"+stu[t].getdatabasescore());
System.out.println("5、软件工程成绩"+stu[t].getsoftwarescore());
System.out.println("学生成绩修改完成,是否提交(Y/N)");
System.out.println("***********************************"); Scanner a3=new Scanner(System.in);
String e=a3.next(); if(a3.equals("Y"))
{
stu[t].setmathematicsscore(mathematicsscore);
stu[t].setenglishiscore(englishiscore);
stu[t].setnetworkscore(networkscore);
stu[t].setdatabasescore(databasescore);
stu[t].setsoftwarescore(softwarescore); exit(stu);
}
else
{
exit(stu);
} }
else if(a==2)
{ System.out.println("************************");
System.out.println("学生学号:"+stu[t].getstunumber());
System.out.println("学生姓名:"+stu[t].getname());
System.out.println("请输入修改后的英语成绩"); Scanner a4=new Scanner(System.in);
englishiscore=a4.nextDouble();
stu[t].setenglishiscore(englishiscore); System.out.println("***********************************");
System.out.println(" 石家庄铁道大学软件工程系学生学籍管理系统 2019 版 ");
System.out.println(" 学生考试成绩录入 ");
System.out.println("**********************************");
System.out.println("学生学号:"+stu[t].getstunumber());
System.out.println("学生姓名:"+stu[t].getname());
System.out.println("1、高数成绩"+stu[t].getmathematicsscore());
System.out.println("2、英语成绩"+englishiscore);
System.out.println("3、计算机网络成绩"+stu[t].getnetworkscore());
System.out.println("4、数据库成绩"+stu[t].getdatabasescore());
System.out.println("5、软件工程成绩"+stu[t].getsoftwarescore());
System.out.println("学生成绩修改完成,是否提交");
System.out.println("***********************************"); Scanner a3=new Scanner(System.in);
String e=a3.next(); if(a3.equals("Y"))
{
stu[t].setmathematicsscore(mathematicsscore);
stu[t].setenglishiscore(englishiscore);
stu[t].setnetworkscore(networkscore);
stu[t].setdatabasescore(databasescore);
stu[t].setsoftwarescore(softwarescore); exit(stu);
}
else
{
exit(stu);
}
}
else if(a==3)
{ System.out.println("************************");
System.out.println("学生学号:"+stu[t].getstunumber());
System.out.println("学生姓名:"+stu[t].getname());
System.out.println("请输入修改后计算机网络的成绩"); Scanner a5=new Scanner(System.in);
networkscore=a5.nextDouble();
stu[t].setnetworkscore(networkscore); System.out.println("***********************************");
System.out.println(" 石家庄铁道大学软件工程系学生学籍管理系统 2019 版 ");
System.out.println(" 学生考试成绩录入 ");
System.out.println("**********************************");
System.out.println("学生学号:"+stu[t].getstunumber());
System.out.println("学生姓名:"+stu[t].getname());
System.out.println("1、高数成绩"+stu[t].getmathematicsscore());
System.out.println("2、英语成绩"+stu[t].getenglishiscore());
System.out.println("3、计算机网络成绩"+networkscore);
System.out.println("4、数据库成绩"+stu[t].getdatabasescore());
System.out.println("5、软件工程成绩"+stu[t].getsoftwarescore());
System.out.println("学生成绩修改完成,是否提交");
System.out.println("***********************************"); Scanner a3=new Scanner(System.in);
String e=a3.next(); if(a3.equals("Y"))
{
stu[t].setmathematicsscore(mathematicsscore);
stu[t].setenglishiscore(englishiscore);
stu[t].setnetworkscore(networkscore);
stu[t].setdatabasescore(databasescore);
stu[t].setsoftwarescore(softwarescore); exit(stu);
}
else
{
exit(stu);
} }
else if(a==4)
{
System.out.println("************************");
System.out.println("学生学号:"+stu[t].getstunumber());
System.out.println("学生姓名:"+stu[t].getname());
System.out.println("请输入修改后的数据库成绩"); Scanner a6=new Scanner(System.in);
databasescore=a6.nextDouble();
stu[t].setdatabasescore(databasescore); System.out.println("***********************************");
System.out.println(" 石家庄铁道大学软件工程系学生学籍管理系统 2019 版 ");
System.out.println(" 学生考试成绩录入 ");
System.out.println("**********************************");
System.out.println("学生学号:"+stu[t].getstunumber());
System.out.println("学生姓名:"+stu[t].getname());
System.out.println("1、高数成绩"+stu[t].getmathematicsscore());
System.out.println("2、英语成绩"+stu[t].getenglishiscore());
System.out.println("3、计算机网络成绩"+stu[t].getnetworkscore());
System.out.println("4、数据库成绩"+databasescore);
System.out.println("5、软件工程成绩"+stu[t].getsoftwarescore());
System.out.println("学生成绩修改完成,是否提交");
System.out.println("***********************************"); Scanner a3=new Scanner(System.in);
String e=a3.next(); if(a3.equals("Y"))
{
stu[t].setmathematicsscore(mathematicsscore);
stu[t].setenglishiscore(englishiscore);
stu[t].setnetworkscore(networkscore);
stu[t].setdatabasescore(databasescore);
stu[t].setsoftwarescore(softwarescore); exit(stu);
}
else
{
exit(stu);
} }
else if(a==5)
{ System.out.println("************************");
System.out.println("学生学号:"+stu[t].getstunumber());
System.out.println("学生姓名:"+stu[t].getname());
System.out.println("请输入修改后的软件工程成绩"); Scanner a7=new Scanner(System.in);
softwarescore=a7.nextDouble();
stu[t].setsoftwarescore(softwarescore); System.out.println("***********************************");
System.out.println(" 石家庄铁道大学软件工程系学生学籍管理系统 2019 版 ");
System.out.println(" 学生考试成绩录入 ");
System.out.println("**********************************");
System.out.println("学生学号:"+stu[t].getstunumber());
System.out.println("学生姓名:"+stu[t].getname());
System.out.println("1、高数成绩"+stu[t].getmathematicsscore());
System.out.println("2、英语成绩"+stu[t].getenglishiscore());
System.out.println("3、计算机网络成绩"+stu[t].getnetworkscore());
System.out.println("4、数据库成绩"+stu[t].getdatabasescore());
System.out.println("5、软件工程成绩"+softwarescore);
System.out.println("学生成绩修改完成,是否提交");
System.out.println("***********************************"); Scanner a3=new Scanner(System.in);
String e=a3.next(); if(a3.equals("Y"))
{
stu[t].setmathematicsscore(mathematicsscore);
stu[t].setenglishiscore(englishiscore);
stu[t].setnetworkscore(networkscore);
stu[t].setdatabasescore(databasescore);
stu[t].setsoftwarescore(softwarescore);
exit(stu);
}
else
{
exit(stu);
} } } public static void jidian(ScoreInformation1[] stu)
{ System.out.println("**************************************");
System.out.println("石家庄铁道大学软件工程系学生学籍管理系统 2019 版");
System.out.println("学生考试成绩绩点计算界面");
System.out.println("****************************************");
System.out.println("请输入学生学号:");
System.out.println("*****************************************"); int t=0;
Scanner s=new Scanner(System.in);
String number=s.next(); for(int i=0;i<5;i++)
{
if(stu[i].getstunumber().equals(number))
{
t=i;
}
}
double a=0.0;
a= (panduan(stu[t].getmathematicsscore())*4+panduan(stu[t].getenglishiscore())*3+panduan(stu[t].getnetworkscore())*4+panduan(stu[t].getdatabasescore())*3+panduan(stu[t].getsoftwarescore())*2)/16; System.out.println("***********************************");
System.out.println(" 石家庄铁道大学软件工程系学生学籍管理系统 2019 版 ");
System.out.println(" 学生考试成绩绩点计算界面 ");
System.out.println("**********************************");
System.out.println("学生学号:"+stu[t].getstunumber());
System.out.println("学生姓名:"+stu[t].getname());
System.out.println("1、高数成绩绩点"+panduan(stu[t].getmathematicsscore()));
System.out.println("2、英语成绩绩点"+panduan(stu[t].getenglishiscore()));
System.out.println("3、计算机网络成绩绩点"+panduan(stu[t].getnetworkscore()));
System.out.println("4、数据库成绩绩点"+panduan(stu[t].getdatabasescore()));
System.out.println("5、软件工程成绩绩点"+panduan(stu[t].getsoftwarescore()));
System.out.println("你的平均学分绩点为:"+String.format("%.2f", a));
System.out.println("是否返回主界面(Y/N)");
System.out.println("***********************************"); Scanner s9=new Scanner(System.in);
String d=s9.next();
if(d.equals("Y"))
{
exit(stu);
} }
public static double panduan(double f)
{ double a = 0.0 ;
if(f<60)
{
a=0.0;
}
if(f>=60&&f<=63.9)
{
a=1.0;
} if(f>=64&&f<=65.9)
{
a=1.5;
} if(f>=66&&f<=67.9)
{
a=1.7;
} if(f>=68&&f<=71.9)
{
a=2.0;
} if(f>=72&&f<=74.9)
{
a=2.3;
} if(f>=75&&f<=77.9)
{
a=2.7;
} if(f>=78&&f<=81.9)
{
a=3.0;
} if(f>=82&&f<=84.9)
{
a=3.3;
} if(f>=85&&f<=89.9)
{
a=3.7;
} if(f>=90)
{
a=4.0;
}
return a; } }

  

写这次的测试上课的时候一直在写,但是不会用数组的形式来写,只是用了一个人的成绩,然后过了一天的下午,开始学习了数组,又开始重新学习,从3点写到了7点,这是小学期之后又一次长时间的编程,java比c++和c感觉要复杂一点,这个编程要多加练习,那些个固定的格式要熟记在脑子里面,随着代码的变长,要学会一点一点,要及时的运行程序,及时发现错误,这个测试要我知道要好好学习java,不能和别人的差距越来越大,认真细心,是编程最重要的方法了吧;

java课堂测试的更多相关文章

  1. Java课堂测试--实现ATM的基本操作体会

    9月20的周四的Java课堂第一节课上就是有关于实现ATM的考试内容,在实现的过程中我了解到自己本身还是有很多的不足之处,例如在实现工程方面的相似性上面还有些许就的欠缺,再者就是回宿舍拿电源的原因导致 ...

  2. java课堂测试2(两种方式)

    实验源代码 这是不使用数组形式的源代码 /* 2017/10/10 王翌淞 课堂测试2 */import java.util.Scanner; public class Number { public ...

  3. Java课堂测试01及感想

    上周进行了Java的开学第一次测验,按要求做一个模拟ATM机功能的程序,实现存取款.转账汇款.修改密码.查询余额的操作.这次测验和假期的试题最大的不同还是把数组存储改成的文件存储,在听到老师说要用文件 ...

  4. java课堂测试—根据模板完成一个简单的技术需求征集系统

    课堂上老师发布了一个页面模板要求让我们实现一个系统的功能,模仿以后后端的简单工作情况. 然后在这个模板的基础上,提供了一个注册的网页模板,接着点击注册的按钮,发现register里面调用了zhu/zh ...

  5. Java课堂测试——一维数组

    题目: 一个典型的流程是: 2. 用户这时候有两个选择2.1  按 单步执行 键, 在 GUI 看到你的程序是如何一步一步算出目前最大子数组的范围,当前计算到的临时子数组是在哪里,等等. 最好用不同的 ...

  6. JAVA课堂测试之一位数组可视化

    代码: package test;//求最大子数组 import java.util.Scanner; import javax.swing.JOptionPane; public class shu ...

  7. JAVA 课堂测试

    package ACC; /*信1705-2班 * 20173623 * 赵墨涵 */ public class Account { String accountID; String accountn ...

  8. java课堂测试样卷-----简易学籍管理系统

    程序设计思路:分别建立两个类:ScoreInformation类(用来定义学生的基本信息以及设置set和get函数)ScoreManagement类(用来定义实现学生考试成绩录入,考试成绩修改,绩点计 ...

  9. 第十一周java课堂测试

    Main.java package class_third_copy; import java.util.Scanner; import classthird.Test; import classth ...

随机推荐

  1. MySql的命令介绍

    1,连接数据库服务器命令 mysql -u 用户名 -p 密码 mysql是连接MySql数据库的命令,-u后跟用户名,-p后跟密码,如果登陆后展示"mysql",则表示登录成功. ...

  2. iis添加asp.net网站,访问提示:由于扩展配置问题而无法提供您请求的页面。如果该页面是脚本,请添加处理程序。如果应下载文件,请添加 MIME 映射

    今天在iis服务器配置asp.net网站,遇到一个问题,记录一下: 问题:由于扩展配置问题而无法提供您请求的页面.如果该页面是脚本,请添加处理程序.如果应下载文件,请添加 MIME 映射. Windo ...

  3. python3-cookbook笔记:第八章 类与对象

    python3-cookbook中每个小节以问题.解决方案和讨论三个部分探讨了Python3在某类问题中的最优解决方式,或者说是探讨Python3本身的数据结构.函数.类等特性在某类问题上如何更好地使 ...

  4. mysql必知必会--用通配符进行过滤

    LIKE 操作符 前面介绍的所有操作符都是针对已知值进行过滤的.不管是匹配一 个还是多个值,测试大于还是小于已知值,或者检查某个范围的值,共 同点是过滤中使用的值都是已知的.但是,这种过滤方法并不是任 ...

  5. 2python脚本在window编辑后linux不能执行的问题

    参考简书博主天道酬勤abcd python脚本在windows编辑后,在linux下执行提示 /usr/bin/python^M: bad interpreter: No such file or d ...

  6. 小白的linux笔记3:对外联通——开通ssh和ftp和smb共享

    1.SSH的开通.https://www.cnblogs.com/DiDiao-Liang/articles/8283686.html 安装:yum install sshd或yum install ...

  7. qt creator源码全方面分析(2-9)

    目录 Semantic Highlighting 通用高亮 高亮和折叠块 Semantic Highlighting Qt Creator将C++,QML和JavaScript语言理解为代码,而不是纯 ...

  8. 安装NTP到CentOS(YUM)

    运行环境 系统版本:CentOS Linux release 7.3.1611 (Core) 软件版本:Docker 17.12.1-ce 硬件要求:无 安装过程 1.安装YUM-EPEL存储库 YU ...

  9. ajax请求携带cookie和自定义请求头header

    参考链接:https://blog.csdn.net/menghuanzhiming/article/details/102736312

  10. JVM第二篇 类加载子系统

    1.内存结构概述 简图 ​ 详细 ​ ​ ​ 2.类加载器与类加载的过程 ​ 类加载器子系统负责从文件系统或者网络中加载Class文件,class文件在文件开头有特定的文件标识[CA FE BA BY ...