2021.9.10考试

题目:学生毕业论文管理系统

代码实现:

package ScoreInformation;

public class ScoreInformation {

    private String stunumber;
    private String name;
    private String stuclass;
    private String papertitle;
    private String paperbody;
    private double paperpass;
    private boolean paperreview;

    public ScoreInformation() {
    }

    public ScoreInformation(String stunumber, String name, String stuclass, String papertitle, String paperbody, double paperpass, boolean paperreview) {
        this.stunumber = stunumber;
        this.name = name;
        this.stuclass = stuclass ;
        this.papertitle = papertitle;
        this.paperbody = paperbody;
        this.paperpass = paperpass;
        this.paperreview = paperreview;
    }

    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 String getStuclass() {
        return stuclass;
    }

    public void setStuclass(String stuclass) {
        this.stuclass = stuclass;
    }

    public String getPapertitle() {
        return papertitle;
    }

    public void setPapertitle(String papertitle) {
        this.papertitle = papertitle;
    }

    public String getPaperbody() {
        return paperbody;
    }

    public void setPaperbody(String paperbody) {
        this.paperbody = paperbody;
    }

    public double getPaperpass() {
        return paperpass;
    }

    public void setPaperpass(double paperpass) {
        this.paperpass = paperpass;
    }

    public boolean isPaperreview() {
        return paperreview;
    }

    public void setPaperreview(boolean paperreview) {
        this.paperreview = paperreview;
    }
}

package ScoreInformation;

import javax.lang.model.element.NestingKind;
import java.util.ArrayList;
import java.util.Scanner;

public class PaperManagement {

    public static void main(String[] args) {

        ArrayList<ScoreInformation> array = new ArrayList<>();

            ScoreInformation sc1 = new ScoreInformation();
            sc1.setName("宋浩伟"");
            sc1.setStunumber("20203956");
            sc1.setStuclass("信2005-3");

        ScoreInformation sc2 = new ScoreInformation();
        sc2.setName("小明");
        sc2.setStunumber("20203957");
        sc2.setStuclass("信2005-3");

        ScoreInformation sc3 = new ScoreInformation();
        sc3.setName("小亮");
        sc3.setStunumber("20203958");
        sc3.setStuclass("信2005-3");

        ScoreInformation sc4 = new ScoreInformation();
        sc4.setName("小王");
        sc4.setStunumber("20203959");
        sc4.setStuclass("信2005-3");

        ScoreInformation sc5 = new ScoreInformation();
        sc5.setName("小李");
        sc5.setStunumber("20203960");
        sc5.setStuclass("信2005-3");
        array.add(sc1);
        array.add(sc2);
        array.add(sc3);
        array.add(sc4);
        array.add(sc5);
        while (true) {

            Systemmain();

            System.out.println("请输入你的选择:");
            Scanner sc = new Scanner(System.in);
            int num = sc.nextInt();
            switch (num) {

                case 1:
                    addStudent(array);
                    break;
                case 2:
                    judgeScore(array);
                    break;
                case 3:
                    showScore(array);
                    break;
                case 4:
                    System.out.println("***********************************************************");
                    System.out.println("      石家庄铁道大学软件工程系毕业论文管理系统2021版");
                    System.out.println("                    制作人:宋浩伟");
                    System.out.println("***********************************************************");
                    System.exit(0);
                    break;


            }

        }



    }

    public static void Systemmain() {

        System.out.println("***********************************************************");
        System.out.println("                   石家庄铁道大学软件工程系");
        System.out.println("                  毕业设计论文管理系统2021版");
        System.out.println("***********************************************************");
        System.out.println("                    1、毕业设计论文提交");
        System.out.println("                    2。毕业设计论文查重");
        System.out.println("                    3。毕业设计论文审查");
        System.out.println("                    4。退出论文管理系统");
        System.out.println("***********************************************************");

    }

    public static void addStudent(ArrayList<ScoreInformation> array) {

        while (true) {
            System.out.println("***********************************************************");
            System.out.println("         石家庄铁道大学软件工程系毕业设计论文管理系统2021版");
            System.out.println("                              毕业设计论文提交");
            System.out.println("***********************************************************");

            System.out.println("                       请输入学生学号:");
            Scanner sc = new Scanner(System.in);
            String stunumber = sc.nextLine();

            int jadge = 0;
            for (int i = 0; i < array.size(); i++) {

                ScoreInformation st = array.get(i);
                if (stunumber.equals(st.getStunumber())) {

                    System.out.print("                     学生学号:");
                    System.out.println(st.getStunumber());

                    System.out.print("                     学生姓名:");
                    System.out.println(st.getName());

                    System.out.print("                     所在班级:");
                    System.out.println(st.getStuclass());

                    String str;
                    while (true) {
                        System.out.println("请输入毕业设计论文的题目:");
                         str = sc.nextLine();
                        if (str.length() < 10) {

                            break;
                        }else {

                            System.out.println("论文正文不符合要求。");
                        }

                    }

                    String str1;
                    while(true) {
                        System.out.println("请输入毕业设计论文正文");
                         str1 = sc.nextLine();

                        if (str1.length() <= 200) {
                            break;
                        }else {
                            System.out.println("论文正文不符合要求。");
                        }
                    }
                    System.out.println("该学生成绩已录入完毕,是否提交(Y/N)");
                    char s = sc.next().charAt(0);

                    if (s == 'Y') {
                        jadge = 1;
                        array.get(i).setPapertitle(str);
                        array.get(i).setPaperbody(str1);
                        break;
                    } else {
                        jadge = 2;
                        break;

                    }
                }
            }

            if(jadge == 2) {

            }
            if(jadge == 1) {

                return;
            }
            if(jadge == 0) {

                System.out.println("此学号不存在");

            }
        }

    }

    public static void judgeScore(ArrayList<ScoreInformation> array) {

        while (true) {
        System.out.println("***********************************************************");
        System.out.println("         石家庄铁道大学软件工程系毕业设计论文管理系统2021版");
        System.out.println("                              毕业设计论文提交");
        System.out.println("***********************************************************");

        System.out.println("                       请输入学生学号");
        Scanner sc = new Scanner(System.in);
        String stunumber = sc.nextLine();

        for (int i = 0; i < array.size(); i++) {
            ScoreInformation st = array.get(i);
            if (stunumber.equals(st.getStunumber())) {

                System.out.print("                     学生学号:");
                System.out.println(st.getStunumber());

                System.out.print("                    学生姓名:");
                System.out.println(st.getName());

                System.out.print("                    所在班级:");
                System.out.println(st.getStuclass());

                System.out.print("                       毕业设计论文题目:");
                System.out.println(st.getPapertitle());

                System.out.print("                    毕业设计论文正文:");
                System.out.println(st.getPaperbody());

                while (true) {
                System.out.println("请输入查重率:");
                double num = sc.nextDouble();

                if (num <= 20.0) {
                    array.get(i).setPaperpass(num);
                    break;

                } else {
                    System.out.println("查重率不符合,请重新输入。");

                }
            }


            }

            break;
        }

        System.out.println("(Y/N)");
        char s = sc.next().charAt(0);
        if(s == 'Y') {

       return;
        }else {


        }

    }
    }

    public static void showScore(ArrayList<ScoreInformation> array) {

        while (true) {
            System.out.println("***********************************************************");
            System.out.println("         石家庄铁道大学软件工程系毕业设计论文管理系统2021版");
            System.out.println("                             毕业设计论文提交");
            System.out.println("***********************************************************");

            System.out.println("                       请输入学生学号:");
            Scanner sc = new Scanner(System.in);
            String stunumber = sc.nextLine();

            int jadge = 0;
            for(int i = 0; i < array.size(); i++) {

                ScoreInformation st = array.get(i);
                if(stunumber.equals(st.getStunumber())) {
                    System.out.print("                    学生学号:");
                    System.out.println(st.getStunumber());

                    System.out.print("                     学生姓名:");
                    System.out.println(st.getName());

                    System.out.print("              所在班级");
                    System.out.println(st.getStuclass());

                    System.out.println("请输入毕业设计论文题目:");
                    System.out.println(st.getPapertitle());

                    System.out.println("请输入毕业设计论文正文:");
                    System.out.println(st.getPaperbody());
                    System.out.println("查重率:");
                    System.out.println(st.getPaperpass());

                    if(st.getPaperpass() > 20) {
                        jadge = 1;
                        System.out.println("该学生毕业设计论文重复率超过20%,不允许进行论文审查。");

                        break;
                    } else {

                        System.out.println("是否同意该学生参加毕业设计答辩:(Y/N)");
                        char s = sc.next().charAt(0);
                        if(s == 'Y') {
                            jadge = 2;
                            array.get(i).setPaperreview(true);
                         break;
                        }else {
                            jadge = 3;
                            array.get(i).setPaperreview(false);
                            break;
                        }
                    }

                }

            }

            if(jadge == 1) {

            }
            if(jadge == 2) {

            }
            if (jadge == 3) {
                return;
            }
        }
    }
}

posted @ 2021-09-18 22:33  听风1234  阅读(28)  评论(0编辑  收藏  举报