Java简单学生信息管理系统

JAVA简单写学生信息管理系统,实现学生信息的输入、查询、修改、删除操作
package Week;

import jdk.internal.util.xml.impl.Input;

import java.util.HashSet;
import java.util.Scanner;

public class StudentMs {
    Scanner sc = new Scanner(System.in);
    public int getID() {
        return ID;
    }

    public String getName() {
        return name;
    }

    public String getClassnum() {
        return classnum;
    }

    public int getTelephone() {
        return telephone;
    }

    public void setID(int ID) {
        this.ID = ID;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setClassnum(String classnum) {
        this.classnum = classnum;
    }

    public void setTelephone(int telephone) {
        this.telephone = telephone;
    }
    private int ID;
    private String name;
    private String classnum;
    private int telephone;

   /* public StudentMs(int ID, String name, String classnum, String telephone) {
        this.ID = ID;
        this.name = name;
        this.classnum = classnum;
        this.telephone = telephone;
    }*/

    public void add(StudentMs a){
        int ID1;
        String name2;
        String classnum1;
        int  telephone1;
            System.out.println("请输入你要添加的学生信息");
            System.out.println("请输出学生学号");
            ID1 =sc.nextInt();
            a.setID(ID1);
            System.out.println("请输出学生姓名");
            sc.nextLine();
            name2=sc.nextLine();
            a.setName(name2);
            System.out.println("请输出学生班级");
            classnum1=sc.nextLine();
            a.setClassnum(classnum1);
            System.out.println("请输出学生电话号码");
            telephone1=sc.nextInt();
            a.setTelephone(telephone1);
    }
    public int find(String[][] a)
    {
        System.out.println("请输入你要查询学生的学号");
        int n=-1;
        int id = sc.nextInt();
        for(int i=0;i=0){
                        System.out.println("学生学号为:"+student[m][0]);
                        System.out.println("学生姓名为:"+student[m][1]);
                        System.out.println("学生班级为:"+student[m][2]);
                        System.out.println("学生电话为:"+student[m][3]);
                    }else{
                        System.out.println("学号错误,未找到学生");
                        break;
                    }
                    break;
                }
                case 3:
                {
                    m=studentMs.recivice(student);
                    n=studentMs.Num();
                    System.out.println("请输入你要修改的内容:");
                    student[m][n]=sc.next();
                    System.out.println("修改成功!");
                    break;
                }
                case 4:
                {
                    m=studentMs.delay(student);
                    for(int i=0;i<4;i++)
                    {
                        student[m][i]=null;
                    }
                    System.out.println("已经成功删除学生信息");
                    break;
                }
                case 5:
                {
                    m=studentMs.delay(student);
                    System.out.println("学号"+student[m][0]+"的学生信息为:");
                    System.out.println("学生学号为:"+student[m][0]);
                    System.out.println("学生姓名为:"+student[m][1]);
                    System.out.println("学生班级为:"+student[m][2]);
                    System.out.println("学生电话为:"+student[m][3]);
                    break;
                }
                case 6:
                {
                    System.out.println("程序退出!");
                    flat=false;
                    break;
                }
            }
        }
    }
}

你可能感兴趣的:(Java简单学生信息管理系统)