Java Student Achievement Point Management System

I. Java Test Questions
Data structure requirements: (5 points)
1. Define the ScoreInformation class, which includes seven private variables (stunumber, name, mathematical core, englishiscore, network score, database core, software core).
Members have the following meanings:
The variable stunumber is String of string type, which is used to store the student's school number (consisting of eight digits).
The variable name is String of string type, which is used to store the name of the student.
The variable mathematicsscore is of double type, which is used to store students'achievements in higher mathematics. The score of higher mathematics is 4 points.
The variable englishiscore is of double type and is used to store students'College English scores. The score of College English is 3.
The variable networkscore is of double type, which is used to store students'computer network scores. The score of computer network is 4 points.
The variable database core is of double type, which is used to store students'database scores. The credit of the database is 3 points.
The variable software core is of double type, which is used to store students'software engineering scores. The credit of software engineering is 2 points.
Define the methods of get () (read variable information) and set () (set variable information) for each variable.
2. The initial value assignment method includes seven parameters, which are used to assign variables (stunumber, name, mathematics core, englishiscore, network score, database core, software core).
3. Functional requirements: (10 points)
The system completes the simple functions of input, modification, calculation of credit points and inquiry of students'scores, and defines Score Management class to accomplish the following functions.
1. Use arrays to store at least five students'information; (Take the information of candidates as the first record). (1 points)
2. The main interface of the student achievement management system is as follows: (1)
(1) Interface requirements; (0.5 points)

Department of Software Engineering, Shijiazhuang Railway University
Student Status Management System 2019 Edition

1. Entry of students'examination results
2. Modification of Students'Examination Achievements
3. Calculating the Achievement Points of Students
4. Quitting Student Status Management System

(2) Function description: Input digits 1-4 perform corresponding functions, input other digit prompt error information (this option does not exist), and return to the main interface. (0.5 points)
2. Operational process of score entry function: (3 points)
(1) After selecting the score entry function in the main interface, enter the score entry interface, as shown in the following figure: (0.5 points)

Student Status Management System of Software Engineering Department of Shijiazhuang Railway University 2019 Edition
Entry of Students'Examination Achievements

Please enter student number: XXXXXXXX

The user is prompted to enter an eight-digit number.
(2) After the user enters the student number, the user's student number and name are displayed. If the user's student number does not exist or the information error prompts the wrong information (the student number does not exist), the user returns to the score entry interface. (0.5 points)
(3) The user input the student number correctly as shown in the following figure:

Student Status Management System of Software Engineering Department of Shijiazhuang Railway University 2019 Edition
Entry Interface of Students'Examination Scores

Student number: 20180001
Student Name: XXX
Please enter the score of Advanced Mathematics: XXX

The user is prompted to input the results of advanced mathematics and the correct number; the user is prompted to input the results of College English, and the user is prompted to input the results of computer network, database and software engineering by analogy. When the user has recorded all the results on page 3, the following interface is displayed. (1.5 points)

Student Status Management System of Software Engineering Department of Shijiazhuang Railway University 2019 Edition
Entry of Students'Examination Achievements

Student number: 20180001
Student Name: XXX
Advanced Mathematics Achievements: XXX
College English Achievement: XXX
Computer Network Achievements: XXX
Database Achievements: XXX
Software Engineering Achievements: XXX
The student's grades have been entered and submitted (Y/N)

Select "Y" to save the input results into the corresponding array and return to the main interface. Select "N", then ignore the above-mentioned score entry, and return to the score entry interface. (0.5 points)
3. Operating process of performance modification function: (2 points)
(1) After choosing the performance modification function in the main interface, enter the examination result modification interface, as shown in the following figure:

Student Status Management System of Software Engineering Department of Shijiazhuang Railway University 2019 Edition
Modification Interface of Students'Examination Scores

Please enter student number: XXXXXXXX

The user is prompted to enter an eight-digit number. (0.5 points)
(2) After the user enters the student number, the user's student number, name and all the results information are displayed, as shown in the following figure.

Student Status Management System of Software Engineering Department of Shijiazhuang Railway University 2019 Edition
Entry of Students'Examination Achievements

Student number: 20180001
Student Name: XXX
1. Achievements in Higher Mathematics: XXX
2. College English Achievement: XXX
3. Computer Network Achievements: XXX
4. Database Achievements: XXX
5. Software Engineering Achievements: XXX

If the user's student number does not exist or the information error prompts the error message (the student number does not exist), and return to the score modification interface. (0.5 points)
(3) The user chooses the corresponding number key and switches to the following interface (if the number "5" is selected). (0.5 points)

Student Status Management System of Software Engineering Department of Shijiazhuang Railway University 2019 Edition
Entry Interface of Students'Examination Scores

Student number: 20180001
Student Name: XXX
Please enter the revised software engineering results: XXX

Enter the revised results into the next step.

Student Status Management System of Software Engineering Department of Shijiazhuang Railway University 2019 Edition
Entry of Students'Examination Achievements

Student number: 20180001
Student Name: XXX
1. Achievements in Higher Mathematics: XXX
2. College English Achievement: XXX
3. Computer Network Achievements: XXX
4. Database Achievements: XXX
5. Software Engineering Achievements: XXX
The student's grade has been revised and submitted (Y/N)

Select "Y" to save the revised results in the corresponding array and return to the main interface. Select "N", then ignore the above results, and return to the performance modification interface. (0.5 points)
3. Functional operation flow of calculating students'score points: (2 points)
(1) After choosing the function of calculating students'achievement points in the main interface, enter the interface of calculating students' achievement points, as shown in the following figure:

Student Status Management System of Software Engineering Department of Shijiazhuang Railway University 2019 Edition
Interface for calculating students'test scores

Please enter student number: XXXXXXXX

Page 6 contains eight pages, prompting the user to enter an eight-digit number.
(2) After the user enters the student number, the user's student number, name, credit score point and prompt information are displayed. As shown in the figure below. (1.5 points)

Student Status Management System of Software Engineering Department of Shijiazhuang Railway University 2019 Edition
Interface for calculating students'test scores

Student number: 20180001
Student Name: XXX
1. Achievement Points of Higher Mathematics: XXX
2. College English Achievement Points: XXX
3. Computer Network Achievement Points: XXX
4. Database Achievement Points: XXX
5. Achievement Points of Software Engineering: XXX
Your average credit score is XXX.
Tips: XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX
Whether to return to the main interface of the system: (Y/N)

If the credit score point is greater than or equal to 2, the prompt message shows that "your credit score point has met the graduation requirements!" ;
If the credit score point is less than 2, the prompt message shows that "your credit score point does not meet the graduation requirements!"
Credit points calculation method:
(1) Percentage system corresponds to achievement points
Scores (>90 85-89.9 82-84.9 78-81.9 75-77.9 72-74.9 68-71.9 66-67.9 64-65.9 60-63.9<60)
Achievement point 4.03.7 3.3 3.0 2.7 2.3 2.0 1.7 1.51.0
(2) Average Credit Calculating Method
Average Credit Achievement Point=(Course Achievement Point *Course Credit)/Course Credit
The average score points are calculated according to the principle of rounding, and two valid figures are reserved after decimal points.
(3) Choose "Y" to return to the main interface of the system. Select "N", no operation. (0.5 points)
4. The user chooses the number "4" to display the following interface and exit the current program. (1 points)

Thank you for using Shijiazhuang Railway University Software Engineering Department Student Status Management System version 2019
Producer: Candidate Name

The following is the realization part:

public class ScoreInformation {
    private String stunumber;
    private String name;
    private double mathematicsscore;
    private double englishiscore;
    private double networkscore;
    private double databasescore;
    private double softwarescore;
    //Define the methods to get () (read variable information) and set () (set variable information)
    public void setStunumber(String stunumber) {
        this.stunumber=stunumber;
    }
    public String getStunumber() {
        return stunumber;
    }
    public void setName(String name) {
        this.name=name;
    }
    public String getName() {
        return name;
    }
    public void setMathematicsscore(double mathematicsscore) {
        this.mathematicsscore=mathematicsscore;
    }
    public double getMathematicsscore() {
        return mathematicsscore;
    }
    public void setEnglishiscore(double englishiscore) {
        this.englishiscore=englishiscore;
    }
    public double getEnglishiscore() {
        return englishiscore;
    }
    public void setNetworkscore(double networkscore) {
        this.networkscore=networkscore;
    }
    public double getNetworkscore() {
        return networkscore;
    }
    public void setDatabasescore(double databasescore) {
        this.databasescore=databasescore;
    }
    public double getDatabasescore() {
        return databasescore;
    }
    public void setSoftwarescore(double softwarescore) {
        this.softwarescore=softwarescore;
    }
    public double getSoftwarescore() {
        return softwarescore;
    }
    public ScoreInformation(String stunumber,String name,double mathematicsscore,double englishiscore,double networkscore,double databasescore,double softwarescore) {
        this.stunumber=stunumber;
        this.name=name;
        this.mathematicsscore=mathematicsscore;
        this.englishiscore=englishiscore;
        this.networkscore=networkscore;
        this.databasescore=databasescore;
        this.softwarescore=softwarescore;
    }
//    public static void main(String[] args) {
//        Score Information text = new Score Information ("20183566", "Dong'ao", 1,2,3,4,5);
//        System.out.println(text.getDatabasescore());
//        System.out.println(text.getEnglishiscore());
//        System.out.println(text.getMathematicsscore());
//        System.out.println(text.getStunumber());
//    }
}
import java.util.Scanner;
public class ScoreManagement {
    static ScoreInformation Score1=new ScoreInformation("20180001","Name 1",0,0,0,0,0);
    static ScoreInformation Score2=new ScoreInformation("20180002","Name 2",0,0,0,0,0);
    static ScoreInformation Score3=new ScoreInformation("20180003","Name 3",0,0,0,0,0);
    static ScoreInformation Score4=new ScoreInformation("20180004","Name 4",0,0,0,0,0);
    static ScoreInformation Score5=new ScoreInformation("20180005","Name 5",0,0,0,0,0);
    static Scanner in=new Scanner(System.in);
    public static void menu(){
        System.out.println("***********************************************************");
        System.out.println("                                      Department of Software Engineering, Shijiazhuang Railway University");
        System.out.println("                                      Student Status Management System 2019 Edition");
        System.out.println("***********************************************************");
        System.out.println("                1, Entry of Students'Examination Achievements");
        System.out.println("                2, Revision of Students'Examination Achievements");
        System.out.println("                3, Calculating student achievement points");
        System.out.println("                4,Quitting Student Status Management System");
        System.out.println("**********************************************************");
        System.out.print("Please input:");
    }
    public static void totalMenu() {//General menu
        int anss=0;
        while(anss!=4) {
            menu();
            anss=in.nextInt();
            if(anss==1) addScore();
            else if(anss==2) modifyScore();
            else if(anss==3) caculateScore();
            else if(anss==4);
            else 
                System.out.println("This option does not exist");
        }
        System.out.println("Exit successfully");
        System.out.println("***********************************************************\r\n" + 
                "Thank you for using Shijiazhuang Railway University Software Engineering Department Student Status Management System version 2019\r\n" +
                "***********************************************************");
    }
    public static void addMenu() {
        System.out.println("***********************************************************");
        System.out.println("              Student Status Management System of Software Engineering Department of Shijiazhuang Railway University 2019 Edition");
        System.out.println("                                    Entry of Students'Examination Achievements");
        System.out.println("***********************************************************");
        System.out.print("                                    Please enter the student number:");
    }
    public static void addInterface(ScoreInformation h) {//Input Score Interface
        System.out.println("***********************************************************");
        System.out.println("                  Student Status Management System of Software Engineering Department of Shijiazhuang Railway University 2019 Edition");
        System.out.println("                                          Entry Interface of Students'Examination Scores");
        System.out.println("***********************************************************");
        System.out.println("Student number:"+h.getStunumber());
        System.out.println("Name of student:"+h.getName());
        System.out.println("Please enter the results of advanced mathematics:");
        double ans1=in.nextDouble();
        System.out.println("Please enter your college English scores:");
        double ans2=in.nextDouble();
        System.out.println("Please enter the computer network score:");
        double ans3=in.nextDouble();
        System.out.println("Please enter the database score:");        
        double ans4=in.nextDouble();
        System.out.println("Please enter the results of software engineering:");
        double ans5=in.nextDouble();    
        System.out.println("***********************************************************");
        System.out.println("                  Student Status Management System of Software Engineering Department of Shijiazhuang Railway University 2019 Edition");
        System.out.println("                                          Entry Interface of Students'Examination Scores");
        System.out.println("***********************************************************");
        System.out.println("Student number:"+h.getStunumber());
        System.out.println("Name of student:"+h.getName());
        System.out.println("Higher Mathematics Achievements:"+ans1);
        System.out.println("College English Achievements:"+ans2);
        System.out.println("Computer Network Achievements:"+ans3);
        System.out.println("Database Achievements:"+ans4);
        System.out.println("Software Engineering Achievements:"+ans5);
        System.out.print("The student's grade has been entered, whether to submit it it or not( Y/N)");
        String a=in.next();
        char s=a.charAt(0);
        if(s=='Y'||s=='y') {
            h.setMathematicsscore(ans1);        
            h.setEnglishiscore(ans2);    
            h.setNetworkscore(ans3);
            h.setDatabasescore(ans4);
            h.setSoftwarescore(ans5);
        }
        else
            addScore();
    }
    public static void addScore() {//Entry results
        boolean flag=true;
        while(flag) {
            addMenu();
            String ans=in.next();//Save the input student number in ans
            if(ans.equals(Score1.getStunumber())) {//Check that ans is equal to that Score
                addInterface(Score1);
                flag=false;
            }
            else if(ans.equals(Score2.getStunumber())) {
                addInterface(Score2);
                flag=false;
            }
            else if(ans.equals(Score3.getStunumber())) {
                addInterface(Score3);
                flag=false;
            }
            else if(ans.equals(Score4.getStunumber())) {
                addInterface(Score4);
                flag=false;
            }
            else if(ans.equals(Score5.getStunumber())) {
                addInterface(Score5);
                flag=false;
            }
            else 
                System.out.println("The number does not exist 1");
        }
    }
    public static void modifyMenu() {
        System.out.print("***********************************************************\r\n" + 
                "                        Student Status Management System of Software Engineering Department of Shijiazhuang Railway University 2019 Edition\r\n" + 
                "                                              Modification Interface of Students'Examination Scores\r\n" + 
                "***********************************************************\r\n" + 
                "Please enter the student number:");        
    }
    public static void modifyInterface(ScoreInformation h) {
        System.out.print("***********************************************************\r\n" + 
                "                        Student Status Management System of Software Engineering Department of Shijiazhuang Railway University 2019 Edition\r\n" + 
                "                                             Entry of Students'Examination Achievements\r\n" + 
                "***********************************************************\r\n" + 
                "Student number:"+h.getStunumber()+"\r\n" + 
                "Name of student:"+h.getName()+"\r\n" + 
                "1,Higher Mathematics Achievements:"+h.getMathematicsscore()+"\r\n" + 
                "2,College English Achievements:"+h.getEnglishiscore()+"\r\n" + 
                "3,Computer Network Achievements:"+h.getNetworkscore()+"\r\n" + 
                "4,Database Achievements:"+h.getDatabasescore()+"\r\n" + 
                "5,Software Engineering Achievements:"+h.getSoftwarescore()+"\r\n" + 
                "**********************************************************");
        System.out.println("Please choose to modify:");
        int ans=in.nextInt();//record number
        double cmp;//Record the next input
        String s;
        char a;
        switch(ans) {
        case 1:
            System.out.print("***********************************************************\r\n" + 
                    "                         Student Status Management System of Software Engineering Department of Shijiazhuang Railway University 2019 Edition\r\n" + 
                    "                                              Entry Interface of Students'Examination Scores\r\n" + 
                    "***********************************************************\r\n" + 
                    "Student number:"+h.getStunumber()+"\r\n" + 
                    "Name of student:"+h.getName()+"\r\n" + 
                    "Please enter the revised higher mathematics scores:");
            cmp=in.nextDouble();
            System.out.println("***********************************************************\r\n" + 
                    "                         Student Status Management System of Software Engineering Department of Shijiazhuang Railway University 2019 Edition\r\n" + 
                    "                                              Entry of Students'Examination Achievements\r\n" + 
                    "***********************************************************\r\n" + 
                    "Student number:"+h.getStunumber()+"\r\n" + 
                    "Name of student:"+h.getName()+"\r\n" + 
                    "1,Higher Mathematics Achievements:"+cmp+"\r\n" + 
                    "2,College English Achievements:"+h.getEnglishiscore()+"\r\n" + 
                    "3,Computer Network Achievements:"+h.getNetworkscore()+"\r\n" + 
                    "4,Database Achievements:"+h.getDatabasescore()+"\r\n" + 
                    "5,Software Engineering Achievements:"+h.getSoftwarescore()+"\r\n" + 
                    "Has the student's grade been revised and submitted?( Y/N)\r\n" + 
                    "**********************************************************");
            s=in.next();
            a=s.charAt(0);
            if(a=='Y'||a=='y') h.setMathematicsscore(cmp);
            break;
        case 2:
            System.out.print("***********************************************************\r\n" + 
                    "                           Student Status Management System of Software Engineering Department of Shijiazhuang Railway University 2019 Edition\r\n" + 
                    "                                              Entry Interface of Students'Examination Scores\r\n" + 
                    "*************1**********************************************\r\n" + 
                    "Student number:"+h.getStunumber()+"\r\n" + 
                    "Name of student:"+h.getName()+"\r\n" + 
                    "Please enter the revised College English scores:");
            cmp=in.nextDouble();
            System.out.println("***********************************************************\r\n" + 
                    "                           Student Status Management System of Software Engineering Department of Shijiazhuang Railway University 2019 Edition\r\n" + 
                    "                                              Entry of Students'Examination Achievements\r\n" + 
                    "***********************************************************\r\n" + 
                    "Student number:"+h.getStunumber()+"\r\n" + 
                    "Name of student:"+h.getName()+"\r\n" + 
                    "1,Higher Mathematics Achievements:"+h.getMathematicsscore()+"\r\n" + 
                    "2,College English Achievements:"+cmp+"\r\n" + 
                    "3,Computer Network Achievements:"+h.getNetworkscore()+"\r\n" + 
                    "4,Database Achievements:"+h.getDatabasescore()+"\r\n" + 
                    "5,Software Engineering Achievements:"+h.getSoftwarescore()+"\r\n" + 
                    "Has the student's grade been revised and submitted?( Y/N)\r\n" + 
                    "**********************************************************");
            s=in.next();
            a=s.charAt(0);
            if(a=='Y'||a=='y') h.setEnglishiscore(cmp);
            break;
        case 3:
            System.out.print("***********************************************************\r\n" + 
                    "                          Student Status Management System of Software Engineering Department of Shijiazhuang Railway University 2019 Edition\r\n" + 
                    "                                              Entry Interface of Students'Examination Scores\r\n" + 
                    "***********************************************************\r\n" + 
                    "Student number:"+h.getStunumber()+"\r\n" + 
                    "Name of student:"+h.getName()+"\r\n" + 
                    "Please enter the revised computer network results:");
            cmp=in.nextDouble();
            System.out.println("***********************************************************\r\n" + 
                    "                          Student Status Management System of Software Engineering Department of Shijiazhuang Railway University 2019 Edition\r\n" + 
                    "                                              Entry of Students'Examination Achievements\r\n" + 
                    "***********************************************************\r\n" + 
                    "Student number:"+h.getStunumber()+"\r\n" + 
                    "Name of student:"+h.getName()+"\r\n" + 
                    "1,Higher Mathematics Achievements:"+h.getMathematicsscore()+"\r\n" + 
                    "2,College English Achievements:"+h.getEnglishiscore()+"\r\n" + 
                    "3,Computer Network Achievements:"+cmp+"\r\n" + 
                    "4,Database Achievements:"+h.getDatabasescore()+"\r\n" + 
                    "5,Software Engineering Achievements:"+h.getSoftwarescore()+"\r\n" + 
                    "Has the student's grade been revised and submitted?( Y/N)\r\n" + 
                    "**********************************************************");
            s=in.next();
            a=s.charAt(0);
            if(a=='Y'||a=='y') h.setNetworkscore(cmp);
            break;
        case 4:
            System.out.print("***********************************************************\r\n" + 
                    "Student Status Management System of Software Engineering Department of Shijiazhuang Railway University 2019 Edition\r\n" + 
                    "Entry Interface of Students'Examination Scores\r\n" + 
                    "***********************************************************\r\n" + 
                    "Student number:"+h.getStunumber()+"\r\n" + 
                    "Name of student:"+h.getName()+"\r\n" + 
                    "Please enter the revised database score:");
            cmp=in.nextDouble();
            System.out.println("***********************************************************\r\n" + 
                    "Student Status Management System of Software Engineering Department of Shijiazhuang Railway University 2019 Edition\r\n" + 
                    "Entry of Students'Examination Achievements\r\n" + 
                    "***********************************************************\r\n" + 
                    "Student number:"+h.getStunumber()+"\r\n" + 
                    "Name of student:"+h.getName()+"\r\n" + 
                    "1,Higher Mathematics Achievements:"+h.getMathematicsscore()+"\r\n" + 
                    "2,College English Achievements:"+h.getEnglishiscore()+"\r\n" + 
                    "3,Computer Network Achievements:"+h.getNetworkscore()+"\r\n" + 
                    "4,Database Achievements:"+cmp+"\r\n" + 
                    "5,Software Engineering Achievements:"+h.getSoftwarescore()+"\r\n" + 
                    "Has the student's grade been revised and submitted?( Y/N)\r\n" + 
                    "**********************************************************");
            s=in.next();
            a=s.charAt(0);
            if(a=='Y'||a=='y') h.setDatabasescore(cmp);
            break;
        case 5:
            System.out.print("***********************************************************\r\n" + 
                    "Student Status Management System of Software Engineering Department of Shijiazhuang Railway University 2019 Edition\r\n" + 
                    "Entry Interface of Students'Examination Scores\r\n" + 
                    "***********************************************************\r\n" + 
                    "Student number:"+h.getStunumber()+"\r\n" + 
                    "Name of student:"+h.getName()+"\r\n" + 
                    "Please enter the revised software engineering results:");
            cmp=in.nextDouble();
            System.out.println("***********************************************************\r\n" + 
                    "Student Status Management System of Software Engineering Department of Shijiazhuang Railway University 2019 Edition\r\n" + 
                    "Entry of Students'Examination Achievements\r\n" + 
                    "***********************************************************\r\n" + 
                    "Student number:"+h.getStunumber()+"\r\n" + 
                    "Name of student:"+h.getName()+"\r\n" + 
                    "1,Higher Mathematics Achievements:"+h.getMathematicsscore()+"\r\n" + 
                    "2,College English Achievements:"+h.getEnglishiscore()+"\r\n" + 
                    "3,Computer Network Achievements:"+h.getNetworkscore()+"\r\n" + 
                    "4,Database Achievements:"+h.getDatabasescore()+"\r\n" + 
                    "5,Software Engineering Achievements:"+cmp+"\r\n" + 
                    "Has the student's grade been revised and submitted?( Y/N)\r\n" + 
                    "**********************************************************");
            s=in.next();
            a=s.charAt(0);
            if(a=='Y'||a=='y') h.setSoftwarescore(cmp);
            break;
        default:
            System.out.println("Input Number Error");
        }
    }
    public static void modifyScore() {//Revision of results
        boolean flag=true;
        while(flag) {
            modifyMenu();
            String ans=in.next();//Save the input student number in ans
            if(ans.equals(Score1.getStunumber())) {
                modifyInterface(Score1);
                flag=false;
            }
            else if(ans.equals(Score2.getStunumber())) {
                modifyInterface(Score2);
                flag=false;
            }
            else if(ans.equals(Score3.getStunumber())) {
                modifyInterface(Score3);
                flag=false;
            }
            else if(ans.equals(Score4.getStunumber())) {
                modifyInterface(Score4);
                flag=false;
            }
            else if(ans.equals(Score5.getStunumber())) {
                modifyInterface(Score5);
                flag=false;
            }
            else 
                System.out.println("The number does not exist 2");
        }
    }
    public static void caculateMenu() {
        System.out.println("***********************************************************\r\n" + 
                "Student Status Management System of Software Engineering Department of Shijiazhuang Railway University 2019 Edition\r\n" + 
                "Interface for calculating students'test scores\r\n" + 
                "***********************************************************\r\n" + 
                "Please enter the student number:");
    }
    public static void caculateInterface(ScoreInformation h) {
        double [] s=new double[5];//Store the achievements of 1-5 disciplines separately
        s[0]=h.getMathematicsscore();
        s[1]=h.getEnglishiscore();
        s[2]=h.getNetworkscore();
        s[3]=h.getDatabasescore();
        s[4]=h.getSoftwarescore();
        double[] result=new double[5];//Store achievement points of 1-5 disciplines separately
        double [] credit= {4,3,4,3,2};//Storage Sciences
        double sum=0;
        for (int i = 0; i < s.length; i++) {
            if(s[i]>=90) result[i]=4.0;
            else if(s[i]>=85&&s[i]<90) result[i]=3.7;
            else if(s[i]>=82&&s[i]<85) result[i]=3.3;
            else if(s[i]>=78&&s[i]<82) result[i]=3.0;
            else if(s[i]>=75&&s[i]<78) result[i]=2.7;
            else if(s[i]>=72&&s[i]<75) result[i]=2.3;
            else if(s[i]>=68&&s[i]<72) result[i]=2.0;
            else if(s[i]>=66&&s[i]<68) result[i]=1.7;
            else if(s[i]>=64&&s[i]<66) result[i]=1.5;
            else if(s[i]>=60&&s[i]<64) result[i]=1.0;
            else  result[i]=0;
            sum+=result[i]*credit[i];
        }
        sum/=5;
        boolean flag=true;
        if(sum<2)
            flag=false;
            System.out.print("***********************************************************\r\n" + 
                "Student Status Management System of Software Engineering Department of Shijiazhuang Railway University 2019 Edition\r\n" + 
                "Interface for calculating students'test scores\r\n" + 
                "***********************************************************\r\n" + 
                "Student number:"+h.getStunumber()+"\r\n" + 
                "Name of student:"+h.getName()+"\r\n" + 
                "1,Higher Mathematics Achievement Points:"+result[0]+"\r\n" + 
                "2,College English Achievement Points:"+result[1]+"\r\n" + 
                "3,Computer Network Achievement Points:"+result[2]+"\r\n" + 
                "4,Database Achievement Points:"+result[3]+"\r\n" + 
                "5,Software Engineering Achievement Points:"+result[4]+"\r\n" + 
                "Your average score point is:");
            System.out.println(String.format("%.2f", sum));    //The calculation results retain the last two decimal points
        if(flag)
                System.out.println("Tip: Your credit points have met the graduation requirements!");
        else
            System.out.println("Your credit points do not meet the graduation requirements!");

                System.out.println("Whether to return to the main interface of the system:( Y/N)");
                String a;
                char c='2';
                while(c!='Y'&&c!='y') {
                    a=in.next();
                    c=a.charAt(0);
                }
    }
    public static void caculateScore() {//Computational Credit Achievement Point
        boolean flag=true;
        while(flag) {
            caculateMenu();
            String ans=in.next();//Save the input student number in ans
            if(ans.equals(Score1.getStunumber())) {
                caculateInterface(Score1);
                flag=false;
            }
            else if(ans.equals(Score2.getStunumber())) {
                caculateInterface(Score2);
                flag=false;
            }
            else if(ans.equals(Score3.getStunumber())) {
                caculateInterface(Score3);
                flag=false;
            }
            else if(ans.equals(Score4.getStunumber())) {
                caculateInterface(Score4);
                flag=false;
            }
            else if(ans.equals(Score5.getStunumber())) {
                caculateInterface(Score5);
                flag=false;
            }
            else 
                System.out.println("The number does not exist 3");
        }
    }
    public static void main(String[] args) {
        totalMenu();
    }
}

Tags: Database network Java less

Posted on Wed, 11 Sep 2019 02:26:16 -0700 by timmerk