C++课程设计——电话簿管理.docVIP

  • 7
  • 0
  • 约2.09万字
  • 约 18页
  • 2015-12-18 发布于湖北
  • 举报
C++课程设计——电话簿管理.doc

#includefstream.h #includeconio.h #includeiostream.h #includeiomanip.h #includetime.h #includestring.h #includestdlib.h class friend_node //电话簿类的定义。 { private: int year,month,day,hour,minute;//时间单元 char last_name[20]; //姓氏 char first_name[15];//名字 char phone_num[20];//电话号码 char pause; friend_node *next; public: //各种函数的说明 void handle_choice(int choice); //根据用户选择调用函数 void add_record();//增加记录 void insert_node(friend_node *new_rec_ptr);//将一个由new_rec_ptr指向的新结点插入链表中 friend_node *position_insertion_point(char lastname[20]);/*根据姓氏,返回其在链表中的正确位置, 新结点即将插入此点*/ void make_node_new_head(friend_node *new_rec_ptr);//使新插入结点成为头结点 void add_node_to_end(friend_node *new_rec_ptr);//使新插入结点成为尾结点 void move_current_to_end();//移动当前结点到链表尾 void display_list();//输出所有数据 void delete_record();//删除结点 void delete_head_of_list();//删除链表头 void delete_end_of_list(friend_node *previous_ptr);//删除链表尾 void delete_from_middle_of_list(friend_node *previous_ptr);//删除中间当前结点 void delete_node(friend_node *previous_ptr);//删除当前结点 void delete_list();//删除成个链表 void search_by_lastname();//根据姓氏查找 void search_by_firstname();//根据名字查找 void modify_record();//修改数据 void look_char();//智能查询 void write_list_to_file();//将链表数据写如文件 void load_list_from_file();//读取数据,重建链表处理函数 void help_me();//帮助 void welcome();//进入函数 int verify_delete();//要求用户确认 }; friend_node *fun_ptr; friend_node *head_ptr; //全程变量,链头指针 friend_node *current_ptr; //全程变量,用于指明当前在链表中的位置 time_t time_date; // time_t 里面放的是星期、月份、日期、时间及年份等数据 tm *CurrentTime;//定义时间的一个指针 void friend_node::welcome() { coutendlendlendlendlendlendlendlendlendlendl; cout \t\t\t\t欢迎进入电话簿管理\n; cout \t\t\t\tsetw(15)按Enter键继续; cin.get( pause); system(cls); //执行系统命令:cls-清屏 int choice; head_ptr = NULL; // 初始化链表头指针。 load_list_from_file(); //装载数据文件到链表。 do { // 主菜单显示 cout \t《主菜单》endl---------------

文档评论(0)

1亿VIP精品文档

相关文档