zoukankan      html  css  js  c++  java
  • Java测验1

    package test1;//信1805-1 张志流 20183638
    import java.util.Scanner;
    public class ScoreManagement
    {
    static double sj;
    static double yj;
    static double jj;
    static double gj;
    static double rj;
    static double pj;


    int i;
    public static void main(String args[])
    {

    zhujiemian();


    }
    public static void tuichujiemian()
    {
    System.out.println("***************************************************************");
    System.out.println(" 谢谢使用石家庄铁道大学软件工程系学生学籍管理系统 ");
    System.out.println(" 制作人:张志流 ");
    System.out.println("***************************************************************");
    }
    public static void zhujiemian()
    {
    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("***************************************************************");
    ScoreInformatio stu1[]=new ScoreInformatio [5];
    stu1[0].name="张志流";
    stu1[0].stunumber="20183638";
    stu1[0].mathematicsscore=0.0;
    stu1[0].englishiscore=0.0;
    stu1[0].networkscore=0.0;
    stu1[0].databasescore=0.0;
    stu1[0].softwarescore=0.0;

    Scanner input=new Scanner(System.in);
    int j=input.nextInt();
    int i;

    switch(j)
    {
    case 1:chengjilurujiemain();
    String number=input.next();
    if(number==stu1[0].stunumber);
    {
    chengjilurujiemianer();
    System.out.println(" 请输入高数成绩: ");
    stu1[0].mathematicsscore=input.nextInt();
    chengjilurujiemianer();
    System.out.println(" 高数成绩为"+stu1[0].mathematicsscore+" ");
    System.out.println(" 请输入大学英语成绩: ");
    stu1[0].englishiscore=input.nextInt();
    chengjilurujiemianer();
    System.out.println(" 高数成绩为"+stu1[0].mathematicsscore+" ");
    System.out.println(" 大学英语成绩为"+stu1[0].englishiscore+" ");
    if(stu1[0].networkscore==0.0)
    System.out.println(" 请输入计算机网络成绩: ");
    stu1[0].networkscore=input.nextInt();
    chengjilurujiemianer();
    System.out.println(" 高数成绩为"+stu1[0].mathematicsscore+" ");
    System.out.println(" 大学英语成绩为"+stu1[0].englishiscore+" ");
    System.out.println(" 计算机网络成绩为"+stu1[0].networkscore+" ");
    System.out.println(" 请输入数据结构成绩: ");
    stu1[0].databasescore=input.nextInt();
    chengjilurujiemianer();
    System.out.println(" 高数成绩为"+stu1[0].mathematicsscore+" ");
    System.out.println(" 大学英语成绩为"+stu1[0].englishiscore+" ");
    System.out.println(" 计算机网络成绩为"+stu1[0].networkscore+" ");
    System.out.println(" 数据结构成绩为"+stu1[0].databasescore+" ");
    System.out.println(" 请输入软件工程成绩: ");
    stu1[0].softwarescore=input.nextInt();
    chengjilurujiemianer();
    System.out.println(" 高数成绩为"+stu1[0].mathematicsscore+" ");
    System.out.println(" 大学英语成绩为"+stu1[0].englishiscore+" ");
    System.out.println(" 计算机网络成绩为"+stu1[0].networkscore+" ");
    System.out.println(" 数据结构成绩为"+stu1[0].databasescore+" ");
    System.out.println(" 软件工程成绩为"+stu1[0].softwarescore+" ");
    System.out.println(" 该同学成绩录入完毕,是否提交(Y/N) ");
    System.out.println("****************************************************************");

    sj=jidian(stu1[0].mathematicsscore);
    yj=jidian(stu1[0].englishiscore);
    jj=jidian(stu1[0].networkscore);
    gj=jidian(stu1[0].databasescore);
    rj=jidian(stu1[0].softwarescore);
    double pjj=(stu1[0].mathematicsscore*4+stu1[0].englishiscore*3+stu1[0].networkscore*4+stu1[0].databasescore*3+stu1[0].softwarescore*2)/16;
    pj=jidian(pjj);
    }
    xuanze();
    break;
    case 2:xiugaichengji();
    i=input.nextInt();
    switch(i)
    {
    case 1: System.out.println(" 请输入修改后的高等数学成绩: ");
    stu1[0].mathematicsscore=input.nextInt();
    break;
    case 2: System.out.println(" 请输入修改后的大学英语成绩: ");
    stu1[0].englishiscore=input.nextInt();
    break;
    case 3: System.out.println(" 请输入修改后的计算机网络成绩: ");
    stu1[0].networkscore=input.nextInt();
    break;
    case 4: System.out.println(" 请输入修改后的数据结构成绩: ");
    stu1[0].databasescore=input.nextInt();
    break;
    case 5: System.out.println(" 请输入修改后的软件工程成绩: ");
    stu1[0].softwarescore=input.nextInt();
    break;
    }
    chengjilurujiemianer();
    System.out.println(" 高数成绩为"+stu1[0].mathematicsscore+" ");
    System.out.println(" 大学英语成绩为"+stu1[0].englishiscore+" ");
    System.out.println(" 计算机网络成绩为"+stu1[0].networkscore+" ");
    System.out.println(" 数据结构成绩为"+stu1[0].databasescore+" ");
    System.out.println(" 软件工程成绩为"+stu1[0].softwarescore+" ");
    System.out.println(" 该同学成绩录入完毕,是否提交(Y/N) ");
    System.out.println("****************************************************************");
    xuanze();
    break;
    case 3:


    chengjijidian();
    xuanze();
    break;
    case 4:
    tuichujiemian();
    break;



    }
    }
    public static void chengjilurujiemain()
    {
    System.out.println("***************************************************************");
    System.out.println(" 石家庄铁道大学软件工程系学生学籍管理系统2019版 ");
    System.out.println(" 学生考试成绩录入 ");
    System.out.println("***************************************************************");
    System.out.println(" 请输入学生学号: ");
    System.out.println("***************************************************************");
    }
    public static void chengjilurujiemianer()
    {
    System.out.println("***************************************************************");
    System.out.println(" 石家庄铁道大学软件工程系学生学籍管理系统2019版 ");
    System.out.println(" 学生考试成绩录入 ");
    System.out.println("***************************************************************");
    System.out.println(" 考生学号:"+ScoreInformatio.stunumber+" ");
    System.out.println(" 考生姓名:"+ScoreInformatio.name+" ");
    System.out.println("****************************************************************");

    }
    public static void chengjijidian()
    {
    System.out.println("****************************************************************");
    System.out.println(" 石家庄铁道大学软件工程系学生学籍管理系统2019版 ");
    System.out.println(" 学生考试成绩绩点计算界面 ");
    System.out.println("****************************************************************");
    System.out.println(" 考生学号:"+ScoreInformatio.stunumber+" ");
    System.out.println(" 考生姓名:"+ScoreInformatio.name+" ");
    System.out.println(" 1、高等数学成绩绩点:"+sj+" ");
    System.out.println(" 2、大学英语成绩绩点:"+yj+" ");
    System.out.println(" 3、计算机网络成绩绩点:"+jj+" ");
    System.out.println(" 4、数据结构成绩绩点:"+gj+" ");
    System.out.println(" 5、软件工程成绩绩点:"+rj+" ");
    System.out.println(" 你的平均学分绩点为:"+pj+" ");
    if(pj>=2)
    System.out.println(" 提示信息:你的学分绩点已达到毕业要求! ");
    else
    System.out.println(" 提示信息:你的学分绩点不满足毕业要求! ");
    System.out.println(" 是否返回系统主页面:(Y/N) ");
    System.out.println("*****************************************************************");
    }
    public static void xiugaichengji()
    {
    System.out.println("*****************************************************************");
    System.out.println(" 石家庄铁道大学软件工程系学生学籍管理系统2019版 ");
    System.out.println(" 学生考试成绩录入界面 ");
    System.out.println("******************************************************************");
    System.out.println(" 考生学号:"+ScoreInformatio.stunumber+" ");
    System.out.println(" 考生姓名:"+ScoreInformatio.name+" ");

    }
    public static double jidian(double n)
    {
    double s=0;
    if(n<60)
    s=0;
    else if(n>=60&&n<63.5)
    s=1.0;
    else if(n>=64&&n<65.9)
    s=1.5;
    else if(n>=66&&n<67.9)
    s=1.7;
    else if(n>=68&&n<71.5)
    s=2.0;
    else if(n>=72&&n<74.5)
    s=2.3;
    else if(n>=75&&n<77.9)
    s=2.7;
    else if(n>=78&&n<81.9)
    s=3.0;
    else if(n>=82&&n<84.5)
    s=3.3;
    else if(n>=85&&n<89.9)
    s=3.7;
    else if(n>=90)
    s=4.0;
    return s;
    }
    public static void xuanze()
    {
    String c;
    Scanner input=new Scanner(System.in);
    c=input.next();
    char x=c.charAt(0);
    if(x=='Y')
    zhujiemian();
    else if(x=='N');


    }

    }

    package test1;//信1805-1 张志流 20183638
    import java.util.Scanner;
    public class ScoreManagement
    {
    static double sj;
    static double yj;
    static double jj;
    static double gj;
    static double rj;
    static double pj;


    int i;
    public static void main(String args[])
    {

    zhujiemian();


    }
    public static void tuichujiemian()
    {
    System.out.println("***************************************************************");
    System.out.println(" 谢谢使用石家庄铁道大学软件工程系学生学籍管理系统 ");
    System.out.println(" 制作人:张志流 ");
    System.out.println("***************************************************************");
    }
    public static void zhujiemian()
    {
    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("***************************************************************");
    ScoreInformatio stu1[]=new ScoreInformatio [5];
    stu1[0].name="张志流";
    stu1[0].stunumber="20183638";

    stu1[0].mathematicsscore=0.0;

    stu1[0].englishiscore=0.0;
    stu1[0].networkscore=0.0;
    stu1[0].databasescore=0.0;
    stu1[0].softwarescore=0.0;

    Scanner input=new Scanner(System.in);
    int j=input.nextInt();
    int i;

    switch(j)
    {
    case 1:chengjilurujiemain();
    String number=input.next();
    if(number==stu1[0].stunumber);
    {
    chengjilurujiemianer();
    System.out.println(" 请输入高数成绩: ");
    stu1[0].mathematicsscore=input.nextInt();
    chengjilurujiemianer();
    System.out.println(" 高数成绩为"+stu1[0].mathematicsscore+" ");
    System.out.println(" 请输入大学英语成绩: ");
    stu1[0].englishiscore=input.nextInt();
    chengjilurujiemianer();
    System.out.println(" 高数成绩为"+stu1[0].mathematicsscore+" ");
    System.out.println(" 大学英语成绩为"+stu1[0].englishiscore+" ");
    if(stu1[0].networkscore==0.0)
    System.out.println(" 请输入计算机网络成绩: ");
    stu1[0].networkscore=input.nextInt();
    chengjilurujiemianer();
    System.out.println(" 高数成绩为"+stu1[0].mathematicsscore+" ");
    System.out.println(" 大学英语成绩为"+stu1[0].englishiscore+" ");
    System.out.println(" 计算机网络成绩为"+stu1[0].networkscore+" ");
    System.out.println(" 请输入数据结构成绩: ");
    stu1[0].databasescore=input.nextInt();
    chengjilurujiemianer();
    System.out.println(" 高数成绩为"+stu1[0].mathematicsscore+" ");
    System.out.println(" 大学英语成绩为"+stu1[0].englishiscore+" ");
    System.out.println(" 计算机网络成绩为"+stu1[0].networkscore+" ");
    System.out.println(" 数据结构成绩为"+stu1[0].databasescore+" ");
    System.out.println(" 请输入软件工程成绩: ");
    stu1[0].softwarescore=input.nextInt();
    chengjilurujiemianer();
    System.out.println(" 高数成绩为"+stu1[0].mathematicsscore+" ");
    System.out.println(" 大学英语成绩为"+stu1[0].englishiscore+" ");
    System.out.println(" 计算机网络成绩为"+stu1[0].networkscore+" ");
    System.out.println(" 数据结构成绩为"+stu1[0].databasescore+" ");
    System.out.println(" 软件工程成绩为"+stu1[0].softwarescore+" ");
    System.out.println(" 该同学成绩录入完毕,是否提交(Y/N) ");
    System.out.println("****************************************************************");

    sj=jidian(stu1[0].mathematicsscore);
    yj=jidian(stu1[0].englishiscore);
    jj=jidian(stu1[0].networkscore);
    gj=jidian(stu1[0].databasescore);
    rj=jidian(stu1[0].softwarescore);
    double pjj=(stu1[0].mathematicsscore*4+stu1[0].englishiscore*3+stu1[0].networkscore*4+stu1[0].databasescore*3+stu1[0].softwarescore*2)/16;
    pj=jidian(pjj);
    }
    xuanze();
    break;
    case 2:xiugaichengji();
    i=input.nextInt();
    switch(i)
    {
    case 1: System.out.println(" 请输入修改后的高等数学成绩: ");
    stu1[0].mathematicsscore=input.nextInt();
    break;
    case 2: System.out.println(" 请输入修改后的大学英语成绩: ");
    stu1[0].englishiscore=input.nextInt();
    break;
    case 3: System.out.println(" 请输入修改后的计算机网络成绩: ");
    stu1[0].networkscore=input.nextInt();
    break;
    case 4: System.out.println(" 请输入修改后的数据结构成绩: ");
    stu1[0].databasescore=input.nextInt();
    break;
    case 5: System.out.println(" 请输入修改后的软件工程成绩: ");
    stu1[0].softwarescore=input.nextInt();
    break;
    }
    chengjilurujiemianer();
    System.out.println(" 高数成绩为"+stu1[0].mathematicsscore+" ");
    System.out.println(" 大学英语成绩为"+stu1[0].englishiscore+" ");
    System.out.println(" 计算机网络成绩为"+stu1[0].networkscore+" ");
    System.out.println(" 数据结构成绩为"+stu1[0].databasescore+" ");
    System.out.println(" 软件工程成绩为"+stu1[0].softwarescore+" ");
    System.out.println(" 该同学成绩录入完毕,是否提交(Y/N) ");
    System.out.println("****************************************************************");
    xuanze();
    break;
    case 3:


    chengjijidian();
    xuanze();
    break;
    case 4:
    tuichujiemian();
    break;



    }
    }
    public static void chengjilurujiemain()
    {
    System.out.println("***************************************************************");
    System.out.println(" 石家庄铁道大学软件工程系学生学籍管理系统2019版 ");
    System.out.println(" 学生考试成绩录入 ");
    System.out.println("***************************************************************");
    System.out.println(" 请输入学生学号: ");
    System.out.println("***************************************************************");
    }
    public static void chengjilurujiemianer()
    {
    System.out.println("***************************************************************");
    System.out.println(" 石家庄铁道大学软件工程系学生学籍管理系统2019版 ");
    System.out.println(" 学生考试成绩录入 ");
    System.out.println("***************************************************************");
    System.out.println(" 考生学号:"+ScoreInformatio.stunumber+" ");
    System.out.println(" 考生姓名:"+ScoreInformatio.name+" ");
    System.out.println("****************************************************************");

    }
    public static void chengjijidian()
    {
    System.out.println("****************************************************************");
    System.out.println(" 石家庄铁道大学软件工程系学生学籍管理系统2019版 ");
    System.out.println(" 学生考试成绩绩点计算界面 ");
    System.out.println("****************************************************************");
    System.out.println(" 考生学号:"+ScoreInformatio.stunumber+" ");
    System.out.println(" 考生姓名:"+ScoreInformatio.name+" ");
    System.out.println(" 1、高等数学成绩绩点:"+sj+" ");
    System.out.println(" 2、大学英语成绩绩点:"+yj+" ");
    System.out.println(" 3、计算机网络成绩绩点:"+jj+" ");
    System.out.println(" 4、数据结构成绩绩点:"+gj+" ");
    System.out.println(" 5、软件工程成绩绩点:"+rj+" ");
    System.out.println(" 你的平均学分绩点为:"+pj+" ");
    if(pj>=2)
    System.out.println(" 提示信息:你的学分绩点已达到毕业要求! ");
    else
    System.out.println(" 提示信息:你的学分绩点不满足毕业要求! ");
    System.out.println(" 是否返回系统主页面:(Y/N) ");
    System.out.println("*****************************************************************");
    }
    public static void xiugaichengji()
    {
    System.out.println("*****************************************************************");
    System.out.println(" 石家庄铁道大学软件工程系学生学籍管理系统2019版 ");
    System.out.println(" 学生考试成绩录入界面 ");
    System.out.println("******************************************************************");
    System.out.println(" 考生学号:"+ScoreInformatio.stunumber+" ");
    System.out.println(" 考生姓名:"+ScoreInformatio.name+" ");

    }
    public static double jidian(double n)
    {
    double s=0;
    if(n<60)
    s=0;
    else if(n>=60&&n<63.5)
    s=1.0;
    else if(n>=64&&n<65.9)
    s=1.5;
    else if(n>=66&&n<67.9)
    s=1.7;
    else if(n>=68&&n<71.5)
    s=2.0;
    else if(n>=72&&n<74.5)
    s=2.3;
    else if(n>=75&&n<77.9)
    s=2.7;
    else if(n>=78&&n<81.9)
    s=3.0;
    else if(n>=82&&n<84.5)
    s=3.3;
    else if(n>=85&&n<89.9)
    s=3.7;
    else if(n>=90)
    s=4.0;
    return s;
    }
    public static void xuanze()
    {
    String c;
    Scanner input=new Scanner(System.in);
    c=input.next();
    char x=c.charAt(0);
    if(x=='Y')
    zhujiemian();
    else if(x=='N');


    }

    }

  • 相关阅读:
    6-MySQL-Ubuntu-操作数据表的基本操作(一)
    5-MySQL-Ubuntu-操作数据库的基本操作语句
    11-Ubuntu-根目录下各目录的功能详细介绍
    4-Ubuntu-启动/关闭/重启mysql服务
    3-Windows-CMD启动mysql服务-连接本地mysql服务-连接远程mysql服务
    2-Ubuntu命令安装mysql服务器和客户端及安装后的简单验证操作
    1-Navicat无法远程连接Ubuntu上的MySQL(已解决)
    10-python基础—索引与切片总结
    Useful Things To Know About Machine Learning (机器学习中一些有用的知识)
    How to Use the TimeDistributed Layer for Long Short-Term Memory Networks in Python 译文
  • 原文地址:https://www.cnblogs.com/zl00/p/11515575.html
Copyright © 2011-2022 走看看