package javatestywh;

 public class ScoreInformation
{
private String stunumber;
private String name;
private double mathematicsscore=4;
private double englishscore=3;
private double networkscore=4;
private double databasescore=3;
private double softwarescore=2;
public ScoreInformation()
{
super(); }
public ScoreInformation(String stunumber, String name, double mathematicsscore, double englishscore,
double networkscore, double databasescore, double softwarescore)
{
super();
this.stunumber = stunumber;
this.name = name;
this.mathematicsscore = mathematicsscore;
this.englishscore = englishscore;
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 getEnglishscore()
{
return englishscore;
}
public void setEnglishscore(double englishscore)
{
this.englishscore = englishscore;
}
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;
}
@Override
public String toString()
{
return "学号" + stunumber + ", 姓名=" + name + ", 数学=" + mathematicsscore
+ ", 英语=" + englishscore + ", 网络=" + networkscore + ", 数据库="
+ databasescore + ", 软件=" + softwarescore ;
} }
package javatestywh; import java.util.Scanner; public class scoreManagement
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
// 定义数组预存五个学生的姓名以及学号;
ScoreInformation[] stu = new ScoreInformation[5];
stu[0] = new ScoreInformation("20183606", "yanwenhui", 4, 3, 4, 3, 2);
stu[1] = new ScoreInformation("20183610", "fengfeng", 4, 3, 4, 3, 2);
stu[2] = new ScoreInformation("20183607", "heihei", 4, 3, 4, 3, 2);
stu[3] = new ScoreInformation("20183608", "fengshun", 4, 3, 4, 3, 2);
stu[4] = new ScoreInformation("20183609", "beauty", 4, 3, 4, 3, 2);
mainshow(stu);
} // 主界面
public static void mainshow(ScoreInformation[] stu)
{
System.out.print("***********************************************************\r\n" + "石家庄铁道大学软件工程系\r\n"
+ "学生学籍管理系统 2019 版\r\n" + "***********************************************************\r\n"
+ "1、 学生考试成绩录入\r\n" + "2、 学生考试成绩修改\r\n" + "3、 计算学生成绩绩点\r\n" + "4、退出学籍管理系统\r\n"
+ "**********************************************************");
Scanner sc = new Scanner(System.in);// 输入选项
int number = sc.nextInt();
switch (number)
{
case 1:
getgrade(stu);
break;
case 2:
change(stu);
break;
case 3:
calculate(stu);
break;
case 4:
exited();
break;
case 5:
showgrade(stu);
break;
default:
{
System.out.println("信息错误,该选项不存在");
mainshow(stu);
break;
} } } public static void getgrade(ScoreInformation[] stu)
{
Scanner sc = new Scanner(System.in);
System.out.print(
"***********************************************************\r\n" + "石家庄铁道大学软件工程系学生学籍管理系统 2019 版\r\n"
+ "学生考试成绩录入\r\n" + "***********************************************************\r\n"
+ "请输入学生学号:XXXXXXXX\r\n" + "**********************************************************");
String number = sc.nextLine();
int flag = 0;
for (int i = 0; i < 5; i++)
{
if (stu[i].getStunumber().equals(number))
{
System.out.print("***********************************************************\r\n"
+ "std软件工程系学生学籍管理系统 2019 版\r\n" + "学生考试成绩录入界面\r\n"
+ "***********************************************************\r\n" + "学生学号:"
+ stu[i].getStunumber() + "\r\n" + "学生姓名:" + stu[i].getName() + "\r\n" + "请输入高等数学成绩:XXX\r\n"
+ "**********************************************************");
double math = sc.nextDouble();
System.out.println(stu[i].getName() + "的高数成绩是:" + math);
System.out.println("请输入该生的英语成绩");
double english = sc.nextDouble();
System.out.println(stu[i].getName() + "的英语成绩是:" + english);
System.out.println("请输入该生的网络成绩");
double network = sc.nextDouble();
System.out.println(stu[i].getName() + "的网络成绩是:" + network);
System.out.println("请输入该生的数据库成绩");
double data = sc.nextDouble();
System.out.println(stu[i].getName() + "的网络成绩是:" + data);
System.out.println("请输入该生的软件成绩");
double soft = sc.nextDouble();
System.out.print("***********************************************************\r\n"
+ "std软件工程系学生学籍管理系统 2019 版\r\n" + "学生考试成绩录入\r\n"
+ "***********************************************************\r\n" + "学生学号:"
+ stu[i].getStunumber() + "\r\n" + "学生姓名:" + stu[i].getName() + "\r\n" + "高等数学成绩:" + math
+ "\r\n" + "大学英语成绩:" + english + "\r\n" + "计算机网络成绩:" + network + "\r\n" + "数据库成绩:" + data
+ "\r\n" + "软件工程成绩:" + soft + "\r\n" + "该学生成绩已录入完毕,是否提交(Y/N)\r\n"
+ "**********************************************************"); if (sc.next().equals("Y"))
{
stu[i].setEnglishscore(english);
stu[i].setMathematicsscore(math);
stu[i].setDatabasescore(data);
stu[i].setNetworkscore(network);
stu[i].setSoftwarescore(soft);
mainshow(stu);
} else
{
System.out.println("返回录入");
getgrade(stu);
} flag = 1;
}
}
// 如果没有该学生信息,提示重新输入;
if (flag == 0)
{
System.out.println("该学号不存在,请重新输入");
getgrade(stu);
} } public static void change(ScoreInformation[] stu)
{
Scanner sc = new Scanner(System.in); System.out.print(
"***********************************************************\r\n" + "std软件工程系学生学籍管理系统 2019 版\r\n"
+ "学生考试成绩修改界面\r\n" + "***********************************************************\r\n"
+ "请输入学生学号:XXXXXXXX\r\n" + "**********************************************************");
String number = sc.nextLine();
int flag = 0;
for (int i = 0; i < 5; i++)
{
if (stu[i].getStunumber().equals(number))
{
System.out.print("***********************************************************\r\n"
+ "std软件工程系学生学籍管理系统 2019 版\r\n" + "学生考试成绩录入\r\n"
+ "***********************************************************\r\n" + "学生学号:"
+ stu[i].getStunumber() + "\r\n" + "学生姓名:" + stu[i].getName() + "\r\n" + "1、高等数学成绩:"
+ stu[i].getMathematicsscore() + "\r\n" + "2、大学英语成绩:" + stu[i].getEnglishscore() + "\r\n"
+ "3、计算机网络成绩:" + stu[i].getNetworkscore() + "\r\n" + "4、数据库成绩:" + stu[i].getDatabasescore()
+ "\r\n" + "5、软件工程成绩:" + stu[i].getSoftwarescore() + "\r\n"
+"请输入要修改的选项"+"\r\n"
+ "**********************************************************");
int select = sc.nextInt();
double changed;
switch (select)
{
case 1:
System.out.print("学生考试成绩录入界面\r\n" +
"***********************************************************\r\n" +
"学生学号:"+stu[i].getStunumber()+"\r\n" +
"学生姓名:"+stu[i].getName()+"\r\n" +
"请输入修改后高数成绩:XXX\r\n" +
"**********************************************************");
changed=sc.nextDouble();
System.out.print("***********************************************************\r\n"
+ "std软件工程系学生学籍管理系统 2019 版\r\n" + "学生考试成绩录入\r\n"
+ "***********************************************************\r\n" + "学生学号:"
+ stu[i].getStunumber() + "\r\n" + "学生姓名:" + stu[i].getName() + "\r\n" + "1、高等数学成绩:"
+ changed + "\r\n" + "2、大学英语成绩:" + stu[i].getEnglishscore() + "\r\n"
+ "3、计算机网络成绩:" + stu[i].getNetworkscore() + "\r\n" + "4、数据库成绩:" + stu[i].getDatabasescore()
+ "\r\n" + "5、软件工程成绩:" + stu[i].getSoftwarescore() + "\r\n"
+"该学生成绩已修改完毕,是否提交(Y/N)"+"\r\n"
+ "**********************************************************");
if(sc.next().equals("Y")) {
stu[i].setMathematicsscore(changed);
mainshow(stu);
}
else {
change(stu);
}
break;
case 2:
System.out.print("学生考试成绩录入界面\r\n" +
"***********************************************************\r\n" +
"学生学号:"+stu[i].getStunumber()+"\r\n" +
"学生姓名:"+stu[i].getName()+"\r\n" +
"请输入修改后成绩:英语\r\n" +
"**********************************************************");
changed=sc.nextDouble();
System.out.print("***********************************************************\r\n"
+ "std软件工程系学生学籍管理系统 2019 版\r\n" + "学生考试成绩录入\r\n"
+ "***********************************************************\r\n" + "学生学号:"
+ stu[i].getStunumber() + "\r\n" + "学生姓名:" + stu[i].getName() + "\r\n" + "1、高等数学成绩:"
+ stu[i].getMathematicsscore() + "\r\n" + "2、大学英语成绩:" + changed + "\r\n"
+ "3、计算机网络成绩:" + stu[i].getNetworkscore() + "\r\n" + "4、数据库成绩:" + stu[i].getDatabasescore()
+ "\r\n" + "5、软件工程成绩:" + stu[i].getSoftwarescore() + "\r\n"
+"该学生成绩已修改完毕,是否提交(Y/N)"+"\r\n"
+ "**********************************************************");
if(sc.next().equals("Y")) {
stu[i].setEnglishscore(changed);
mainshow(stu);
}
else {
change(stu);
}
break;
case 3:
System.out.print("学生考试成绩录入界面\r\n" +
"***********************************************************\r\n" +
"学生学号:"+stu[i].getStunumber()+"\r\n" +
"学生姓名:"+stu[i].getName()+"\r\n" +
"请输入修改后网络成绩:\r\n" +
"**********************************************************");
changed=sc.nextDouble();
System.out.print("***********************************************************\r\n"
+ "std软件工程系学生学籍管理系统 2019 版\r\n" + "学生考试成绩录入\r\n"
+ "***********************************************************\r\n" + "学生学号:"
+ stu[i].getStunumber() + "\r\n" + "学生姓名:" + stu[i].getName() + "\r\n" + "1、高等数学成绩:"
+ stu[i].getMathematicsscore() + "\r\n" + "2、大学英语成绩:" + stu[i].getEnglishscore() + "\r\n"
+ "3、计算机网络成绩:" + changed + "\r\n" + "4、数据库成绩:" + stu[i].getDatabasescore()
+ "\r\n" + "5、软件工程成绩:" + stu[i].getSoftwarescore() + "\r\n"
+"该学生成绩已修改完毕,是否提交(Y/N)"+"\r\n"
+ "**********************************************************");
if(sc.next().equals("Y")) {
stu[i].setNetworkscore(changed);
mainshow(stu);
}
else {
change(stu);
}
break;
case 4:
System.out.print("学生考试成绩录入界面\r\n" +
"***********************************************************\r\n" +
"学生学号:"+stu[i].getStunumber()+"\r\n" +
"学生姓名:"+stu[i].getName()+"\r\n" +
"请输入修改后数据库成绩:XXX\r\n" +
"**********************************************************");
changed=sc.nextDouble();
System.out.print("***********************************************************\r\n"
+ "std软件工程系学生学籍管理系统 2019 版\r\n" + "学生考试成绩录入\r\n"
+ "***********************************************************\r\n" + "学生学号:"
+ stu[i].getStunumber() + "\r\n" + "学生姓名:" + stu[i].getName() + "\r\n" + "1、高等数学成绩:"
+ stu[i].getMathematicsscore() + "\r\n" + "2、大学英语成绩:" + stu[i].getEnglishscore() + "\r\n"
+ "3、计算机网络成绩:" + stu[i].getNetworkscore() + "\r\n" + "4、数据库成绩:" + changed
+ "\r\n" + "5、软件工程成绩:" + stu[i].getSoftwarescore() + "\r\n"
+"该学生成绩已修改完毕,是否提交(Y/N)"+"\r\n"
+ "**********************************************************");
if(sc.next().equals("Y")) {
stu[i].setDatabasescore(changed);
mainshow(stu);
}
else {
change(stu);
}
break;
case 5:
System.out.print("学生考试成绩录入界面\r\n" +
"***********************************************************\r\n" +
"学生学号:"+stu[i].getStunumber()+"\r\n" +
"学生姓名:"+stu[i].getName()+"\r\n" +
"请输入修改后软件成绩:XXX\r\n" +
"**********************************************************");
changed=sc.nextDouble();
System.out.print("***********************************************************\r\n"
+ "std软件工程系学生学籍管理系统 2019 版\r\n" + "学生考试成绩录入\r\n"
+ "***********************************************************\r\n" + "学生学号:"
+ stu[i].getStunumber() + "\r\n" + "学生姓名:" + stu[i].getName() + "\r\n" + "1、高等数学成绩:"
+ stu[i].getMathematicsscore() + "\r\n" + "2、大学英语成绩:" + stu[i].getEnglishscore() + "\r\n"
+ "3、计算机网络成绩:" + stu[i].getNetworkscore() + "\r\n" + "4、数据库成绩:" + stu[i].getDatabasescore()
+ "\r\n" + "5、软件工程成绩:" + changed + "\r\n"
+"该学生成绩已修改完毕,是否提交(Y/N)"+"\r\n"
+ "**********************************************************");
if(sc.next().equals("Y")) {
stu[i].setSoftwarescore(changed);
mainshow(stu);
}
else {
change(stu);
}
break;
default:
System.out.println("请选择正确信息输入");
change(stu);
break; } flag = 1;
} }
if (flag == 0)
{
System.out.println("学号输入错误,请重新输入学号");
change(stu);
} } public static void calculate(ScoreInformation[] stu) {
Scanner sc=new Scanner(System.in);
System.out.print("***********************************************************\r\n" +
"std软件工程系学生学籍管理系统 2019 版\r\n" +
"学生考试成绩绩点计算界面\r\n" +
"***********************************************************\r\n" +
"请输入学生学号:XXXXXXXX\r\n" +
"**********************************************************");
String number = sc.nextLine();
float math;
float english;
float net;
float data;
float soft;
int flag = 0;
for (int i = 0; i < 5; i++)
{
if (stu[i].getStunumber().equals(number))
{
double pingjun;
pingjun=(judge(stu[i].getMathematicsscore())*4+judge(stu[i].getEnglishscore())*3+
judge(stu[i].getNetworkscore())*4+judge(stu[i].getDatabasescore())*3+judge(stu[i].getSoftwarescore())*2)
/16;
System.out.print("学生学号:"+stu[i].getStunumber()+"\r\n" +
"学生姓名:"+stu[i].getName()+"\r\n" +
"1、高等数学成绩绩点:"+judge(stu[i].getMathematicsscore())+"\r\n" +
"2、大学英语成绩绩点:"+judge(stu[i].getEnglishscore())+"\r\n" +
"3、计算机网络成绩绩点:"+judge(stu[i].getNetworkscore())+"\r\n" +
"4、数据库成绩绩点:"+judge(stu[i].getDatabasescore())+"\r\n" +
"5、软件工程成绩绩点:"+judge(stu[i].getSoftwarescore())+"\r\n" );
System.out.println("你的平均学分绩点为:"+String.format("%.2f", pingjun)+"\r\n" );
if(pingjun>=2) {
System.out.println("提示信息:您的学分绩点已达到毕业要求");
System.out.println("是否返回主界面:Y/N");
if(sc.next().equals("Y")) {
mainshow(stu);
}
}
else {
System.out.println("提示信息:您的学分绩点未达到毕业要求");
System.out.println("是否返回主界面:Y/N");
if(sc.next().equals("Y")) {
mainshow(stu);
}
} flag=1;
}
}
if(flag==0) {
System.out.println("输入信息错误,请重新输入");
mainshow(stu);
}
} public static void exited() {
System.out.print("***********************************************************\r\n" +
"谢谢使用石家庄铁道大学软件工程系学生学籍管理系统 2019 版\r\n" +
"制作人:yanwenhui\r\n" +
"***********************************************************"); }
public static void showgrade(ScoreInformation [] stu) {
for(int i=0;i<stu.length;i++) {
System.out.println(stu[i]);
}
mainshow(stu); } public static double judge(double x) {
double t=0;
if(x>=90) t=4;
else if(x>=85&&x<=89.9) t=3.7;
else if(x>=82&&x<=84.9) t=3.3;
else if(x>=78&&x<=81.9) t=3.0;
else if(x>=75&&x<=77.9) t=2.3;
else if(x>=72&&x<=74.9) t=2.3;
else if(x>=68&&x<=71.9) t=2.0;
else if(x>=66&&x<=67.9) t=1.7;
else if(x>=64&&x<=65.9) t=1.5;
else if(x>=60&&x<=63.9) t=1.0;
else t=0; return t;
}
}

心得:第一次完成的一个系统,哈哈哈;

studentmanagement的更多相关文章

  1. 基于ADO.NET的SqlHelper类

    1.使用Connection连接数据库的步骤: (1).添加命名空间 System.Data.SqlClient(注意:初学者经常会忘记) (2)定义连接字符串.连接SQL Server 数据库时: ...

  2. MFC listcontrol 分列 添加行数据 点击列头排序

    适用于 对话框程序 1.在工具箱中拖出 ListControl,然后右键-属性,view-Report 让你的ListControl变成这幅模样! 2.添加ListControl控件的control类 ...

  3. 连接mysql遇到的问题

    1. 首先使用一个用户名不行时,可以新建一个用户名点击用户,输入名和密码,此时一定要记住密码,别忘了.不过也可以点击编辑用户改.此时连接时发现还是连接不上.出现错误信息为: Access denied ...

  4. ASP.NET动态的网页增删查改

    动态页面的增删查改,不多说了,直接上代码 跟前面的一般处理程序一样我上用的同一套三层,只是UI层的东西不一样,在纠结着要不要重新在上一次以前上过的代码: 纠结来纠结去,最后我觉得还上上吧,毕竟不上为我 ...

  5. Struts2(二)之封装请求正文、数据类型转换、数据验证

    一.封装请求正文到对象中(重点) 1.1.静态参数封装 在struts.xml文件中,给动作类注入值,使用的是setter方法 1.2.动态参数封装 通过用户表单封装请求正文参数 1.2.1.动作类作 ...

  6. JavaWeb程序利用Servlet的对SQLserver增删改查操作

    声明:学了几天终于将增删改查的操作掌握了,也发现了一些问题,所以总结一下. 重点:操作数据库主要用的是SQL语句跟其他无关. 一:前提知识:PreparedStatement PreperedStat ...

  7. JavaWeb程序连接SQLserver数据库

    声明:一直以来都以为javaweb程序连接数据库是一个很高大上很难的问题,结果今天学习了一下,不到两个小时就解决了,所以总结一篇博客. JavaWeb程序连接SQLserver数据库分为一下步骤: 1 ...

  8. struts2(四)之输入校验

    前言 这个本来是昨天就写好的,但是不知道为什么没有保存成功!但是今天起来再写一遍就当巩固一下知识吧. 一.输入校验概述 在以前我们写一个登录页面时,并没有限制用户的输入,不管用户输入什么,我们都存入数 ...

  9. sb error

    width: $("#StudentManagement").parent().width(), height: $("#StudentManagement") ...

随机推荐

  1. 011-PHP获取数组中的元素

    <?php $monthName = array( /*定义$monthName[1]到$monthName[12]*/ 1=>"January", "Feb ...

  2. ORACLE添加新用户并配置权限 添加其他用户的表权限

    添加用户配置权限 1.查出表空间所在位置 ,file_name from dba_data_files order by file_id; 2.根据步骤1查出的路径.将路径替换掉并指定用户名 路径:D ...

  3. HDU - 1166 敌兵布阵 (线段树---点修改)

    题意: 1.Add i j,i和j为正整数,表示第i个营地增加j个人(j不超过30) 2.Sub i j ,i和j为正整数,表示第i个营地减少j个人(j不超过30); 3.Query i j ,i和j ...

  4. JWT跨域身份验证解决方案

    JSON Web Token(JWT)是目前最流行的跨域身份验证解决方案.本文介绍JWT的原理和用法. 1. 当前跨域身份验证的问题 Internet服务无法与用户身份验证分开.一般过程如下.1.用户 ...

  5. CSS - 强制换行和禁止换行强制换行 和禁止换行样

    强制换行 word-break: break-all;       只对英文起作用,以字母作为换行依据. word-wrap: break-word;   只对英文起作用,以单词作为换行依据. whi ...

  6. 英语语法 - the + 形容词 的意义

    1,表示一类人  (复数) the young 青年 the old 老年the poor 穷人 the rich 富人the sick 病人 The old need care more than ...

  7. GLConsole的编译和使用

    1.在CVars文件中搜索tinyxml,去掉所有tinyxml的编译选项 2.Add the following line to the "CMakeLists.txt" fil ...

  8. 八十一、SAP中的ALV的简介(ABAP List Viewer)

    一.ALV是SAP中的一个表格,全称为:ABAP List Viewer或者SAP List Viewer,就是可视化表格. ALV是SAP系统中心的列表标准,可以在ABAP程序中进行报表输出.除去列 ...

  9. 十二、Sap的压缩类型p的使用方法

    一.代码如下 二.我们查看输出结果 三.如果位数超出了会怎样呢?我们试试 四.提示如下

  10. spring boot集成mybatis(1)

    Spring Boot 集成教程 Spring Boot 介绍 Spring Boot 开发环境搭建(Eclipse) Spring Boot Hello World (restful接口)例子 sp ...