版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
PAGE36南京理工大學(xué)VC++課程設(shè)計(jì)報(bào)告課程:VC++課程設(shè)計(jì)系別:計(jì)算機(jī)科學(xué)與計(jì)算機(jī)學(xué)院班級(jí):學(xué)號(hào): 姓名: 選題2名稱:同學(xué)錄系統(tǒng)選題2難度系數(shù):A自報(bào)成績(jī):優(yōu)秀起止時(shí)間:8.23-11.30指導(dǎo)教師:陸建峰日期:2021年9月24日目錄課題目標(biāo)1.1程序功能簡(jiǎn)介1.2課程設(shè)計(jì)要求1.3評(píng)定難易級(jí)別具體實(shí)現(xiàn)2.1程序總體方案2.1.1開(kāi)發(fā)平臺(tái)2.1.2程序結(jié)構(gòu)或流程圖2.2關(guān)鍵代碼及注釋程序截圖調(diào)試報(bào)告(在設(shè)計(jì)和實(shí)現(xiàn)過(guò)程所遇到的問(wèn)題和解決,請(qǐng)如實(shí)填寫)…總體小結(jié)(在整個(gè)設(shè)計(jì)過(guò)程中的心得體會(huì))分工介紹(是獨(dú)立完成還是合作完成,若為合作完成,說(shuō)明合作者以及之間的具體分工)…一、課題目標(biāo)1.1程序功能簡(jiǎn)介此程序是一個(gè)簡(jiǎn)單的同學(xué)錄系統(tǒng),具有導(dǎo)入同學(xué)信息,存儲(chǔ),顯示、新增、刪除、查詢、修改同學(xué)信息等功能,最主要的是,它是用雙向鏈表實(shí)現(xiàn)的,所以新增和刪除的效率非常的高。其菜單分為:顯示所有同學(xué)錄信息、新增一個(gè)同學(xué)錄信息、刪除一個(gè)同學(xué)錄信息、查詢系統(tǒng)、修改同學(xué)錄信息,尋求幫助等。1.2課程設(shè)計(jì)要求 用雙向鏈表完成一個(gè)同學(xué)錄系統(tǒng)實(shí)現(xiàn)同學(xué)錄所該有的功能,并方便用戶的使用!1.3評(píng)定難易級(jí)別A組二、具體實(shí)現(xiàn)2.1程序總體方案2.1.1開(kāi)發(fā)平臺(tái)操作系統(tǒng):Windows7開(kāi)發(fā)工具:visualstudio20212.1.2程序結(jié)構(gòu)或流程圖主函數(shù)的流程圖:開(kāi)始開(kāi)始讀入TXT歡迎界面顯示菜單新增信息顯示所有刪除操作尋求幫助退出修改系統(tǒng)查詢系統(tǒng)姓氏查詢?nèi)笔〔樵冇洃洸樵兎祷厥欠裣炔樵儍?chǔ)存入TXT 2.2所做改進(jìn)2.2.1改進(jìn)一改進(jìn)方案基本上這個(gè)程序都是自己寫的,改進(jìn)也只是對(duì)原有要求的添加而已。先說(shuō)說(shuō)這個(gè)程序怎么實(shí)現(xiàn)所有功能的吧。具體實(shí)現(xiàn) 進(jìn)入程序,首先是讀取txt文件的信息,然后顯示的是菜單。再然后一目了然的有各種功能。 總體是用雙向鏈表做的。新增結(jié)點(diǎn)信息:即添加一個(gè)鏈表結(jié)點(diǎn)信息。顯示所有信息:是先根據(jù)學(xué)號(hào)排序,然后從頭至尾分屏顯示所有信息,鏈表依次讀取。刪除操作:即鏈表操作,刪除一個(gè)結(jié)點(diǎn).查詢操作:按要求進(jìn)行各種情況查詢,總體思想是線性的比較,如果有匹配的字符串就輸出(這里面用的是string.find函數(shù))。修改同學(xué)錄:先根據(jù)查找操作找到這個(gè)信息,再修改當(dāng)前結(jié)點(diǎn)信息尋求幫助:作為一些運(yùn)用該程序的說(shuō)明而存在??梢詫?duì)用戶一些較常見(jiàn)的疑問(wèn)做出回答。退出程序:退出前會(huì)保存所有的信息至txt文件。2.2.2改進(jìn)二改進(jìn)方案為了使我的查詢更完善,我的程序做到了部分字符串匹配的查詢方式,即比如在輸入姓名查詢的時(shí)候,如果輸入的是姓名的姓或者名,那么與之匹配的所有信息都會(huì)顯示,而不是顯示結(jié)果不存在。同樣的,還可以根據(jù)自己一開(kāi)始對(duì)該同學(xué)的評(píng)價(jià)做查詢。另外,我設(shè)置了幫助選項(xiàng),可以為用戶解答很多常見(jiàn)的疑問(wèn)。可以方便用戶。具體實(shí)現(xiàn)運(yùn)用STLstring類里面的find()函數(shù);把我的成員全都定義成string類的,最后再讓用戶輸入所需查找的字符串(也是一個(gè)string類),然后從到之為用find函數(shù)查,如njust[i].name.find(temp)!=string::npos;則加入到輸出。在所有的查詢方式里使用相同的方法,即可實(shí)現(xiàn),所有的查詢都帶有子串查找功能。STL確實(shí)方便三、程序運(yùn)行截圖進(jìn)入程序:進(jìn)入菜單:分屏顯示查詢界面:修改同學(xué)錄信息:幫助界面:四、調(diào)試報(bào)告調(diào)試還算順利,只是一開(kāi)始容錯(cuò)方面做得比較簡(jiǎn)陋。后來(lái)改好了。再又就是一開(kāi)始功能比較少,后來(lái)慢慢一步步完善,變成現(xiàn)在這樣,還算可以用用的程序。五、總體小結(jié)經(jīng)過(guò)這么多天的編程,我了解到了要想完成一個(gè)比較大的程序,需要先根據(jù)程序的要求,確定設(shè)計(jì)思路,畫出流程圖,把想要用到的函數(shù)都寫出其函數(shù)原型說(shuō)明。然后根據(jù)自己已經(jīng)寫好的函數(shù)原型說(shuō)明。一步步把函數(shù)都實(shí)現(xiàn)。即分別寫出每一個(gè)功能所需要的具體的函數(shù)。這樣,有一個(gè)清晰的思路,就比較有調(diào)理,有了調(diào)理,也不容易忘記一些想要實(shí)現(xiàn)的東西。然后,才會(huì)有一個(gè)層次分明,客戶友好的程序。另外,類的封裝和雙向鏈表弄起來(lái)還是比較繁瑣的。但是,把問(wèn)題一個(gè)個(gè)搞清楚以后,問(wèn)題就自然而然的被簡(jiǎn)化了。另外編程序還要注重細(xì)節(jié),任意一個(gè)看似細(xì)微的的錯(cuò)誤,都可能會(huì)引起一連串的error,所以每次從鍵盤讀入數(shù)據(jù)或者數(shù)據(jù)的處理的環(huán)節(jié)都要注意合法性的檢查。最后不得不提的是,我加入ACM隊(duì),在暑假做了大量的題目聯(lián)系,所以在調(diào)試方面沒(méi)有出現(xiàn)什么打問(wèn)題,都算是比較輕松的過(guò)關(guān)了。熟練的寫程序,對(duì)我們著實(shí)是非常重要的!六、分工介紹獨(dú)立完成。#pragmaonce#include"student.h"structnode//鏈表node結(jié)點(diǎn){ student&stu; node*next; node*prev; node(student&s) :stu(s) { }};classguanli{public: node*head_ptr; node*tail_ptr; node*current_ptr; guanli(void); ~guanli(void); voidUserChoice(int);//用戶選擇 voidInsertRecord();//插入信息 voidInsertNode(node*);//插入新結(jié)點(diǎn) voidInsertNodeAtHead(node*);//插入頭結(jié)點(diǎn) voidInsertNodeAtEnd(node*);//插入尾結(jié)點(diǎn) voidShowList();//顯示所有信息 voidShowSortedList1();//顯示排序后鏈表1 voidShowSortedList2();//顯示排序后鏈表2 voidDeleteRecord();//刪除某條記錄 voidDeleteNodeAtHead();//刪除頭結(jié)點(diǎn) voidDeleteNodeAtEnd();//刪除尾結(jié)點(diǎn) voidDeleteNodeAtMiddle();//在中間刪除 voidDeleteNode();//刪除某個(gè)節(jié)點(diǎn) voidChangeMes();//修改信息函數(shù) boolVerifyDelete();//確認(rèn)刪除 voidDeleteList();//釋放鏈表,保存至文件 voidSearchChoice();//選擇查找方式 voidASearchByName();//A方式中的名字查找 voidASearchByStuNum();//A方式中的學(xué)號(hào)查找 voidASearchByDormNum();//A方式中的整個(gè)宿舍查找 voidBSearchByStuNum();//B方式,按學(xué)號(hào)顯示個(gè)人詳細(xì)信息 voidLoadFile();//讀取文件 voidSaveFile();//存至文件 voidHelp();//幫助提示函數(shù) voidUserInput();//用戶輸入備用};#include"guanli.h"#include<iostream>usingnamespacestd;guanli::guanli(void){}guanli::~guanli(void){}voidguanli::UserChoice(intt){ switch(t) { case0: InsertRecord();//添加結(jié)點(diǎn)(OK) break; case1: ShowList();//顯示所有結(jié)點(diǎn)信息(OK) break; case2: DeleteRecord();//刪除記錄(OK) break; case3: SearchChoice();//查找記錄(OK) break; case4: ChangeMes(); break; case5: Help();//幫助文件 break; case6: SaveFile(); if(head_ptr!=NULL) DeleteList(); break; default: cout<<"選擇無(wú)效,請(qǐng)重新輸入:"; break; }}voidguanli::InsertRecord(){ chartt[15]; chartemp_memory[300]; student*s=newstudent; node*new_ptr=newnode(*s); if(new_ptr!=NULL) { system("cls"); cout<<"同學(xué)姓名:"; cin>>new_ptr->stu.fri_name; cout<<"郵箱:"; cin>>new_ptr->stu.e_mail; cout<<"性別:"; cin>>new_ptr->stu.sex; cout<<"號(hào)碼:"; cin>>new_ptr->stu.phone_num; cout<<"珍貴回憶有(請(qǐng)輸入一句話,不含空格,可用逗號(hào)分隔):"; cin>>new_ptr->stu.memory; InsertNode(new_ptr); cin.ignore(20,'\n'); cout<<"是否繼續(xù)添加?Y/N"<<endl; charte[30]; cin.getline(te,30); if(!strcmp(te,"Y")||!strcmp(te,"y"))InsertRecord(); } else cout<<"申請(qǐng)內(nèi)存空間失敗,不能創(chuàng)建新結(jié)點(diǎn)??!\n";// system("cls");}voidguanli::InsertNode(node*new_ptr){ //system("cls"); node*temp_ptr; //若鏈表為空 if(head_ptr==NULL) { new_ptr->next=new_ptr; new_ptr->prev=new_ptr; head_ptr=new_ptr; tail_ptr=new_ptr; return; } //只有一個(gè)節(jié)點(diǎn) if(head_ptr->next==head_ptr) { if(new_ptr->stu.fri_name<head_ptr->stu.fri_name) InsertNodeAtHead(new_ptr); else InsertNodeAtEnd(new_ptr); return; } //多個(gè)節(jié)點(diǎn),自動(dòng)按姓名排序插入 if(head_ptr->next!=head_ptr) { current_ptr=head_ptr->next; while((new_ptr->stu.fri_name>current_ptr->stu.fri_name)//比較姓名進(jìn)行排序 &&(current_ptr!=head_ptr))//并且當(dāng)前結(jié)點(diǎn)不是頭結(jié)點(diǎn)(雙向鏈表的頭尾是相連的) current_ptr=current_ptr->next;//繼續(xù)向后拓展結(jié)點(diǎn) if(current_ptr==head_ptr) InsertNodeAtEnd(new_ptr);//插入在鏈表尾 else { temp_ptr=current_ptr->prev;//此時(shí),插入的結(jié)點(diǎn)在current結(jié)點(diǎn)和temp結(jié)點(diǎn)之間 temp_ptr->next=new_ptr; new_ptr->prev=temp_ptr; current_ptr->prev=new_ptr; new_ptr->next=current_ptr; } }}voidguanli::InsertNodeAtEnd(node*new_ptr){ new_ptr->next=head_ptr; tail_ptr->next=new_ptr; new_ptr->prev=tail_ptr; head_ptr->prev=new_ptr; tail_ptr=new_ptr;}voidguanli::InsertNodeAtHead(node*new_ptr){ new_ptr->next=head_ptr; new_ptr->prev=tail_ptr; head_ptr->prev=new_ptr; tail_ptr->next=new_ptr; tail_ptr=new_ptr;}#include"guanli.h"#include<iostream>#include<iomanip>usingnamespacestd;voidguanli::ShowList(){ system("cls"); intn; cout<<"\t\t\t下面將顯示所有同學(xué)錄信息\n\n\t\t\t請(qǐng)輸入每屏幕顯示學(xué)生的個(gè)數(shù)\n\n\t\t\t每顯示一屏幕暫停一次\n\n\t\t\t輸入的數(shù)不大于20:\n"; cin>>n; system("cls"); inti; current_ptr=head_ptr; if(current_ptr!=NULL) do { i=1; cout<<setw(14)<<"姓名"<<setw(8)<<"性別"<<setw(30)<<"郵箱"<<setw(20)<<"號(hào)碼"<<endl<<endl; do { cout<<setw(14)<<current_ptr->stu.fri_name<<setw(8)<<current_ptr->stu.sex; cout<<setw(30)<<current_ptr->stu.e_mail<<setw(20)<<current_ptr->stu.phone_num<<endl; current_ptr=current_ptr->next; i++; }while(current_ptr!=head_ptr&&i<=n); cout<<endl<<endl; if(current_ptr!=head_ptr) { system("pause"); system("cls"); } elsecout<<"文件結(jié)束!"<<endl; }while(current_ptr!=head_ptr); else { cout<<"同學(xué)錄為空!"<<endl; } system("pause"); system("cls");}voidguanli::SearchChoice(){ charn; cout<<endl<<"輸入數(shù)字鍵選擇你所要進(jìn)行的操作:"<<endl<<endl; cout<<"\t\t\t1:姓名查詢"<<endl<<endl; cout<<"\t\t\t2:姓名缺省查詢(姓氏,名字部分查詢)"<<endl<<endl; cout<<"\t\t\t3:記憶片段查詢"<<endl<<endl; cout<<"\t\t\t4:退出查詢"<<endl<<endl; cout<<"輸入你的選擇:"<<endl; cin>>n; while(n!='4') { switch(n) { case'1': ASearchByStuNum(); break; case'2': ASearchByName(); break; case'3': ASearchByDormNum(); break; default: cout<<"對(duì)不起,您輸入的查詢方式尚未做出,請(qǐng)重新輸入:"; break; } cout<<"輸入0顯示菜單,輸入5退出查詢,其他任意鍵繼續(xù)查詢:"<<endl; charpp; cin>>pp; if(pp=='0') { cout<<endl<<"輸入數(shù)字鍵選擇你所要進(jìn)行的操作:"<<endl<<endl; cout<<"\t\t\t1:姓名查詢"<<endl<<endl; cout<<"\t\t\t2:姓名缺省查詢(姓氏,名字部分查詢)"<<endl<<endl; cout<<"\t\t\t3:記憶片段查詢"<<endl<<endl; cout<<"\t\t\t4:退出查詢"<<endl<<endl; cout<<"輸入你的選擇:"<<endl; cin>>n; } elseif(pp=='4')n='4'; system("cls"); }}voidguanli::ASearchByStuNum(){ system("cls"); boolnFlag=0; stringsearch_str; current_ptr=head_ptr; if(current_ptr==NULL) cout<<"學(xué)生記錄為空"<<endl; else { cin.ignore(20,'\n'); cout<<"\n輸入你要搜索的同學(xué)姓名:"; cin>>search_str; if(current_ptr->stu.fri_name==search_str) { nFlag=1; cout<<"姓名:"<<current_ptr->stu.fri_name<<"\t性別:"<<current_ptr->stu.sex; cout<<"\t:"<<current_ptr->stu.phone_num<<"\t郵箱:"<<current_ptr->stu.e_mail<<endl; cout<<"珍貴回憶:\n"<<current_ptr->stu.memory<<endl; } else { current_ptr=current_ptr->next; while(current_ptr!=head_ptr) { if(current_ptr->stu.fri_name==search_str) { nFlag=1; cout<<"姓名:"<<current_ptr->stu.fri_name<<"\t性別:"<<current_ptr->stu.sex; cout<<"\t:"<<current_ptr->stu.phone_num<<"\t郵箱:"<<current_ptr->stu.e_mail<<endl; cout<<"珍貴回憶:\n"<<current_ptr->stu.memory<<endl; break; } current_ptr=current_ptr->next; } } if(!nFlag)//搜索完所有結(jié)點(diǎn)都沒(méi)發(fā)現(xiàn) { cout<<"無(wú)記錄!"<<endl; system("pause"); system("cls"); } }}voidguanli::ASearchByName(){ system("cls"); boolnFlag=0; stringsearch_str; current_ptr=head_ptr; if(current_ptr==NULL) cout<<"同學(xué)錄為空"<<endl; else { cin.ignore(20,'\n'); cout<<"\n輸入你要搜索的同學(xué)的姓或名或其中的一部分:"; cin>>search_str; if(current_ptr->stu.fri_name.find(search_str)!=string::npos) { if(!nFlag)cout<<"找到記錄\n"; nFlag=1; cout<<"姓名:"<<current_ptr->stu.fri_name<<"\t性別:"<<current_ptr->stu.sex; cout<<"\t:"<<current_ptr->stu.phone_num<<"\t郵箱:"<<current_ptr->stu.e_mail<<endl; cout<<"珍貴回憶:\n"<<current_ptr->stu.memory<<endl<<endl; } current_ptr=current_ptr->next; while(current_ptr!=head_ptr) { if(current_ptr->stu.fri_name.find(search_str)!=string::npos) { if(!nFlag)cout<<"找到記錄\n"; nFlag=1; cout<<"姓名:"<<current_ptr->stu.fri_name<<"\t性別:"<<current_ptr->stu.sex; cout<<"\t:"<<current_ptr->stu.phone_num<<"\t郵箱:"<<current_ptr->stu.e_mail<<endl; cout<<"珍貴回憶:\n"<<current_ptr->stu.memory<<endl<<endl; } current_ptr=current_ptr->next; } if(!nFlag)//搜索完所有結(jié)點(diǎn)都沒(méi)發(fā)現(xiàn) { cout<<"無(wú)記錄!"<<endl; system("pause"); system("cls"); } }}voidguanli::ASearchByDormNum(){ system("cls"); boolnFlag=0; stringsearch_str; current_ptr=head_ptr; if(current_ptr==NULL) cout<<"學(xué)生記錄為空"<<endl; else { cin.ignore(20,'\n'); cout<<"\n輸入你對(duì)那個(gè)同學(xué)的記憶(即你當(dāng)初輸入的一句話里面的幾個(gè)詞語(yǔ)):"; cin>>search_str; if(current_ptr->stu.memory.find(search_str)!=string::npos) { if(!nFlag)cout<<"找到記錄\n"; nFlag=1; cout<<"姓名:"<<current_ptr->stu.fri_name<<"\t性別:"<<current_ptr->stu.sex; cout<<"\t:"<<current_ptr->stu.phone_num<<"\t郵箱:"<<current_ptr->stu.e_mail<<endl; cout<<"珍貴回憶:\n"<<current_ptr->stu.memory<<endl<<endl; } current_ptr=current_ptr->next; while(current_ptr!=head_ptr) { if(current_ptr->stu.memory.find(search_str)!=string::npos) { if(!nFlag)cout<<"找到記錄\n"; nFlag=1; cout<<"姓名:"<<current_ptr->stu.fri_name<<"\t性別:"<<current_ptr->stu.sex; cout<<"\t:"<<current_ptr->stu.phone_num<<"\t郵箱:"<<current_ptr->stu.e_mail<<endl; cout<<"珍貴回憶:\n"<<current_ptr->stu.memory<<endl<<endl; } current_ptr=current_ptr->next; } if(!nFlag)//搜索完所有結(jié)點(diǎn)都沒(méi)發(fā)現(xiàn) { cout<<"無(wú)記錄!"<<endl; system("pause"); system("cls"); } }}#include"guanli.h"#include<iostream>#include<iomanip>usingnamespacestd;voidguanli::DeleteRecord(){ system("cls"); stringsearch_string; node*previous_ptr=NULL; current_ptr=head_ptr; if(current_ptr==NULL) { cout<<"沒(méi)有你要?jiǎng)h除的記錄!"<<endl; return; } cin.ignore(20,'\n'); intnFlag=0; boolask=0; charn[30]; cout<<"\t\t是否需要先根據(jù)查找來(lái)查看所要?jiǎng)h除的同學(xué)完整姓名?Y/N"<<endl; cin.getline(n,30); if(!strcmp(n,"y")||!strcmp(n,"Y"))SearchChoice(); cout<<"\n輸入你要?jiǎng)h除的同學(xué)完整姓名:\n"; cin>>search_string; while((current_ptr->stu.fri_name==search_string)&&head_ptr!=NULL) { nFlag=1; cout<<"\n找到記錄\n"; cout<<"姓名:"<<current_ptr->stu.fri_name<<"\t性別:"<<current_ptr->stu.sex; cout<<"\t郵箱:"<<current_ptr->stu.e_mail<<"\t:"<<current_ptr->stu.phone_num<<endl; cout<<"珍貴回憶:\n"<<current_ptr->stu.memory<<endl; if(VerifyDelete())//向用戶詢問(wèn)是否真的要?jiǎng)h除 { DeleteNode(); cout<<"\n記錄已刪除!\n"; } else { cout<<"姓名為:"<<current_ptr->stu.fri_name<<"\t的記錄沒(méi)有刪除"<<endl; current_ptr=current_ptr->next; } } do { if(current_ptr->stu.fri_name==search_string) { nFlag=1; cout<<"\n找到記錄\n"; cout<<"姓名:"<<current_ptr->stu.fri_name<<"\t性別:"<<current_ptr->stu.sex; cout<<"\t郵箱:"<<current_ptr->stu.e_mail<<"\t:"<<current_ptr->stu.phone_num<<endl; cout<<"珍貴回憶:\n"<<current_ptr->stu.memory<<endl; if(VerifyDelete())//向用戶詢問(wèn)是否真的要?jiǎng)h除 { DeleteNode(); cout<<"\n記錄已刪除!\n"; } else { cout<<"姓名為:"<<current_ptr->stu.fri_name<<"\t的記錄沒(méi)有刪除"<<endl; } } current_ptr=current_ptr->next; }while(current_ptr!=head_ptr||head_ptr==NULL); if(!nFlag)cout<<"\n沒(méi)有找到相符的記錄也沒(méi)有刪除記錄。\n"; cin.get(); system("cls");}voidguanli::Help(){help: charchoice2; system("cls"); cout<<"歡迎使用“幫助”,請(qǐng)輸入幫助類型:\n"; cout<<"1:此程序有哪些功能?"<<endl; cout<<"2:如何一次性刪除所有記錄?"<<endl; cout<<"3:此程序關(guān)閉后我的記錄存在哪里?為什么我修改的記錄沒(méi)有被保存?"<<endl; cout<<"4:為什么有時(shí)候我的程序會(huì)突然死掉?"<<endl; cout<<"5:何時(shí)會(huì)有更完善的版本出現(xiàn)?"<<endl; cout<<"6:此程序的作者信息?"<<endl; cout<<"7:退出幫助。"<<endl; cin>>choice2; switch(choice2) { case'1': cout<<"此程序?yàn)橐粋€(gè)同學(xué)錄系統(tǒng),由雙向鏈表實(shí)現(xiàn)。"<<endl; cout<<"具體的話可以查看菜單。"<<endl; cout<<"謝謝您使用本程序!"<<endl; system("pause"); system("cls"); gotohelp; break; case'2': cout<<"請(qǐng)退出本程序后手動(dòng)刪除一個(gè)名為xuejiguanli.txt的文件,謝謝~"<<endl; system("pause"); system("cls"); gotohelp; break; case'3': cout<<"在一個(gè)名為xuejiguanli.txt的文件里面"<<endl; cout<<"只有正常關(guān)閉才會(huì)保存,在運(yùn)行途中強(qiáng)行關(guān)閉,程序?qū)⒉粚?duì)原有文件做任何修改"<<endl; system("pause"); system("cls"); gotohelp; break; case'4': cout<<"目前本程序在輸入有誤方面的容錯(cuò)處理可能還不夠完善,有時(shí)輸入太多非法數(shù)據(jù)可能導(dǎo)致程序死機(jī)"; cout<<"所以,請(qǐng)規(guī)范您的操作,并注意輸入的正確,謝謝您的配合。"<<endl; system("pause"); system("cls"); gotohelp; break; case'5': cout<<"下一屆課程設(shè)計(jì)必然有更強(qiáng)大的學(xué)弟學(xué)妹來(lái)完善它。"<<endl; system("pause"); system("cls"); gotohelp; break; case'6': cout<<"Author:計(jì)科三班,孫健波。\n學(xué)號(hào):0906840330\n"; cout<<"謝謝您的使用~~"<<endl; system("pause"); system("cls"); gotohelp; break; default: system("pause"); break; }}boolguanli::VerifyDelete(){ charv[100]; cout<<"\n確認(rèn)?(Y/N)"; scanf("%s",v); cin.ignore(20,'\n'); if(!strcmp(v,"y")||!strcmp(v,"Y"))returntrue; elsereturnfalse;}voidguanli::DeleteNode(){ if(current_ptr==head_ptr) DeleteNodeAtHead(); else if(current_ptr->next==head_ptr) DeleteNodeAtEnd(); else DeleteNodeAtMiddle();}voidguanli::DeleteNodeAtHead(){ if(head_ptr->next!=head_ptr) { head_ptr=current_ptr->next; tail_ptr->next=head_ptr; head_ptr->prev=tail_ptr; deletecurrent_ptr; current_ptr=head_ptr; } else { head_ptr=NULL; tail_ptr=NULL; deletecurrent_ptr; }}voidguanli::DeleteNodeAtEnd(){ node*previous_ptr=current_ptr->prev; deletecurrent_ptr; previous_ptr->next=head_ptr; head_ptr->prev=previous_ptr; tail_ptr=previous_ptr; current_ptr=tail_ptr;}voidguanli::DeleteNodeAtMiddle(){ node*previous_ptr=current_ptr->prev; previous_ptr->next=current_ptr->next; current_ptr->next->prev=previous_ptr; deletecurrent_ptr; current_ptr=previous_ptr;}voidguanli::DeleteList(){ node*temp_ptr; current_ptr=head_ptr; do { temp_ptr=current_ptr->next; tail_ptr->next=temp_ptr; temp_ptr->prev=tail_ptr; deletecurrent_ptr; current_ptr=temp_ptr; }while(temp_ptr!=NULL&&temp_ptr!=tail_ptr); deletecurrent_ptr;}#include"guanli.h"#include<iomanip>#include<iostream>#include<fstream>#include<string>usingnamespacestd;voidguanli::SaveFile(){ fstreamoutfile; outfile.open("classmate.txt",ios::out); if(outfile) { current_ptr=head_ptr; if(head_ptr!=NULL) { do { outfile<<setw(14)<<current_ptr->stu.fri_name<<setw(30)<<current_ptr->stu.e_mail; outfile<<setw(5)<<current_ptr->stu.sex<<setw(20)<<current_ptr->stu.phone_num<<'\t'; outfile<<current_ptr->stu.memory<<endl; current_ptr=current_ptr->next; }while(current_ptr!=head_ptr); } outfile<<"文件結(jié)束"<<endl; outfile.close(); } else cout<<"打開(kāi)文件出錯(cuò)!"<<endl;}voidguanli::LoadFile(){ fstreaminfile; boole_loop=0; infile.open("classmate.txt",ios::in); if(infile) { do { student*s=newstudent; node*new_ptr=newnode(*s); if(new_ptr!=NULL) { infile>>new_ptr->stu.fri_name; if((new_ptr->stu.fri_name!="")&& (new_ptr->stu.fri_name!="文件結(jié)束")) { infile>>new_ptr->stu.e_mail; infile>>new_ptr->stu.sex; infile>>new_ptr->stu.phone_num; infile>>new_ptr->stu.memory; infile.ignore(20,'\n'); InsertNode(new_ptr); } else { deletenew_ptr; e_loop=1; } } else { cout<<"!警告:沒(méi)有成功地從磁盤導(dǎo)入文件。"<<endl; e_loop=1; } }while(!e_loop); infile.close(); } else cout<<"沒(méi)有可用的數(shù)據(jù)文件,記錄表為空。"<<endl;}voidguanli::ChangeMes(){ //system("pause"); stringsearch_string; if(head_ptr==NULL) { cout<<"鏈表為空,無(wú)記錄!"<<endl; return; } intnFlag=0; cout<<"\t\t\t修改記錄需要輸入同學(xué)姓名\n\n\t\t\t是否需要查找學(xué)生的學(xué)號(hào)?(Y/N):"; charn[30]; cin.getline(n,30); if(!strcmp(n,"y")||!strcmp(n,"Y"))SearchChoice(); current_ptr=head_ptr; cin.ignore(20,'\n'); cout<<"\n輸入你想要修改記錄的學(xué)號(hào):"; cin>>search_string; student*s=newstudent; node*new_ptr; while((current_ptr->stu.fri_name==search_string)&&head_ptr!=NULL) { node*new_ptr=newnode(*s); nFlag=1; cout<<"\n找到記錄\n"; cout<<"姓名:"<<current_ptr->stu.fri_name<<"\t性別:"<<current_ptr->stu.sex; cout<<"\t郵箱:"<<current_ptr->stu.e_mail<<"\t:"<<current_ptr->stu.phone_num<<endl; cout<<"珍貴回憶:\n"<<current_ptr->stu.memory<<endl; if(VerifyDelete()) {again1: cout<<"\t\t\t請(qǐng)輸入你要修改的項(xiàng)目:\n\n"; cout<<"\t\t\t1:姓名n\n"; cout<<"\t\t\t2:電子郵件\n\n"; cout<<"\t\t\t3:性別\n\n"; cout<<"\t\t\t4:號(hào)碼\n\n"; cout<<"\t\t\t5:珍貴回憶\n\n"; charchange_temp[100]; cin.getline(change_temp,100); intsize=strlen(change_temp); if(size!=1) { cout<<"輸入有誤,請(qǐng)重新輸入:"<<endl; system("pause"); gotoagain1; } charch=change_temp[0]; switch(ch) { case'1': cout<<"原記錄的姓名為:"<<current_ptr->stu.fri_name<<endl; cout<<"請(qǐng)輸入新記錄的姓名為:"; cin>>new_ptr->stu.fri_name; new_ptr->stu.e_mail=current_ptr->stu.e_mail; new_ptr->stu.sex=current_ptr->stu.sex; new_ptr->stu.phone_num=current_ptr->stu.phone_num; new_ptr->stu.memory=current_ptr->stu.memory; break; case'2': cout<<"原紀(jì)錄的電子郵件為:"<<current_ptr->stu.e_mail<<endl; cout<<"請(qǐng)輸入新記錄的電子郵件為:"; cin>>new_ptr->stu.e_mail; new_ptr->stu.fri_name=current_ptr->stu.fri_name; new_ptr->stu.sex=current_ptr->stu.sex; new_ptr->stu.phone_num=current_ptr->stu.phone_num; new_ptr->stu.memory=current_ptr->stu.memory; break; case'3': cout<<"原紀(jì)錄的性別為:"<<current_ptr->stu.sex<<endl; cout<<"請(qǐng)輸入新記錄的性別:"; cin>>new_ptr->stu.sex; new_ptr->stu.fri_name=current_ptr->stu.fri_name; new_ptr->stu.e_mail=current_ptr->stu.e_mail; new_ptr->stu.phone_num=current_ptr->stu.phone_num; new_ptr->stu.memory=current_ptr->stu.memory; break; case'4': cout<<"原紀(jì)錄的號(hào)碼為:"<<current_ptr->stu.phone_num<<endl; cout<<"請(qǐng)輸入新記錄的號(hào)碼:"; cin>>new_ptr->stu.phone_num; new_ptr->stu.fri_name=current_ptr->stu.fri_name; new_ptr->stu.e_mail=current_ptr->stu.e_mail; new_ptr->stu.sex=current_ptr->stu.sex; new_ptr->stu.memory=current_ptr->stu.memory; break; case'5': cout<<"原紀(jì)錄的宿舍號(hào)為:"<<current_ptr->stu.memory<<endl; cout<<"請(qǐng)輸入新記錄的宿舍號(hào):"; cin>>new_ptr->stu.memory; new_ptr->stu.fri_name=current_ptr->stu.fri_name; new_ptr->stu.e_mail=current_ptr->stu.e_mail; new_ptr->stu.sex=current_ptr->stu.sex; new_ptr->stu.phone_num=current_ptr->stu.phone_num; break; default: cout<<"輸入有誤,請(qǐng)重新輸入:"<<endl; gotoagain1; break; } if(VerifyDelete()) { DeleteNode(); InsertNode(new_ptr); cout<<"\n記錄已修改\n"; cout<<"姓名:"<<new_ptr->stu.fri_name<<"\t性別:"<<new_ptr->stu.sex; cout<<"\t郵箱:"<<new_ptr->stu.e_mail<<"\t:"<<new_ptr->stu.phone_num<<endl; cout<<"珍貴回憶:\n"<<new_ptr->stu.memory<<endl; current_ptr=head_ptr; } } else//用戶沒(méi)有確定要修改,則要?jiǎng)h除臨時(shí)結(jié)點(diǎn) { cout<<"姓名為:"<<current_ptr->stu.fri_name<<"\t的記錄沒(méi)有被修改"; current_ptr=current_ptr->next; deletenew_ptr; } } do { if(current_ptr->stu.fri_name==search_string) { nFlag=1; node*new_ptr=newnode(*s); cout<<"\n找到記錄\n"; cout<<"姓名:"<<current_ptr->stu.fri_name<<"\t性別:"<<current_ptr->stu.sex; cout<<"\t郵箱:"<<current_ptr->stu.e_mail<<"\t:"<<current_ptr->stu.phone_num<<endl; cout<<"珍貴回憶:\n"<<current_ptr->stu.memory<<endl; if(VerifyDelete()) {again2: cout<<"\t\t\t請(qǐng)輸入你要修改的項(xiàng)目:\n\n"; cout<<"\t\t\t1:姓名n\n"; cout<<"\t\t\t2:電子郵件\n\n"; cout<<"\t\t\t3:性別\n\n"; cout<<"\t\t\t4:號(hào)碼\n\n"; cout<<"\t\t\t5:珍貴回憶\n\n"; charchange_temp[100]; cin.getline(change_temp,100); intsize=strlen(change_temp); if(size!=1) { cout<<"輸入有誤,請(qǐng)重新輸入:"<<endl; system("pause"); gotoagain2; } charch=change_temp[0]; switch(ch) { case'1': cout<<"原記錄的姓名為:"<<current_ptr->stu.fri_name<<endl; cout<<"請(qǐng)輸入新記錄的姓名為:"; cin>>new_ptr->stu.fri_name; new_ptr->stu.e_mail=current_ptr->stu.e_mail; new_ptr->stu.sex=current_ptr->stu.sex; new_ptr->stu.phone_num=current_ptr->stu.phone_num; new_ptr->stu.memory=current_ptr->stu.memory; break; case'2': cout<<"原紀(jì)錄的電子郵件為:"<<current_ptr->stu.e_mail<<endl; cout<<"請(qǐng)輸入新記錄的電子郵件為:"; cin>>new_ptr->stu.e_mail; new_ptr->stu.fri_name=current_ptr->stu.fri_name; new_ptr->stu.sex=current_ptr->stu.sex; new_ptr->stu.phone_num=current_ptr->stu.phone_num; new_ptr->stu.memory=current_ptr->stu.memory; break; case'3': cout<<"原紀(jì)錄的性別為:"<<current_ptr->stu.sex<<endl; cout<<"請(qǐng)輸入新記錄的性別:"; cin>>new_ptr->stu.sex; new_ptr->stu.fri_name=current_ptr->stu.fri_name; new_ptr->stu.e_mail=current_ptr->stu.e_mail; new_ptr->stu.phone_num=current_ptr->stu.phone_num; new_ptr->stu.memory=current_ptr->stu.memory; break; case'4': cout<<"原紀(jì)錄的號(hào)碼為:"<<current_ptr->stu.phone_num<<endl; cout<<"請(qǐng)輸入新記錄的號(hào)碼:"; cin>>new_ptr->stu.phone_num; new_ptr->stu.fri_name=current_ptr->stu.fri_name; new_ptr->stu.e_mail=current_ptr->stu.e_mail; new_ptr->stu.sex=current_ptr->stu.sex; new_ptr->stu.memory=current_ptr->stu.memory; break; case'5': cout<<"原紀(jì)錄的宿舍號(hào)為:"<<current_ptr->stu.memory<<endl; cout<<"請(qǐng)輸入新記錄的宿舍號(hào):"; cin>>new_ptr->stu.memory; new_ptr->stu.fri_name=current_ptr->stu.fri_name; new_ptr->stu.e_mail=current_ptr->stu.e_mail; new_ptr->stu.sex=current_ptr->stu.sex; new_ptr->stu.phone_num=current_ptr->stu.phone_num; break; default: cout<<"輸入有誤,請(qǐng)重新輸入:"<<endl; gotoagain2; break; } if(VerifyDelete()) { DeleteNode(); InsertNode(new_ptr); cout<<"\n記錄已修改\n"; cout<<"姓名:"<<new_ptr->stu.fri_name<<"\t性別:"<<new_ptr->stu.sex; cout<<"\t郵箱:"<<new_ptr->stu.e_mail<<"\t:"<<new_ptr->stu.phone_num<<endl; cout<<"珍貴回憶:\n"<<new_ptr->stu.memory<<endl; current_ptr=head_ptr; } } else//用戶沒(méi)有確定要修改,則要?jiǎng)h除臨時(shí)結(jié)點(diǎn) { cout<<"姓名為:"<<current_ptr->stu.fri_name<<"\t的記錄沒(méi)有被修改"; deletenew_ptr; } } current_ptr=current_ptr->next; }while((current_ptr!=head_ptr||head_ptr==NULL)); if(nFlag==0) { cout<<"找不到相符合的記錄\n"; UserInput(); } //system("pause");}voidguanli::UserInput(){ charanswer; cout<<"再試一次?y/n:"; cin.get(answer); if(answer=='y'||answer=='n') { if(answer=='y') ChangeMes(); } else { cout<<"輸入無(wú)效字符"; UserInput(); }}#include"student.h"#include<iostream>usingnamespacestd;student::student(void){ fri_name=phone_num=e_mail=sex=memory="";}student::~student(void){}#pragmaonce#include<string>#include<iostream>usingnamespacestd;classstudent{ stringfri_name;//姓名 stringe_mail;//郵箱 stringsex;//性別 stringmemory;//記憶 stringphone_num;//號(hào)碼public: student(void); ~student(void); friendclassguanli; friendstructnode;};#include<iostream>#include"guanli.h"usingnamespacestd;charpause;intmain(){ guanlimyguanli; cout<<endl<<endl<<"歡迎使用BOBO版同學(xué)錄系統(tǒng)系統(tǒng)"<<endl<<endl; system("pause");//暫停 system("cls");//清屏 intchoice; myguanli.head_ptr=myguanli.tail_ptr=NULL; myguanli.LoadFile();//文件讀入 do { system("cls");//清屏 cout<<endl<<endl<<"輸入數(shù)字鍵選擇你所要進(jìn)行的操作:"<<endl<<endl; cout<<"0:新增一個(gè)同學(xué)錄信息"<<endl<<endl; cout<<"1:顯示同學(xué)錄所有數(shù)據(jù)"<<endl<<endl; cout<<"2:刪除操作"<<endl<<endl; cout<<"3:查詢操作"<<endl<<endl; cout<<"4:修改同學(xué)錄"<<endl<<endl; cout<<"5:尋求幫助"<<endl<<endl; cout<<"6:退出程序"<<endl<<endl; cout<<"輸入你的選擇:"<<endl; cin>>choice; myguanli.UserChoice(choice); }while(choice!=6); return0;}
咖啡店創(chuàng)業(yè)計(jì)劃書第一部分:背景在中國(guó),人們?cè)絹?lái)越愛(ài)喝咖啡。隨之而來(lái)的咖啡文化充滿生活的每個(gè)時(shí)刻。無(wú)論在家里、還是在辦公室或各種社交場(chǎng)合,人們都在品著咖啡??Х戎饾u與時(shí)尚、現(xiàn)代生活聯(lián)系在一齊。遍布各地的咖啡屋成為人們交談、聽(tīng)音樂(lè)、休息的好地方,咖啡豐富著我們的生活,也縮短了你我之間的距離,咖啡逐漸發(fā)展為一種文化。隨著咖啡這一有著悠久歷史飲品的廣為人知,咖啡正在被越來(lái)越多的中國(guó)人所理解。第二部分:項(xiàng)目介紹第三部分:創(chuàng)業(yè)優(yōu)勢(shì)目前大學(xué)校園的這片市場(chǎng)還是空白,競(jìng)爭(zhēng)壓力小。而且前期投資也不是很高,此刻國(guó)家鼓勵(lì)大學(xué)生畢業(yè)后自主創(chuàng)業(yè),有一系列的優(yōu)惠政策以及貸款支持。再者大學(xué)生往往對(duì)未來(lái)充滿期望,他們有著年輕的血液、蓬勃的朝氣,以及初生牛犢不怕虎的精神,而這些都是一個(gè)創(chuàng)業(yè)者就應(yīng)具備的素質(zhì)。大學(xué)生在學(xué)校里學(xué)到了很多理論性的東西,有著較高層次的技術(shù)優(yōu)勢(shì),現(xiàn)代大學(xué)生有創(chuàng)新精神,有對(duì)傳統(tǒng)觀念和傳統(tǒng)行業(yè)挑戰(zhàn)的信心和欲望,而這種創(chuàng)新精神也往往造就了大學(xué)生創(chuàng)業(yè)的動(dòng)力源泉,成為成功創(chuàng)業(yè)的精神基礎(chǔ)。大學(xué)生創(chuàng)業(yè)的最大好處在于能提高自己的潛力、增長(zhǎng)經(jīng)驗(yàn),以及學(xué)以致用;最大的誘人之處是透過(guò)成功創(chuàng)業(yè),能夠?qū)崿F(xiàn)自己的理想,證明自己的價(jià)值。第四部分:預(yù)算1、咖啡店店面費(fèi)用咖啡店店面是租賃建筑物。與建筑物業(yè)主經(jīng)過(guò)協(xié)商,以合同形式達(dá)成房屋租賃協(xié)議。協(xié)議資料包括房屋地址、面積、結(jié)構(gòu)、使用年限、租賃費(fèi)用、支付費(fèi)用方法等。租賃的優(yōu)點(diǎn)是投資少、回收期限短。預(yù)算10-15平米店面,啟動(dòng)費(fèi)用大約在9-12萬(wàn)元。2、裝修設(shè)計(jì)費(fèi)用咖啡店的滿座率、桌面的周轉(zhuǎn)率以及氣候、節(jié)日等因素對(duì)收益影響較大。咖啡館的消費(fèi)卻相對(duì)較高,主要針對(duì)的也是學(xué)生人群,咖啡店布局、格調(diào)及采用何種材料和咖啡店效果圖、平面圖、施工圖的設(shè)計(jì)費(fèi)用,大約6000元左右3、裝修、裝飾費(fèi)用具體費(fèi)用包括以下幾種。(1)外墻裝飾費(fèi)用。包括招牌、墻面、裝飾費(fèi)用。(2)店內(nèi)裝修費(fèi)用。包括天花板、油漆、裝飾費(fèi)用,木工、等費(fèi)用。(3)其他裝修材料的費(fèi)用。玻璃、地板、燈具、人工費(fèi)用也應(yīng)計(jì)算在內(nèi)。整體預(yù)算按標(biāo)準(zhǔn)裝修費(fèi)用為360元/平
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 財(cái)務(wù)內(nèi)部監(jiān)督及費(fèi)用審核制度
- 落實(shí)廉政談心談話制度
- 用友軟件介紹
- 學(xué)校警務(wù)室建設(shè)方案
- 2026福建廈門工學(xué)院誠(chéng)聘軍隊(duì)院校退役高層次人才參考考試試題附答案解析
- 2026吉林大學(xué)第二醫(yī)院勞務(wù)派遣制病案管理崗位人員12人參考考試題庫(kù)附答案解析
- 2026年上半年黑龍江省農(nóng)業(yè)科學(xué)院事業(yè)單位公開(kāi)招聘工作人員50人參考考試試題附答案解析
- 六年級(jí)語(yǔ)文下冊(cè)aer閱讀素養(yǎng)專訓(xùn) 四
- 2026湖南湖南農(nóng)業(yè)發(fā)展投資集團(tuán)有限責(zé)任公司招聘3人參考考試題庫(kù)附答案解析
- 2026廣東浩傳管理服務(wù)有限公司招聘10人參考考試題庫(kù)附答案解析
- 2026年自動(dòng)駕駛政策法規(guī)報(bào)告
- 2026年輔警招聘考試試題庫(kù)附答案【完整版】
- 浙江省《檢驗(yàn)檢測(cè)機(jī)構(gòu)技術(shù)負(fù)責(zé)人授權(quán)簽字人》考試題及答案
- 新媒體評(píng)論管理制度規(guī)范(3篇)
- 2025課堂懲罰 主題班會(huì):馬達(dá)加斯加企鵝課堂懲罰 課件
- 建筑施工風(fēng)險(xiǎn)辨識(shí)與防范措施
- 浙江省杭州地區(qū)六校2026屆化學(xué)高一第一學(xué)期期末學(xué)業(yè)水平測(cè)試試題含解析
- 2025年CFA二級(jí)估值與財(cái)務(wù)報(bào)表分析試卷(含答案)
- 2025年宜昌化學(xué)真題試卷及答案
- 醫(yī)療質(zhì)量安全培訓(xùn)計(jì)劃
- GB/T 39693.4-2025硫化橡膠或熱塑性橡膠硬度的測(cè)定第4部分:用邵氏硬度計(jì)法(邵爾硬度)測(cè)定壓入硬度
評(píng)論
0/150
提交評(píng)論