zoukankan      html  css  js  c++  java
  • 学生管理系统

    package test;

    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 ScoreInformation(String stunumber , String name, double mathematicsscore, double englishiscore, double networkscore, double databasescore, double softwarescore) {
    // TODO Auto-generated constructor stub
    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 test;

    import java.text.DecimalFormat;
    import java.util.Scanner;

    public class ScoreManagement1 {
    static DecimalFormat df = new DecimalFormat("######0.00");
    static boolean z=true;
    static ScoreInformation[] a=new ScoreInformation[5];
    static void mm(){
    a[0]=new ScoreInformation("20183791","马苗苗",0,0,0,0,0);
    a[1]=new ScoreInformation("20183792","宋",0,0,0,0,0);
    a[2]=new ScoreInformation("20183783","李",0,0,0,0,0);
    a[3]=new ScoreInformation("20183784","张",0,0,0,0,0);
    a[4]=new ScoreInformation("20183785","王",0,0,0,0,0);
    }
    static Scanner scan = new Scanner(System.in);
    //学生考试成绩录入
    static void getstudent() {

    System.out.println("***********************************************************");
    System.out.println(" 石家庄铁道大学软件工程系学生学籍管理系统 2019 版 ");
    System.out.println(" 学生考试成绩录入 ");
    System.out.println("************************************************************");
    System.out.println(" 请输入学生学号:XXXXXXXX ");
    System.out.println("************************************************************");
    String stunumber1 = scan.next();
    boolean o = false;
    int i;
    for(i=0;i<5;i++) {
    if(stunumber1.equals(a[i].getStunumber())) {
    o=true;
    break;
    }
    }
    if(o) {
    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(scan.nextDouble());
    System.out.println(" 请输入大学英语成绩: ");
    a[i].setEnglishiscore(scan.nextDouble());
    System.out.println(" 请输入大学计算机网络成绩: ");
    a[i].setNetworkscore(scan.nextDouble());
    System.out.println(" 请输入数据库成绩: ");
    a[i].setDatabasescore(scan.nextDouble());
    System.out.println(" 请输入软件工程成绩: ");
    a[i].setSoftwarescore(scan.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 n=scan.next();
    if(n.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("输入错误请重新输入:");
    }

    }
    public static void change(){
    String stunumber2;
    System.out.println("******************************************************************");
    System.out.println(" 学生考试成绩修改界面");
    System.out.println(" 请输入学生学号");
    System.out.println("******************************************************************");
    stunumber2=scan.next();
    for(int u=0;u<=5;u++){
    if(stunumber2.equals(a[u].getStunumber())){
    System.out.println("********************************************************************");
    System.out.println(" 石家庄铁道大学软件工程系学生学籍管理系统 2019版");
    System.out.println(" 学生考试成绩录入");
    System.out.println("********************************************************************");
    System.out.println(" 学生学号:"+a[u].getStunumber());

    System.out.println(" 学生姓名:"+a[u].getName());

    System.out.println(" 高等数学成绩"+a[u].getMathematicsscore());

    System.out.println(" 大学英语成绩"+a[u].getEnglishiscore());

    System.out.println(" 计算机网络成绩:"+a[u].getNetworkscore());

    System.out.println(" 数据库成绩:"+a[u].getDatabasescore());

    System.out.println(" 软件工程成绩:"+a[u].getSoftwarescore());
    System.out.println("********************************************************************");

    System.out.println("********************************************************************");
    System.out.println(" 石家庄铁道大学软件工程系学生学籍管理系统 2019版");
    System.out.println(" 学生考试成绩录入");
    System.out.println("********************************************************************");

    System.out.println(" 学生学号:"+a[u].getStunumber());

    System.out.println(" 学生姓名:"+a[u].getName());

    System.out.println(" 高等数学成绩");
    a[u].setMathematicsscore(scan.nextDouble());
    System.out.println(" 大学英语成绩:");
    a[u].setEnglishiscore(scan.nextDouble());
    System.out.println(" 计算机网络成绩");
    a[u].setNetworkscore(scan.nextDouble());
    System.out.println(" 数据库成绩");
    a[u].setDatabasescore(scan.nextDouble());
    System.out.println(" 软件工程成绩:");
    a[u].setSoftwarescore(scan.nextDouble());
    System.out.println("********************************************************************");
    System.out.println(" ");
    System.out.println("********************************************************************");
    System.out.println(" 石家庄铁道大学软件工程系学生学籍管理系统 2019版");
    System.out.println(" 学生考试成绩录入");
    System.out.println("********************************************************************");
    System.out.println(" 学生学号:"+a[u].getStunumber());

    System.out.println(" 学生姓名:"+a[u].getName());

    System.out.println(" 高等数学成绩"+a[u].getMathematicsscore());

    System.out.println(" 大学英语成绩"+a[u].getEnglishiscore());

    System.out.println(" 计算机网络成绩:"+a[u].getNetworkscore());

    System.out.println(" 数据库成绩:"+a[u].getDatabasescore());

    System.out.println(" 软件工程成绩:"+a[u].getSoftwarescore());
    System.out.println(" 该学生成绩已修改完毕,是否提交(Y/N) ");
    System.out.println("********************************************************************");
    String n1 ;
    n1=scan.next();
    if(n1.equals("Y")) {
    System.out.println(" 该学生成绩已修改成功 ");
    }
    else {
    break;
    }
    }
    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) {
    boolean miao=true;
    mm();










    while (miao) { // 主菜单
    System.out.println("******************************************************************");
    System.out.println(" 石家庄铁道大学软件工程系");
    System.out.println(" 学生学籍管理系统 2019 版");
    System.out.println("******************************************************************");
    System.out.println("******************************************************************");
    System.out.println(" 1、 学生考试成绩录入");
    System.out.println(" 2、 学生考试成绩修改");
    System.out.println(" 3、 计算学生成绩绩点");
    System.out.println(" 4、退出学籍管理系统");
    System.out.println("******************************************************************");

    int scan_num = scan.nextInt();
    switch (scan_num) { // 主菜单选择
    case 1:
    getstudent();
    break;
    case 2:
    change();
    break;
    case 3:
    int num=0;
    System.out.println("*********************************");
    System.out.println(" 石家庄铁道大学软件工程系学生学籍管理系统2019版");
    System.out.println("学生考试成绩绩点计算界面");
    System.out.println("*********************************");
    double b2;
    int x3=0;
    while(z) {
    System.out.println("请输入学号(八位学号):");
    String b = scan.next();
    for(num=0;num<5;num++)
    if(a[num].getStunumber().equals(b)) {
    double c[]=new double[5];
    c[0]=jidian(a[num].getMathematicsscore());
    c[1]=jidian(a[num].getEnglishiscore());
    c[2]=jidian(a[num].getNetworkscore());
    c[3]=jidian(a[num].getDatabasescore());
    c[4]=jidian(a[num].getSoftwarescore());
    b2=(c[0]+c[1]+c[2]+c[3]+c[4])/5;
    x3=1;
    System.out.println("*********************************");
    System.out.println(" 石家庄铁道大学软件工程系学生学籍管理系统2019版");
    System.out.println("\t学生考试成绩绩点计算界面");
    System.out.println("*********************************");
    System.out.print(" 学号:");
    System.out.println(a[num].getStunumber());
    System.out.print(" 姓名:");
    System.out.println(a[num].getName());
    System.out.print(" 1、高等数学成绩绩点:");
    System.out.println(c[0]);
    System.out.print(" 2、大学英语成绩绩点:");
    System.out.println(c[1]);
    System.out.print(" 3、计算机网络成绩绩点:");
    System.out.println(c[2]);
    System.out.print(" 4、数据库成绩绩点:");
    System.out.println(c[3]);
    System.out.print(" 5、软件工程成绩绩点:");
    System.out.println(c[4]);
    System.out.print(" 你的平均绩点为:");
    System.out.print(df.format(b2));
    System.out.println();
    if(b2>=2)System.out.println("你的学分绩点已达到毕业要求!");
    else System.out.println("你的学分绩点不满足毕业要求!");
    System.out.println("*********************************");
    System.out.println("是否返回主界面(Y/N)");
    while(z) {
    String a1 = scan.next();
    if(a1.equals("Y")) {
    break; }

    if(x3==0) {
    System.out.println("学号输入有误!");
    break;
    }

    }

    }
    break;
    }
    break;
    case 4:
    System.out.println("***********************************************************");
    System.out.println(" 谢谢使用石家庄铁道大学软件工程系学生学籍管理系统 2019 版 ");
    System.out.println(" 制作人:马苗苗 ");
    System.out.println(" ");
    System.out.println("***********************************************************");
    miao=false;
    break;
    default:
    System.out.println("错误信息请重新输入");
    break;
    }

    }
    }
    // TODO 自动生成的方法存根

    }

  • 相关阅读:
    WPF界面开发—看DevExpress如何实现对.NET Core 3.0中的VS集成
    Web UI开发神器—Kendo UI for jQuery数据管理之网格排序
    Winforms界面开发技巧大派送!看DevExpress控件如何居中Dock面板
    Windows 7正式停用,Windows 10 UWP v19.2控件工具更值得拥有
    创建用户:显示ERROR 1396 (HY000): Operation CREATE USER failed for ‘test’@’%’
    Django-搭建win7虚拟环境-virtualenv
    jvm01
    单点登录 https://www.cnblogs.com/scode2/p/8671073.html
    maven
    线程
  • 原文地址:https://www.cnblogs.com/mxk123456/p/123m.html
Copyright © 2011-2022 走看看