java学生信息管理系统设计报告 第2页

java学生信息管理系统设计报告 第2页

for(int j=i;j<=79;j++)

              {

                     st[j]=new Student();

                     st[j].sign=-1;

                     n=n+1;

              }

              menu_select();

              xz();

       }

/*=======================================================================================================*/

/**************************************************菜单***************************************************/

/*=======================================================================================================*/

 转发请注明源于www.751com.cn

       public static void menu_select()

       {    

              System.out.printf("\t\t +***欢迎使用学生信息管理系统***+\n"); /*菜单选择*/

              System.out.print("\t\t | 1. 输入档案                   |\n");

              System.out.print("\t\t | 2. 显示所有档案            |\n");

              System.out.print("\t\t | 3. 删除档案                   |\n");

              System.out.print("\t\t | 4. 查询                   |\n");

              System.out.print("\t\t | 5. 排序                   |\n");

              System.out.print("\t\t | 6. 修改                   |\n");

              System.out.print("\t\t | 0. 退出                   |\n");

              System.out.print("\t\t +******************************+\n");

       }

       public static void xz()

       {

              while(true)

              {

                     System.out.print("请输入:");

                     try

                     {

                            BufferedReader Console=new BufferedReader(new InputStreamReader(System.in));

                            s=Console.readLine();

                            bh=Integer.parseInt(s);

                            break;

                     }

                     catch(Exception e)

                     {

                            System.out.print("你输入的有误,请输入(12345,,60)其中人一个\n");

                     }

              }

              switch(bh)

              {

                     case 0:break;

                     case 1:add();menu_select();xz();break;

                     case 2:showall();menu_select();xz();break;

                     case 3:del();menu_select();xz();break;

                     case 4:find();menu_select();xz();break;

                     case 5:Sort_by_num();menu_select();xz();break;

                     case 6:mod();menu_select();xz();break;

              }

       }

 

 

/*===========================================================================================================*/

/***************************************************输入档案**************************************************/

/*==========================================================================================================*/

 

       public  static void add()

       {

              int k;

              while(true)

              {

                     try

                     {

                            BufferedReader Console=new BufferedReader

                            st[i].sign=(int)(i+1);

                            System.out.println("请输入学号:");

                            st[i].num=Integer.parseInt(Console.readLine());

                            System.out.print("请输入姓名:");

                            s=Console.readLine();

                            st[i].name=s;

                            System.out.print("请输入籍贯:");

                                  

                            st[i].born_place=Console.readLine();

                            System.out.print("请输入性别:");

                            转发请注明源于www.751com.cn

                            st[i].sex=Console.readLine();

                            System.out.print("请输入成绩:");

                    

                            st[i].score=Integer.parseInt(Console.readLine());

                            i++;

                            System.out.print("是否继续输入?(y/n");

                            while(true)

                            {

                                   s=Console.readLine();

                                   if(!s.equals("y") && !s.equals("n"))

                                   {

                                          System.out.print("有错,请重新输入");

                                   }

                                   else

                     

                     }

              }

       }

/*=============================================================================================================================*/

/**********************************************************显示所有档案*********************************************************/

/*=============================================================================================================================*/

       public static void showall()

       {

              System.out.print("学号    姓名    性别    成绩   出生地           \n");

              for(int k=1;k<=79;k++)

                     if (st[k].sign!=-1)

                            {

上一页  [1] [2] [3] [4] 下一页

Copyright © 2007-2012 www.chuibin.com 六维论文网 版权所有