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

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

              System.out.println(st[k].num+"       "+st[k].name+"       "+st[k].sex+"       "+st[k].score+"       "+st[k].born_place+"\n");

                            }

       }

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

/**********************************************************删除档案*************************************************************/

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

       public static void del()

       {

              int j,k;

              String a;

              try

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

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

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

                     s_name=Console.readLine();

                     while(true)                  

                     {

                            System.out.print("确认删除?(y/n");

                            while(true)

                            {

                                   s=Console.readLine();

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

                                   {

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

                                   }

                                   else

                                   {

                                          break;

                                   }

                            }

                            if(s.equals("n"))

                            {

                                   break;

                            }

                            else if(s.equals("y"))

                            {

                                   System.out.print("信息删除!\n"); /*返回成功信息*/

                                   for(i=1;i<=n;i++)

                                   if((st[i].name).equals(s_name)==true) break;

                                   for(j=i;j<=n;j++)

                                   {

                                          k=st[j+1].num;

                                          st[j].num=k;

                                          a=st[j+1].name;

                                          st[j].name=a;

                                          a=st[j+1].born_place;

                                          st[j].born_place=a;

                                          a=st[j+1].sex;

                                          st[j].sex=a;

                                          k=st[j+1].score;

                                          st[j].score=k;

                                          break;

                                   }

                            break;

                            }

                            else

                            {

                                   break;

                            }                                

                     }

              }

              catch(Exception e) {System.out.print("错误!\n");}

       }

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

/**********************************************************查询档案*************************************************************/

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

       public static void find()

 

       {

              int j=0;   

              try

              {

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

                     while(true)

                     {

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

                            s_name=Console.readLine();

                            for(i=1;i<=n;i++)

                            if((st[i].name).equals(s_name)==true)

                            {

                                   j=i;                      

                                   show(j);

                                   break;

                            }

                            break;

                     }

              }

              catch(Exception e)

              {

                     System.out.print("无此信息或已被删除\n");

              }

       }

       public static boolean show(int a)

       {

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

              {

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

                     System.out.println(st[a].num+"      "+st[a].name+"         "+st[a].sex+"       "+st[a].score+"              "+st[

              }

 

       }

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

/**********************************************************修改信息*************************************************************/

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

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

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