欧美色欧美亚洲高清在线观看,国产特黄特色a级在线视频,国产一区视频一区欧美,亚洲成a 人在线观看中文

  1. <ul id="fwlom"></ul>

    <object id="fwlom"></object>

    <span id="fwlom"></span><dfn id="fwlom"></dfn>

      <object id="fwlom"></object>

      個(gè)人通訊錄管理系統(tǒng),java源代碼

      時(shí)間:2019-05-14 04:55:34下載本文作者:會員上傳
      簡介:寫寫幫文庫小編為你整理了多篇相關(guān)的《個(gè)人通訊錄管理系統(tǒng),java源代碼》,但愿對你工作學(xué)習(xí)有幫助,當(dāng)然你在寫寫幫文庫還可以找到更多《個(gè)人通訊錄管理系統(tǒng),java源代碼》。

      第一篇:個(gè)人通訊錄管理系統(tǒng),java源代碼

      package cn.pab.manager;

      import java.util.List;import java.util.Scanner;

      import cn.pab.dao.PersonDao;import cn.pab.dao.TypeDao;import cn.pab.dao.UserDao;import cn.pab.dao.impl.PersonDaoImpl;import cn.pab.dao.impl.TypeDaoImpl;import cn.pab.dao.impl.UserDaoImpl;import cn.pab.entity.Person;import cn.pab.entity.Type;/** * 業(yè)務(wù)類

      */ public class PABmanager { /**

      * 系統(tǒng)啟動

      */ public static void main(String[] args){

      Scanner input = new Scanner(System.in);

      UserDao userDao = new UserDaoImpl();

      TypeDao typeDao = new TypeDaoImpl();

      PersonDao personDao = new PersonDaoImpl();

      System.out.println(“***********歡迎使用個(gè)人通訊錄管理系統(tǒng)**********”);

      System.out.print(“n請選擇操作(1.系統(tǒng)登錄

      2.密碼修改

      3.取消):”);

      String in = input.next();

      if(“1”.equals(in)){

      boolean islogin = userDao.login();

      if(islogin){

      System.out.println(“***********成功登錄個(gè)人通訊錄管理系統(tǒng)**********”);

      //System.out.print(“n請選擇操作(1.類別管理

      2.聯(lián)系人管理

      3.退出系統(tǒng)):”);

      }else{

      System.out.println(“用戶名或密碼錯誤,不能登錄!”);

      System.exit(-1);

      }

      }else if(“2”.equals(in)){

      boolean modiFlag = userDao.modify();

      if(modiFlag){

      System.out.println(“密碼修改成功!”);}else{

      System.out.println(“密碼修改失?。 ?;} System.exit(-1);}else{ System.out.println(“您已經(jīng)退出系統(tǒng)!”);System.exit(-1);}

      while(true){

      System.out.print(“n請選擇操作(1.類別管理

      2.聯(lián)系人管理

      3.退出系統(tǒng)):”);String in2 = input.next();if(“1”.equals(in2)){ while(true){

      System.out.print(“n請繼續(xù)選擇操作(1.新建類別

      2.查詢類別

      3.刪除類別

      4.返回):”);

      String num = input.next();

      if(“1”.equals(num)){

      System.out.print(“請輸入類別的名稱:”);String lbmc = input.next();

      System.out.print(“請輸入類別的說明:”);String lbsm = input.next();System.out.print(“請輸入類別的備注:”);String lbbz = input.next();

      Type type = new Type(lbmc,lbsm,lbbz);

      typeDao.createType(type);}else if(“2”.equals(num)){ List types = typeDao.queryType();

      System.out.println(“tt類別信息列表”);

      System.out.println(“類別名稱tt類別說明tt類別備注”);

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

      Type type =types.get(i);

      System.out.print(type.getLbmc()+“t”);

      System.out.print(type.getLbsm()+ “tt”);

      System.out.println(type.getLbbz());

      }

      }else if(“3”.equals(num)){

      System.out.print(“請輸入類別的名稱:”);

      String lbmc = input.next();

      Type type = new Type(lbmc,null,null);

      typeDao.deleteType(type);}else if(“4”.equals(num)){ break;}else{

      System.out.println(“您輸入不合法,請重新選擇!”);

      }

      } }else if(“2”.equals(in2)){

      while(true){

      System.out.print(“n請繼續(xù)選擇操作(1.新建聯(lián)系人

      2.查詢聯(lián)系人

      3.更新聯(lián)系人

      4.刪除聯(lián)系人

      5.返回):”);

      String num = input.next();

      if(“1”.equals(num)){

      System.out.print(“請輸入聯(lián)系人的類別名稱:”);String lb = input.next();

      System.out.print(“請輸入聯(lián)系人的姓名:”);String xm = input.next();

      System.out.print(“請輸入聯(lián)系人的電話:”);String dh = input.next();

      System.out.print(“請輸入聯(lián)系人的手機(jī)號:”);String sjh = input.next();

      System.out.print(“請輸入聯(lián)系人的工作單位:”);String gzdw = input.next();

      System.out.print(“請輸入聯(lián)系人的住址:”);

      String zz = input.next();

      System.out.print(“請輸入聯(lián)系人的郵政編碼:”);

      String yzbm = input.next();

      Person person = new Person(lb,xm,dh,sjh,gzdw,zz,yzbm);

      personDao.createPerson(person);

      }else if(“2”.equals(num)){

      System.out.print(“請輸入聯(lián)系人的姓名:”);

      String name = input.next();

      Person p = personDao.queryPerson(name);

      System.out.println(“tt查詢到的聯(lián)系人信息”);

      System.out.println(“類別t姓名t電話tt手機(jī)號tt工作單位t住址t郵政編碼”);

      System.out.print(p.getLb()+ “t”);

      System.out.print(p.getXm()+ “t”);

      System.out.print(p.getDh()+ “t”);

      System.out.print(p.getSjh()+ “t”);

      System.out.print(p.getGzdw()+ “t”);

      System.out.print(p.getZz()+ “t”);

      System.out.println(p.getYzbm());

      }

      } }

      }else if(“3”.equals(num)){

      System.out.print(“請輸入需更新的聯(lián)系人編號:”);

      int id = input.nextInt();

      System.out.print(“請輸入需更新的聯(lián)系人信息選項(xiàng):”);

      String item = input.next();

      System.out.print(“請輸入聯(lián)系人信息選項(xiàng)的值:”);

      String val = input.next();

      personDao.updatePerson(id,item, val);

      }else if(“4”.equals(num)){

      System.out.print(“請輸入要刪除聯(lián)系人的姓名:”);

      String name = input.next();

      personDao.deletePerson(name);

      }else if(“5”.equals(num)){

      break;

      }else{

      System.out.println(“您輸入不合法,請重新選擇!”);

      } } }else if(“3”.equals(in2)){ System.out.println(“您已經(jīng)退出系統(tǒng)!”);System.exit(-1);}else{ System.out.println(“您輸入不合法,請重新選擇!”);}

      第二篇:java書店管理系統(tǒng)源代碼

      Java 源代碼

      public class loaduser { public String user;public String password;boolean b1;loaduser(String s1,String s2){

      user=s1;

      password=s2;} void load(){

      System.out.println(“ 書店管理銷售系統(tǒng)”);

      System.out.println(“**************************************”);System.out.println(“

      1、登錄系統(tǒng)”);System.out.println(“

      2、退出系統(tǒng)”);

      System.out.println(“**************************************”);System.out.println(“請選擇:”);

      int m;Scanner s=new Scanner(System.in);m=s.nextInt();

      if(m==1){

      for(int i=0;i<3;i++){

      System.out.println(“請輸入賬戶名和密碼”);

      String s3,s4;

      Scanner ss=new Scanner(System.in);

      s3=s.next();

      s4=s.next();

      if(user.equals(s3)&&password.equals(s4))b1=true;

      else b1=false;

      if(i==0&&b1==false)System.out.println(“用戶名或密碼輸入錯誤一次,還有兩次機(jī)會!”);

      if(i==1&&b1==false)System.out.println(“用戶名或密碼輸入錯誤兩次,還有一次機(jī)會!”);

      if(i==2&&b1==false){System.out.println(“三次輸入錯誤,退出系統(tǒng)!”);System.exit(0);}

      if(b1==true){

      System.out.println(“登錄成功!”);

      break;} } }

      if(m==2)System.exit(0);}

      package manger;import java.util.ArrayList;import java.util.Scanner;import manger.vip;import System.menu;public class vipmanger { static ArrayList vipgroup=new ArrayList();public vipmanger(){

      vipgroup.add(new vip(“001”,“王芳”,100));

      vipgroup.add(new vip(“002”,“李娜”,60));

      vipgroup.add(new vip(“003”,“楊麗”,50));

      vipgroup.add(new vip(“004”,“孫潔”,150));

      vipgroup.add(new vip(“005”,“肖青”,300));} static void addd(){ System.out.println(“請一次輸入編號,姓名,積分”);

      String S1,S2;

      int A;

      Scanner s=new Scanner(System.in);

      S1=s.next();

      S2=s.next();

      A=s.nextInt();

      vip v1=new vip(S1,S2,A);vipgroup.add(v1);}

      static void delete(){ System.out.println(“請輸入要求刪除的會員編號:”);String s;Scanner me=new Scanner(System.in);s=me.next();

      boolean b1=true;

      for(int i=0;i

      if(s.equals(vipgroup.get(i).ID)){vipgroup.remove(i);b1=false;}

      if(b1)System.out.println(“查無此會員!”);} static void correct(){ System.out.println(“請輸入要修改信息的會員編號:”);String sss;Scanner s=new Scanner(System.in);sss=s.next();

      boolean b1=true;

      for(int i=0;i

      if(sss.equals(vipgroup.get(i).ID)){

      b1=false;

      System.out.println(“請輸入新的姓名和積分:”);

      String ss1;Scanner s7=new Scanner(System.in);ss1=s7.next();vipgroup.get(i).name=ss1;int b;

      Scanner s8=new Scanner(System.in);

      b=s8.nextInt();

      vipgroup.get(i).score=b;}

      if(b1==true)System.out.println(“查無此會員!”);} static void select(){ System.out.println(“請輸入要查詢的會員編號:”);String s;Scanner me=new Scanner(System.in);s=me.next();

      boolean b1=true;

      for(int i=0;i

      if

      (s.equals(vipgroup.get(i).ID)){System.out.println(vipgroup.get(i).ID+“ ”+vipgroup.get(i).name+“ ”+vipgroup.get(i).score);b1=false;}

      if(b1==true)System.out.println(“查無此會員!”);} static void show(){

      for(int i=0;i

      System.out.println(vipgroup.get(i).ID+“ ”+vipgroup.get(i).name+“ ”+vipgroup.get(i).score);} public static void exchange(String s1,int a,int b){

      boolean b1=true;

      for(int i=0;i

      if(s1.equals(vipgroup.get(i).ID))

      {if(vipgroup.get(i).score<(a*b))System.out.println(“積分不足,不能兌換!”);

      else vipgroup.get(i).score-=a*b;

      b1=false;

      } if(b1==true)System.out.println(“查無此會員,不能兌換!”);} public static void shop(String s1,int a,int b){

      boolean b1=true;

      for(int

      i=0;i

      if(b1==true)System.out.println(“查無此會員,不能購買!”);} public static boolean start(){ menu m=new menu();m.vip();

      int x;Scanner me= new Scanner(System.in);x=me.nextInt();

      switch(x){

      case 1:show();break;

      case 2:delete();break;

      case 3:addd();break;

      case 4:correct();break;

      case 5:select();break;

      case 6:return false;}

      return true;} }

      public class book {

      public String number;

      public String name;

      public int price;

      public int jf;book(String s1,String s2,int a,int b){

      number=s1;

      name=s2;

      price=a;

      jf=b;}

      }

      package manger;import java.util.ArrayList;import java.util.Scanner;import System.menu;public class bookmanger {

      static ArrayList bookgroup=new ArrayList();public bookmanger(){ bookgroup.add(new book(“001”,“c語言”,20,20));bookgroup.add(new book(“002”,“大學(xué)英語”,22,22));bookgroup.add(new book(“003”,“高等數(shù)學(xué)”,28,28));} static void show(){ for(int i=0;i

      for(i=0;i

      return a;} public static String name(String s1){ String a = “無此書”;for(int i=0;i

      return a;} public static boolean start(){ menu m=new menu();m.bookmanger();int x;Scanner me= new Scanner(System.in);x=me.nextInt();switch(x){ case 1:show();break;case 2:delete();break;case 3:addd();break;case 4:return false;} return true;} }

      public class gift { public String number;public String caption;public int costjf;gift(String s1,String s2,int a){ number=s1;caption=s2;costjf=a;} }

      package manger;import java.util.ArrayList;import java.util.Scanner;import manger.vipmanger;import manger.vip;import System.menu;import manger.gift;public class giftmanger { static ArrayList giftgroup=new ArrayList();public giftmanger(){

      giftgroup.add(new gift(“001”,“鼠標(biāo)墊”,100));

      giftgroup.add(new gift(“002”,“書夾子”,50));

      giftgroup.add(new gift(“003”,“中性筆”,30));} static void show(){ for(int i=0;i

      System.out.println(“請輸入要刪除的禮品編號:”);

      String s;

      Scanner ss=new Scanner(System.in);

      s=ss.next();

      boolean b1=true;

      for(int i=0;i

      if(s.equals(giftgroup.get(i).number))

      {giftgroup.remove(i);

      b1=false;

      }

      if(b1)System.out.println(“查無此禮品!”);} static void addd(){

      System.out.println(“請輸入要添加的禮品編號,名稱,所需積分:”);

      String s1,s2;

      int a;

      Scanner me=new Scanner(System.in);

      s1=me.next();

      s2=me.next();

      a=me.nextInt();

      gift g1=new gift(s1,s2,a);

      giftgroup.add(g1);} static void exchange(){

      String s1,s2,c=“無此禮品”;

      int a,b=0;

      giftmanger.show();

      Scanner me=new Scanner(System.in);

      System.out.println(“請輸入您的會員編號:”);

      s1=me.next();

      System.out.println(“請輸入您要兌換的禮品編號:”);

      s2=me.next();

      System.out.println(“請輸入您要兌換的禮品數(shù)量:”);

      a=me.nextInt();

      boolean b1=true;

      for(int i=0;i

      {b=giftgroup.get(i).costjf;

      c=giftgroup.get(i).caption;

      b1=false;

      }

      if(b1==true)System.out.println(“查無此禮品!”);

      else vipmanger.exchange(s1, a, b);

      System.out.println(“兌換結(jié)果:”);

      System.out.println(“禮品名稱”+“ ”+“禮品積分”+“ ”+“禮品數(shù)量”+“ ”+“消耗積分”);

      System.out.println(c+“ ”+b+“ ”+a+“ ”+(a*b));} public static boolean start(){

      menu m=new menu();

      m.gift();

      int x;

      Scanner me= new Scanner(System.in);

      x=me.nextInt();

      switch(x){

      case 1:show();break;

      case 2:delete();break;

      case 3:addd();break;

      case 4:exchange();break;

      case 5:return false;

      }

      return true;} }

      public class shoping { static void shop(){ bookmanger.show();String s1,s2,s3;

      int a,b=0;Scanner me=new Scanner(System.in);System.out.println(“請輸入您的會員編號:”);s1=me.next();System.out.println(“請輸入書籍編號:”);s2=me.next();System.out.println(“請輸入購買數(shù)量:”);a=me.nextInt();b=bookmanger.price(s2);s3=bookmanger.name(s2);System.out.println(“書名”+“ ”+“單價(jià)”+“ ”+“數(shù)量”+“ ”+“總價(jià)”);System.out.println(s3+“ ”+b+“ ”+a+“ ”+(a*b));vipmanger.shop(s1, a, b);} public static boolean start(){ menu m=new menu();

      m.shopping();

      int x;

      Scanner me= new Scanner(System.in);

      x=me.nextInt();

      switch(x){

      case 1:shop();break;

      case 2:return false;

      }

      return true;} }

      public class menu {

      void mainmenu(){

      System.out.println(“

      書店管理系統(tǒng)”);

      System.out.println(“****************************”);

      System.out.println(“書店管理系統(tǒng)”);

      System.out.println(“

      1、會員管理”);

      System.out.println(“

      2、書籍管理”);

      System.out.println(“

      3、購物結(jié)算”);

      System.out.println(“

      4、積分兌換禮品”);

      System.out.println(“

      5、注銷”);

      System.out.println(“****************************”);

      }

      public void vip(){

      System.out.println(“書店管理系統(tǒng)>會員管理:”);

      System.out.println(“****************************”);

      System.out.println(“

      1、顯示會員信息”);

      System.out.println(“

      2、刪除會員”);

      System.out.println(“

      3、添加會員”);

      System.out.println(“

      4、修改會員信息”);

      System.out.println(“

      5、查詢會員”);

      System.out.println(“

      6、返回上層菜單”);

      System.out.println(“****************************”);

      }

      public void bookmanger(){

      System.out.println(“書店管理系統(tǒng)>書籍管理:”);

      System.out.println(“****************************”);

      System.out.println(“

      1、書籍信息查詢”);

      System.out.println(“

      2、刪除書籍”);

      System.out.println(“

      3、添加書籍”);

      System.out.println(“

      4、返回上層菜單”);

      System.out.println(“****************************”);

      }

      public void shopping(){

      System.out.println(“書店管理系統(tǒng)>購物結(jié)算:”);

      System.out.println(“****************************”);

      System.out.println(“

      1、購物”);

      System.out.println(“

      2、返回上層菜單”);

      System.out.println(“****************************”);

      }

      public void gift(){

      System.out.println(“書店管理系統(tǒng)>禮品兌換:”);

      System.out.println(“****************************”);

      System.out.println(“

      1、禮品信息”);

      System.out.println(“

      2、刪除禮品”);

      System.out.println(“

      3、添加禮品”);

      System.out.println(“

      4、兌換禮品”);

      System.out.println(“

      5、返回上層菜單”);

      System.out.println(“****************************”);

      }

      public static void main(String[] args){

      loaduser u1=new loaduser(“manger”,“416426”);

      u1.load();menu m1=new menu();

      vipmanger vip=new vipmanger();bookmanger book=new bookmanger();giftmanger gi=new giftmanger();

      while(true){

      m1.mainmenu();

      int x;

      Scanner me=new Scanner(System.in);

      x=me.nextInt();

      switch(x){

      case 1:while(vipmanger.start());break;

      case 2:while(bookmanger.start());break;

      case 3:while(shoping.start());break;

      case 4:while(giftmanger.start());break;

      case 5:u1.load();

      }

      }

      } }

      第三篇:學(xué)生成績管理系統(tǒng) java源代碼

      package com.student.enty;

      //姓名學(xué)號語文數(shù)學(xué)英語public class Student {

      private String name;

      private int num;

      private double chi;

      private double mat;

      private double eng;//聲明成員變量 public String getName(){

      return name;

      }

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

      }

      public int getNum(){

      return num;

      }

      public void setNum(int num){this.num = num;

      }

      public double getChi(){

      return chi;

      }

      public void setChi(double chi){this.chi = chi;

      }

      public double getMat(){

      return mat;

      }

      public void setMat(double mat){this.mat = mat;

      }

      public double getEng(){

      return eng;

      }

      public void setEng(double eng){this.eng = eng;

      }

      }

      第四篇:數(shù)據(jù)結(jié)構(gòu)課程設(shè)計(jì)—java通訊錄管理系統(tǒng)

      import java.io.*;import java.util.*;public class LittleProgram {

      static boolean isDelete = true;

      static boolean isFind = true;

      public static void main(String [] args)//主方法,程序從這里開始運(yùn)行

      throws IOException,NumberNotFoundException

      {

      int choice=-1;

      do{

      LittleProgram lp = new LittleProgram();

      System.out.println();

      System.out.println(“t

      #”);

      System.out.println();

      System.out.println(“tt通訊錄管理系統(tǒng)”);

      System.out.println(“t

      請用號碼插入,查找,修改,刪除數(shù)據(jù)”);

      System.out.println();

      System.out.println(“t

      #n”);

      System.out.print(“1.增加號碼:n”+

      “2.查找號碼:n”+

      “3.刪除號碼:n”+ “4.清除所有號碼:n”+ “5.把號碼全部打印到屏幕n”+ “6.把通訊錄按號碼排序n”+

      “7.修改號碼n”+

      “8.統(tǒng)計(jì)通碼訊錄的總?cè)藬?shù)n”+

      “9.關(guān)于作者n”+

      “0.退出程序.n” +

      “輸入:”);

      BufferedReader in =

      //從終

      new BufferedReader(//端接

      new InputStreamReader(System.in));//收數(shù)

      String inputLine = in.readLine();

      //字選

      choice= Integer.valueOf(inputLine).intValue();//項(xiàng);

      switch(choice)

      {

      case 1: {//1.增加號碼

      String str = lp.inputData();

      lp.addData(str);

      System.out.println(“增加號碼成功.”);

      timeOut(1);

      }break;

      case 2: {//2.查找號碼

      long find = 0;

      System.out.print(“請輸入你要查找的號碼:”);

      BufferedReader inn =

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

      String inputLi = inn.readLine();

      find = Integer.valueOf(inputLi).longValue();

      lp.findData(find);

      timeOut(2);

      }break;

      case 3: {//3.刪除號碼

      long deleteNumber = 0;

      System.out.print(“請輸入你想刪除號碼:”);

      BufferedReader bf =

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

      String inputL = bf.readLine();

      deleteNumber = Integer.valueOf(inputL).longValue();

      lp.deleteData(deleteNumber);

      if(isDelete)

      System.out.println(“刪除號碼成功!”);

      timeOut(1);

      }break;

      case 4: {

      lp.clearData();//4.清除所有號碼

      timeOut(1);

      }break;

      case 5: {

      print();//5.把號碼全部打印到屏幕

      timeOut(2);

      }break;

      case 6: {

      lp.numSort();//6.把號碼按號碼排序

      System.out.println(“按照號碼從小到大排序成功!n”+

      “排序后:n”);

      print();

      timeOut(2);

      }break;

      case 7: {

      lp.rewrite();//7.修改號碼

      timeOut(2);

      }break;

      case 8: {

      int count = lp.count();

      System.out.println(“共有”+count+“個(gè)號碼記錄.”);

      timeOut(2);

      }break;

      case 9: {

      System.out.print(“tt李雪萍n”+

      “tt安徽理工大學(xué)理學(xué)院n”+

      “ttQQ:1154646392n”);

      timeOut(4);

      }break;

      }}while(choice!= 0);

      System.out.println(“Bye!^-^”);

      System.exit(0);

      }

      public String inputData()//從終端接收數(shù)據(jù)的方法,返回字符串

      throws IOException,NumberFormatException

      {

      System.out.print(“請依次輸入 :號碼 姓名 地址 生日n” +

      “每項(xiàng)數(shù)據(jù)請用空格隔開:”);

      String all = “";

      try{

      BufferedReader in =

      //從終

      new BufferedReader(//端接

      new InputStreamReader(System.in));

      //收數(shù)

      String inputLine = in.readLine();

      //據(jù)

      StringTokenizer str =

      new StringTokenizer(inputLine,” “);//接收的數(shù)據(jù)用空格隔開,這個(gè)類用來提取每個(gè)字符串

      long num = Integer.valueOf(str.nextToken()).longValue();//號碼

      String name =(String)str.nextToken();

      //姓名

      String add =(String)str.nextToken();

      // 地址

      String birth =(String)str.nextToken();//出生年月

      all = String.valueOf(num)+” , “+

      name +” , “+

      add +” , “+

      String.valueOf(birth);//把所有的數(shù)據(jù)用” , “隔開然后在連起來放進(jìn)字符串a(chǎn)ll

      }catch(IOException e){}

      catch(NumberFormatException e){}

      return all;//返回字符串a(chǎn)ll

      }

      public void addData(String str)//增加號碼的方法

      throws IOException

      {

      String s1 =”“,s2=”“ ,s3= ”“;

      File file = new File(”c:data.txt“);

      if(file.exists())//如果文件data.txt存在 {

      try{

      BufferedReader in =

      new BufferedReader(new FileReader(file));

      while((s1=in.readLine())!=null)

      s2+=s1+”n“;//把文件中的每行數(shù)據(jù)全部放進(jìn)一個(gè)字符串s2

      s2+=str+”n“;

      //再把s2于形參str相連放進(jìn)s2

      BufferedReader in2 =

      //把字符

      new BufferedReader(//串s2也

      new StringReader(s2));

      //就是原

      PrintWriter out =

      //文件+

      new PrintWriter(//形參str(新輸入的一行數(shù)據(jù))

      new BufferedWriter(//重新寫進(jìn)data.txt

      new FileWriter(file)));

      //覆蓋原來的數(shù)據(jù)

      while((s3=in2.readLine())!= null)

      {

      out.println(s3);

      }

      out.close();

      //System.out.println(”write data true.“);

      }catch(IOException e){}

      }else{

      System.err.println(”File “data” Missing!“);

      }

      }

      public void clearData()//清除data.txt的所有數(shù)據(jù)的方法

      throws IOException

      {

      File file = new File(”c:data.txt“);

      if(file.exists())//如果文件在{

      try{

      PrintWriter out =

      new PrintWriter(new BufferedWriter(new FileWriter(file)));

      out.print(”“);//在文件data.txt里寫進(jìn)一個(gè)空字符,所以清除了原來的內(nèi)容

      out.close();//關(guān)閉文件

      System.out.println(”clear data true!“);

      }catch(IOException e){}

      }else{

      System.err.println(”File “data” Missing!“);

      }

      }

      public void deleteData(long deleteNumber)//刪除某條號碼數(shù)據(jù)

      throws IOException,FileNotFoundException

      {

      isDelete = true;

      try{

      DataMap mp = new DataMap();//生成一個(gè)自己編寫的容器

      long j=0;

      String s1=”“,s2=”“,s3=”“;

      BufferedReader in =

      new BufferedReader(new FileReader(”c:data.txt“));

      while((s1=in.readLine())!=null)

      {

      j=numberTokenizer(s1);

      mp.put(j,s1);

      }

      try{

      if(mp.containsKey(String.valueOf(deleteNumber).toString()))

      {

      mp.remove(deleteNumber);

      }else

      throw new NumberNotFoundException();

      Collection c = mp.values();

      Iterator iter = c.iterator();

      while(iter.hasNext())

      {

      s1 =(String)iter.next();

      s3 +=s1+”n“;

      }

      BufferedReader in2 =

      new BufferedReader(new StringReader(s3));

      PrintWriter out =

      new PrintWriter(new BufferedWriter(new FileWriter(”c:data.txt“)));

      //System.out.println(”delete No“+deleteNumber);

      while((s1 = in2.readLine())!=null)

      {

      out.println(s1);

      } out.close();}catch(NumberNotFoundException e){

      isDelete = false;

      System.out.println(deleteNumber+” no found :(“);

      }

      }catch(IOException e){}

      }

      public long numberTokenizer(String s)

      throws IOException

      {

      StringTokenizer st =

      new StringTokenizer(s,” “);

      return Integer.valueOf((st.nextToken())).longValue();

      }

      public void findData(long find)//查找數(shù)據(jù)

      throws IOException,NumberNotFoundException

      {

      isFind = true;

      String s = ”“,findString =”“;long i;DataMap dm = new DataMap();BufferedReader in =

      new BufferedReader(new FileReader(”c:data.txt“));

      while((s=in.readLine())!=null)

      {

      i=numberTokenizer(s);

      dm.put(i,s);

      }

      //in.close();

      try{

      if(dm.containsKey(String.valueOf(find).toString()))

      {

      findString = dm.get(find);

      System.out.println(”學(xué)號“+find+”學(xué)生的資料是:“);

      System.out.println(findString);

      }else

      throw new NumberNotFoundException();

      }catch(NumberNotFoundException e){

      System.out.println(find+” no found :(“);

      isFind = false;

      }

      }

      public static void print()//讀取文本文件把數(shù)據(jù)打印到終端的方法

      throws IOException

      {

      try{

      BufferedReader in =

      new BufferedReader(new FileReader(”c:data.txt“));

      String read = ”“;

      while((read = in.readLine())!=null)

      System.out.println(read);

      }catch(IOException e){}

      }

      public static void timeOut(double sec)//停頓短暫時(shí)間的一個(gè)方法完全可以不要這個(gè)功能

      {

      double seconds = sec;

      long t = System.currentTimeMillis()+(int)(seconds*1000);

      while((System.currentTimeMillis())

      ;

      }

      public void numSort()//按學(xué)號排序

      throws IOException

      {

      long i = 0;

      String s = ”“;

      try{

      DataArrayList dal = new DataArrayList();

      BufferedReader in =

      new BufferedReader(new FileReader(”c:data.txt“));

      while((s=in.readLine())!=null)

      {

      i=numberTokenizer(s);

      dal.add(i);

      }

      Collections.sort(dal);

      DataMap dm = new DataMap();

      BufferedReader in2 =

      new BufferedReader(new FileReader(”c:data.txt“));

      while((s=in2.readLine())!=null)

      {

      i=numberTokenizer(s);

      dm.put(i,s);

      }

      PrintWriter out =

      new PrintWriter(new BufferedWriter(new FileWriter(”c:data.txt“)));

      Iterator it = dal.iterator();

      long temp = 0;

      String tempStr = ”“;

      while(it.hasNext())

      {

      temp = Integer.valueOf((String)it.next()).longValue();

      tempStr = dm.get(temp);

      out.println(tempStr);

      }

      out.close();

      }catch(IOException e){}

      }

      public void rewrite()

      throws IOException,NumberNotFoundException

      {

      try{

      System.out.print(”請輸入你要修改的學(xué)生號碼:“);

      BufferedReader in =

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

      String inputLine = in.readLine();

      long num = Integer.valueOf(inputLine).longValue();

      findData(num);

      if(isFind)

      { deleteData(num);System.out.print(”請重新輸入該號碼:“);String str = inputData();

      addData(str);

      System.out.println(”rewrite true!“);

      }

      }catch(IOException e){}

      catch(NumberNotFoundException e){}

      }

      public int count()

      throws IOException

      {

      DataArrayList dal = new DataArrayList();

      try{

      String s = ”“;

      long i =0;

      BufferedReader in =

      new BufferedReader(new FileReader(”c:data.txt“));

      while((s=in.readLine())!=null)

      {

      i=numberTokenizer(s);

      dal.add(i);

      }

      }catch(IOException e){}

      return dal.size();

      } } /* *

      * @author RangWei * TODO 這是個(gè)寫的一個(gè)容器,繼承公共類HashMap * 大概的功能就相當(dāng)一個(gè)數(shù)組

      *

      */ class DataMap extends HashMap//一個(gè)存儲數(shù)據(jù)的Map

      {

      public void put(long i,String str)//把學(xué)號和數(shù)據(jù)放進(jìn)這個(gè)Map

      {

      //以后一個(gè)學(xué)號(key)對應(yīng)的是一個(gè)人的數(shù)據(jù)(value)

      put(String.valueOf(i).toString(),str);

      }

      public void remove(long i)//接收學(xué)號,然后刪除學(xué)號(key)和它對應(yīng)的數(shù)據(jù)(value)

      {

      remove(String.valueOf(i).toString().toString());

      }

      public String get(long i)//接收一個(gè)學(xué)號,然后返回這個(gè)key對應(yīng)的value

      {

      String s = String.valueOf(i).toString();

      if(!containsKey(s))

      {

      System.err.println(”Not found Key: "+s);

      }

      return(String)get(s);

      } } /*

      *

      * @author RangWei * * TODO 這個(gè)類繼承ArrayList * 用來按數(shù)字排序,在用號碼排序時(shí)要用到它

      *

      */ class DataArrayList extends ArrayList {

      public void add(long num)

      {

      String numToString = String.valueOf(num).toString();

      add(numToString);

      } } /* *

      * @author RangWei * * TODO 增加的一個(gè)Exception,主要是在文件里沒有要找

      * 的號碼就拋出

      *

      */ class NumberNotFoundException extends Exception {

      public NumberNotFoundException()

      {} }

      第五篇:通訊錄管理系統(tǒng)的設(shè)計(jì)與實(shí)現(xiàn)c++源代碼

      通訊錄管理系統(tǒng)的設(shè)計(jì)與實(shí)現(xiàn)源代碼 #include #include #include #include using namespace std;struct Student { string num;//學(xué)號 string name;//姓名 int age;char tel;char addr;char emal;Student *next;};long iCount=0;Student *head=NULL;Student *pEnd=NULL;void LoadRecords(char *path)//從文本里面讀取記錄 { fstream infile(path,ios::in);if(!infile){} else { infile>>iCount;int t=iCount;if(iCount!=0){ for(;iCount>0;iCount--){ Student *p=new Student;infile>>p->num>>p->name>>p->Maths;if(head==NULL){ head=p;pEnd=p;pEnd->next=NULL;} else { pEnd->next=p;pEnd=pEnd->next;pEnd->next=NULL;

      } } } iCount=t;} infile.close();} void Print(Student *h)//打印記錄 { if(h==NULL){ cout<<“n****************************************nn”;cout<<“沒有學(xué)生記錄!n”;cout<<“n****************************************n”;return;} cout<<“n********************************************************************************nn”;cout<<“所有的學(xué)生:nn”;cout<<“-----------n”;cout<<“| ”<num<<“| ”<name <<“| ”<age<<“| ”<tel <<“| ”<addr<<“| ”<emal<<“ |n”;h=h->next;} cout<<“-----------n”;cout<<“n********************************************************************************nn”;} void Print_All(Student *h)//輸出全部 {

      if(h==NULL){cout<<“n****************************************n”;cout<<“沒有學(xué)生記錄!n”;cout<<“n****************************************n”;return;} cout<<“n********************************************************************************n”;cout<<“所有學(xué)生:nn”;cout<<“-----------n”;cout<<“| ”<number=1;h->number++} { cout<<“-----------n”;cout<<“| ”<num<<“| ”<name <<“| ”<age<<“| ”<tel <<“| ”<addr<<“| ”<emal<<“ |n”;h=h->next;} cout<<“-----------n”;cout<<“n********************************************************************************nn”;}

      void Print_search(Student *h)//查詢 { if(h==NULL){cout<<“n********************************************************************************n”;cout<<“沒有學(xué)生記錄!n”;cout<<“n****************************************n”;return;} cout<<“n********************************************************************************n”;cout<<“所查學(xué)生:nn”;cout<<“-----------n”;cout<<“| ”<number=i)

      { cout<<“-----------n”;cout<<“| ”<num<<“| ”<name <<“| ”<age<<“| ”<tel <<“| ”<addr<<“| ”<emal<<“ |n”;} h=h->next;} cout<<“-----------n”;cout<<“n********************************************************************************nn”;} void Add(Student *s){ if(pEnd==NULL){head=s;pEnd=s;s->next=NULL;} else{pEnd->next=s;pEnd=s;pEnd->next=NULL;} cout<<“n====n”;cout<name<<“ 的資料添加完畢!n”;cout<<“====n”;iCount++;} void main(){ LoadRecords(“c: est.txt”);int n;cout<<“n********************************************************************************n”;cout<<“[1] 增加一個(gè)學(xué)生n” <<“[2] 顯示所有的學(xué)生以及他們的成績n” <<“[3] 顯示數(shù)組中學(xué)號為I的學(xué)生信息n” <<“[4] 存盤并退出n”;cout<<“********************************************************************************nn”;cout<<“請選擇操作項(xiàng):[1-5] ”;cin>>n;while(1){ switch(n){ case 1: { Student *p=new Student;

      cout<<“n********************************************************************************nn”;cout<<“請輸入內(nèi)容:”<>p->num>>p->name>>p->age>>p->tel>>p->addr>>p->emal;Add(p);break;} case 2: Print(head);break;case 3: Print_search(head);break;case 4: { fstream outfile(“c: est.txt”,ios::out);if(!outfile){} else { outfile<num<<“ ”<name<<“ ”<Maths<<“ ”;head=head->next;} } outfile.close();cout<<“n====n”;cout<<“再見”<=1&&n<=5){

      cout<<“n********************************************************************************n”;cout<<“[1] 增加一個(gè)學(xué)生n”

      <<“[2] 顯示所有的學(xué)生以及他們的成績n” <<“[3] 顯示數(shù)組中平均成績<40的學(xué)生以及他們的成績n” <<“[4] 顯示數(shù)組中學(xué)號為I的學(xué)生信息n” <<“[5] 存盤并退出n”;cout<<“********************************************************************************nn”;cout<<“請選擇操作項(xiàng):[1-5] ”;cin>>n;} } }

      下載個(gè)人通訊錄管理系統(tǒng),java源代碼word格式文檔
      下載個(gè)人通訊錄管理系統(tǒng),java源代碼.doc
      將本文檔下載到自己電腦,方便修改和收藏,請勿使用迅雷等下載。
      點(diǎn)此處下載文檔

      文檔為doc格式


      聲明:本文內(nèi)容由互聯(lián)網(wǎng)用戶自發(fā)貢獻(xiàn)自行上傳,本網(wǎng)站不擁有所有權(quán),未作人工編輯處理,也不承擔(dān)相關(guān)法律責(zé)任。如果您發(fā)現(xiàn)有涉嫌版權(quán)的內(nèi)容,歡迎發(fā)送郵件至:645879355@qq.com 進(jìn)行舉報(bào),并提供相關(guān)證據(jù),工作人員會在5個(gè)工作日內(nèi)聯(lián)系你,一經(jīng)查實(shí),本站將立刻刪除涉嫌侵權(quán)內(nèi)容。

      相關(guān)范文推薦

        通訊錄管理系統(tǒng)大全

        課 程 設(shè) 計(jì) 任 務(wù) 書 題目 C語言課程設(shè)計(jì) 系(部) 專業(yè)班級學(xué)生姓名學(xué)號 06 月信息科學(xué)與電氣工程學(xué)院計(jì)算機(jī)科學(xué)與技術(shù) 計(jì)職141 王雪 140819139 21 日至07 月04 日共 2......

        通訊錄管理系統(tǒng)

        摘 要 為了人們對他人信息的記憶方便而設(shè)計(jì),開發(fā)的一套“通訊錄管理系統(tǒng)“軟件。 通過該題目的設(shè)計(jì)過程,可以培養(yǎng)學(xué)生結(jié)構(gòu)化程序設(shè)計(jì)的思想,加深對高級語言基本語言要素和控制......

        通訊管理系統(tǒng)源代碼

        題目:用C/C++設(shè)計(jì)出模擬手機(jī)通信錄管理系統(tǒng),實(shí)現(xiàn)對手機(jī)中的通信錄進(jìn)行管理。 (一)功能要求 (1)查看功能:選擇此功能時(shí),列出下列三類選擇。 A 辦公類 B 個(gè)人類 C 商務(wù)類 ,當(dāng)選中某類時(shí)......

        圖書管理系統(tǒng)源代碼

        環(huán)植學(xué)院深入開展創(chuàng)先爭優(yōu)活動實(shí)施方案為貫徹落實(shí)中共中央、海南省委、省委教育工委及學(xué)校黨委“關(guān)于在黨的基層組織和黨員中深入開展創(chuàng)先爭優(yōu)活動”的決定,根據(jù)相關(guān)文件精神......

        C++通訊錄管理系統(tǒng)

        黑龍江工程學(xué)院 第一章 問題分析和任務(wù)定義 1.1 問題分析 問題: 編寫一個(gè)通訊錄管理系統(tǒng)。要求包括通訊錄建立、增加號碼、刪除號碼、查詢號碼(按姓名、按號碼)、修改號碼、......

        通訊錄管理系統(tǒng)[推薦5篇]

        1.題目名稱通訊錄管理系統(tǒng) 2.基本功能 (1)顯示:將所有聯(lián)系人的信息顯示出來 (2)查找:按姓名、手機(jī)號碼、QQ號碼進(jìn)行查找 (3)添加:從鍵盤上錄入聯(lián)系人的有關(guān)信息,包括姓名、手機(jī)號碼......

        學(xué)生通訊錄管理系統(tǒng)

        “學(xué)生通訊信息記錄系統(tǒng)”的設(shè)計(jì)與實(shí)現(xiàn) 一、設(shè)計(jì)要求 1. 問題的描述 “學(xué)生通訊信息記錄系統(tǒng)”是為了實(shí)現(xiàn)快速的對學(xué)生信息進(jìn)行錄入、刪除、查找、顯示。各個(gè)功能靠函數(shù)實(shí)現(xiàn)......

        手機(jī)通訊錄管理系統(tǒng)

        #include #include #include #include #include #include class Information { char name[20]; char tel[12]; char kind; char email[50]; public: Information(){} Inform......