您好,欢迎访问三七文档
当前位置:首页 > 办公文档 > 会议纪要 > 会议记录管理系统(C++)
#includeiostream.h#includefstream.h#includestdlib.h#includestring.hstructMeetinglist{charname[10];charnumber[50];chardepartment[40];charaddress[40];chartime[15];charmoderator[20];charrecoder[15];charpresentmembers[300];chardigest[500];};voidAdd(fstream);voidCreatTxt(fstream);voidmodification(fstream);voidDelete(fstream);voidInquire(fstream);voidmain(){intchoice;fstreamfield(d:\\clot.dat,ios::in|ios::out|ios::binary);if(!field){cerr文件不能打开endl;return;}while(choice){cout**会议记录管理系统**\n;cout1.添加会议记录:\n2.创建TXT文档:\n3.修改会议记录:\n4.删除会议记录:\n5.按不同字段(会议编号)查询会议记录和浏览所有会议记录信息:\n0.退出!\n;do{cinchoice;}while(choice!=0&&choice!=1&&choice!=2&&choice!=3&&choice!=4&&choice!=5);switch(choice){case1:Add(field);break;case2:CreatTxt(field);break;case3:modification(field);break;case4:Delete(field);break;case5:Inquire(field);break;case0:cout退出系统!\n;return;default:cout输入错误,请重新输入\n;}}field.close();}voidAdd(fstreamf){Meetinglistlist;cout请输入会议名称:\n;cinlist.name;cout请输入会议编号(3位):\n;cinlist.number;cout請输入部门名称:\n;cinlist.department;cout请输入会议地点:\n;cinlist.address;cout请输入会议日期:\n;cinlist.time;cout请输入会议主持人:\n;cinlist.moderator;cout请输入会议记录人:\n;cinlist.recoder;cout请输入出席人员:\n;cinlist.presentmembers;cout请输入会议摘要:\n;cinlist.digest;f.write((char*)&list,sizeof(Meetinglist));}voidCreatTxt(fstreamf){MeetinglistList;fstreamftxt(d:\\clot.txt,ios::out);f.seekg(0,ios::end);longposEnd=f.tellg();f.seekg(0,ios::beg);do{f.read((char*)&List,sizeof(Meetinglist));ftxtList.name'\n'List.number'\n'List.department'\n'List.address'\n'List.time'\n'List.moderator'\n'List.recoder'\n'List.presentmembers'\n'List.digestendl;}while(posEnd!=f.tellg());coutTxt文档已建立\n;ftxt.close();return;}voidmodification(fstreamf){MeetinglistList;inta=0;intm=0;intchoice;charnum[50];charinformation[50];f.seekg(0,ios::end);longposEnd=f.tellg();f.seekg(0,ios::beg);cout*请输入要修改会议记录的编号:*\n;cinnum;do{f.read((char*)&List,sizeof(Meetinglist));for(inti=0;i50;i++){if(num[i]==List.number[i])m++;if(num[i]!=List.number[i]){m=0;break;}}}while(m!=50&&posEnd!=f.tellg());if(m=50)cout*找到这个会议*\n1.修改会议名称:\n2.修改会议编号:\n3.修改部门名称:\n4.修改会议地点:\n5.修改会议日期:\n6.修改会议主持人:\n7.修改会议记录人:\n8.修改出席人员:\n9.修改会议摘要:\n0.退出:\n;if(m!=50){cout*没有这个会议*!\n;return;}while(choice){do{cinchoice;}while(choice!=1&&choice!=2&&choice!=3&&choice!=4&&choice!=5&&choice!=6&&choice!=7&&choice!=8&&choice!=9&&choice!=0);switch(choice){case1:cininformation;for(a=0;asizeof(List.name);a++)List.name[a]=information[a];f.seekp(-long(sizeof(Meetinglist)),ios::cur);f.write((char*)&List,sizeof(List));return;case2:cininformation;for(a=0;asizeof(List.number);a++)List.number[a]=information[a];f.seekp(-long(sizeof(Meetinglist)),ios::cur);f.write((char*)&List,sizeof(List));return;case3:cininformation;for(a=0;asizeof(List.department);a++)List.department[a]=information[a];f.seekp(-long(sizeof(Meetinglist)),ios::cur);f.write((char*)&List,sizeof(List));return;case4:cininformation;for(a=0;asizeof(List.address);a++)List.address[a]=information[a];f.seekp(-long(sizeof(Meetinglist)),ios::cur);f.write((char*)&List,sizeof(List));return;case5:cininformation;for(a=0;asizeof(List.time);a++)List.time[a]=information[a];f.seekp(-long(sizeof(Meetinglist)),ios::cur);f.write((char*)&List,sizeof(List));return;case6:cininformation;for(a=0;asizeof(List.moderator);a++)List.moderator[a]=information[a];f.seekp(-long(sizeof(Meetinglist)),ios::cur);f.write((char*)&List,sizeof(List));return;case7:cininformation;for(a=0;asizeof(List.recoder);a++)List.recoder[a]=information[a];f.seekp(-long(sizeof(Meetinglist)),ios::cur);f.write((char*)&List,sizeof(List));return;case8:cininformation;for(a=0;asizeof(List.presentmembers);a++)List.presentmembers[a]=information[a];f.seekp(-long(sizeof(Meetinglist)),ios::cur);f.write((char*)&List,sizeof(List));return;case9:cininformation;for(a=0;asizeof(List.digest);a++)List.digest[a]=information[a];f.seekp(-long(sizeof(Meetinglist)),ios::cur);f.write((char*)&List,sizeof(List));return;case0:cout退出!\n;return;}}}voidDelete(fstreamf){Meetinglistlist;intm=0;chara;charnum[50];charFill[80]={''};cout*请输入要删除的会议的编号Y/N:*endl;cinnum;f.seekg(0,ios::end);longposEnd=f.tellg();f.seekg(0,ios::beg);do{f.read((char*)&list,sizeof(Meetinglist));for(inti=0;i50;i++){if(num[i]==list.number[i])m++;if(num[i]!=list.number[i]){m=0;break;}}}while(m!=50&&posEnd!=f.tellg());if(m=50)cout*找到这个会议*\n;if(m!=50){cout*没有这个会议!*\n;return;}cout*确定删除这个会议?*endl;do{cina;}while(a!='Y'&&a!='N'&&a!='y'&&a!='n');if(a=='Y'||a=='y'){for(inti=0;isizeof(list.name);i++){list.name[i]=Fill[i];}for(i=0;isizeof(list.number);i++){list.number[i]=Fill[i];}for(i=0;isizeof(list.department);i++){list.department[i]=Fill[i];}for(i=0;isizeof(list.address);i++){list.address[i]=Fill[i];}for(i=0;isizeof(list.time);i++){list.time[i]=Fill[i];}for(i=0;isizeof(list.moderator);i++){list.moderator[i]=Fill[i];}for(i=0;isizeof(list.recoder);i++){list.recoder[i]=Fi
本文标题:会议记录管理系统(C++)
链接地址:https://www.777doc.com/doc-5408308 .html