VisualC++6.0實(shí)驗(yàn)報(bào)告電話簿管理程序設(shè)計(jì)_第1頁(yè)
VisualC++6.0實(shí)驗(yàn)報(bào)告電話簿管理程序設(shè)計(jì)_第2頁(yè)
VisualC++6.0實(shí)驗(yàn)報(bào)告電話簿管理程序設(shè)計(jì)_第3頁(yè)
VisualC++6.0實(shí)驗(yàn)報(bào)告電話簿管理程序設(shè)計(jì)_第4頁(yè)
VisualC++6.0實(shí)驗(yàn)報(bào)告電話簿管理程序設(shè)計(jì)_第5頁(yè)
已閱讀5頁(yè),還剩11頁(yè)未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、實(shí) 驗(yàn) 報(bào) 告課程名稱 面向?qū)ο蟪绦蛟O(shè)計(jì) 實(shí)驗(yàn)名稱 電話簿管理程序設(shè)計(jì) 實(shí)驗(yàn)類型 設(shè)計(jì)型 實(shí)驗(yàn)地點(diǎn) xxx 實(shí)驗(yàn)日期 xxx 指導(dǎo)教師 xxx 專 業(yè) xxx 班 級(jí) xxx 學(xué) 號(hào) xxx 姓 名 xxx 成 績(jī) 實(shí)驗(yàn)報(bào)告說明 1、 封面內(nèi)容(1)課程名稱:實(shí)驗(yàn)所屬的課程的名稱。(2)實(shí)驗(yàn)名稱:要用最簡(jiǎn)練的語(yǔ)言反映實(shí)驗(yàn)的內(nèi)容。要求與實(shí)驗(yàn)指導(dǎo)書中相一致。(3)實(shí)驗(yàn)類型:說明是驗(yàn)證型實(shí)驗(yàn)、設(shè)計(jì)型實(shí)驗(yàn)、創(chuàng)新型實(shí)驗(yàn)還是綜合型實(shí)驗(yàn)。2、正文內(nèi)容實(shí)驗(yàn)報(bào)告的正文內(nèi)容須包括以下內(nèi)容:(1)實(shí)驗(yàn)?zāi)康模耗康囊鞔_,要抓住重點(diǎn),符合實(shí)驗(yàn)指導(dǎo)書中的要求。(2)實(shí)驗(yàn)內(nèi)容:說明本實(shí)驗(yàn)的主要內(nèi)容。(3)實(shí)驗(yàn)原理:簡(jiǎn)要說明

2、本實(shí)驗(yàn)項(xiàng)目所涉及的理論知識(shí)。(4)實(shí)驗(yàn)環(huán)境:實(shí)驗(yàn)用的軟硬件環(huán)境(配置)。(5)實(shí)驗(yàn)方案:對(duì)于驗(yàn)證性型實(shí)驗(yàn),寫明依據(jù)何種原理、操作方法進(jìn)行實(shí)驗(yàn);對(duì)于設(shè)計(jì)型和綜合型實(shí)驗(yàn),寫明依據(jù)何種原理、操作方法進(jìn)行實(shí)驗(yàn),并畫出硬件組成圖、軟件流程圖、設(shè)計(jì)思路和設(shè)計(jì)方法,再配以相應(yīng)的文字說明;對(duì)于創(chuàng)新型實(shí)驗(yàn),除符合設(shè)計(jì)型和綜合型實(shí)驗(yàn)要求外,還應(yīng)注明其創(chuàng)新點(diǎn)、特色。(6)實(shí)驗(yàn)步驟:寫明實(shí)驗(yàn)的實(shí)施步驟,包括實(shí)驗(yàn)過程中的記錄、數(shù)據(jù)。(7)實(shí)驗(yàn)結(jié)果與分析:寫明實(shí)驗(yàn)的最終結(jié)果,并對(duì)結(jié)果進(jìn)行分析,做出結(jié)論。(8)實(shí)驗(yàn)中遇到的問題及解決方法:寫明實(shí)驗(yàn)過程中遇到的問題及所采取的解決方法。(9)實(shí)驗(yàn)總結(jié)(在封底上):寫出對(duì)本次實(shí)驗(yàn)

3、的心得體會(huì)、思考和建議。綜合實(shí)驗(yàn) 電話簿管理程序設(shè)計(jì)(1)實(shí)驗(yàn)?zāi)康模?綜合運(yùn)用面向?qū)ο蟪绦蛟O(shè)計(jì)的基礎(chǔ)知識(shí),設(shè)計(jì)一個(gè)小型的應(yīng)用程序,提高解決問題的能力。(2)實(shí)驗(yàn)內(nèi)容:設(shè)計(jì)一個(gè)電話簿管理程序,要求:1具有添加、刪除、顯示、修改和查詢聯(lián)系人電話號(hào)碼的功能。2聯(lián)系人的信息保存到文件中。3可以實(shí)現(xiàn)為控制臺(tái)程序或圖形界面程序。4按學(xué)院實(shí)驗(yàn)報(bào)告要求格式書寫實(shí)驗(yàn)報(bào)告。(3)實(shí)驗(yàn)環(huán)境:microsoft visual c+ 6.0 開發(fā)環(huán)境(4)實(shí)驗(yàn)程序:#include #include #include #include #include using namespace std;class bookpub

4、lic: book();/默認(rèn)構(gòu)造函數(shù) char inter_face();/首頁(yè) void add_person();/添加 void del_person();/刪除 void show_all();/顯示 void alter();/修改 void select();/查詢 void save_new();/保存private: string name;/姓名string number;/電話號(hào)碼;book:book()name = 0;number = 0;/首頁(yè)char book:inter_face()system(cls); cout endl; cout請(qǐng)選擇你要進(jìn)行的操作:

5、endl 1.添加. 2.刪除. 3.顯示. 4.修改. 5.查詢. 6.關(guān)閉.endl choose; fflush(stdin); return choose;/添加聯(lián)系人void book:add_person()cout endl 根據(jù)下面提示輸入新聯(lián)系人信息 endl name; fflush(stdin); cout number; fflush(stdin); save_new(); cout endl endl 已保存 endl; system(pause);/刪除聯(lián)系人void book:del_person()ofstream outdata(temp.txt, ios:o

6、ut); ifstream indata(pbook.txt, ios:in); if (!outdata | !indata)cout endl 對(duì)不起找不到文件 endl; system(pause); return; string sign; cout endl sign; string str1; bool flag = true; string str; while (indata name number) getline(indata, str); if (sign=name) | (sign=number) cout endl 你想刪除的聯(lián)系人: endl; cout str1

7、endl; cout setiosflags(ios:left) setw(17) name number str endl; flag = false; break; outdata setiosflags(ios:left) setw(17) name number str endl; if (flag) cout endl 對(duì)不起,聯(lián)系人中沒你找的人 endl; else while (getline(indata, str) outdata str endl; outdata.close(); indata.close(); ofstream out(pbook.txt, ios:ou

8、t); ifstream in(temp.txt, ios:in); if (!out | !in) cout endl 對(duì)不起不能打開文件 endl; system(pause); return; while (getline(in, str) out str endl; out.close();/ in.close(); cout endl 已刪除 endl; system(pause); /顯示所有聯(lián)系人void book:show_all() ifstream indata(pbook.txt,ios:in); if (!indata) cout endl 對(duì)不起,沒有找到文件 end

9、l; system(pause); return; bool flag = true; string record; while (getline(indata, record) if (flag) cout endl 所有聯(lián)系人信息如下: endl; cout record endl; flag = false; if (flag) cout endl 你的通迅錄中沒有聯(lián)系人 endl; else cout endl 所有聯(lián)系人已經(jīng)全部顯示出來 endl; system(pause);/修改信息void book:alter() ofstream outdata(temp.txt, ios:

10、out); ifstream indata(pbook.txt, ios:in); /if (!outdata | !indata) cout endl 對(duì)不起,找不到文件 endl; system(pause); return; string sign; cout endl sign; string str1; bool flag = true; string str; while (indata name number) getline(indata, str); if (sign=name) | (sign=number) cout endl 你想修改的聯(lián)系人: endl endl; c

11、out str1 endl; cout setiosflags(ios:left) setw(17) name number str endl; cout endl 請(qǐng)根據(jù)下面提示修改信息 : endl; cout name; fflush(stdin); cout number; fflush(stdin);save_new(); flag = false; break; outdata setiosflags(ios:left) setw(17) name number str endl; if (flag) cout endl 對(duì)不起,聯(lián)系人中沒你找的人 endl; else while

12、 (getline(indata, str) outdata str endl; outdata.close(); indata.close(); ofstream out(pbook.txt, ios:out); ifstream in(temp.txt, ios:in); if (!out | !in) cout endl 對(duì)不起不能打開文件 endl; system(pause); return; while (getline(in, str) out str endl; out.close(); in.close(); cout endl 這個(gè)人的信息已經(jīng)在你的通迅錄中修改 endl;

13、 system(pause); /查詢聯(lián)系人void book:select() ifstream indata(pbook.txt,ios:in); if (!indata) cout endl 對(duì)不起,文件找不到 endl; system(pause); return; string sign; cout endl sign; fflush(stdin); string str1; bool flag = true; string str; while (indata name number) getline(indata, str); if (name=sign) | (number=s

14、ign) cout endl 你要查找的聯(lián)系人是: endl; cout str1 endl; cout setiosflags(ios:left) setw(17) name number str endl; flag = false; system(pause); break; void book:save_new() ofstream outdata(pbook.txt, ios:app); if (!outdata) cout endl 對(duì)不起,打開文件失敗 endl; system(pause); return; outdata setiosflags(ios:left) setw(

15、17) name setw(16) number endl; outdata.close();int main() int choose; book abj; while (choose = er_face() switch (choose) case 1: abj.add_person();/添加聯(lián)系人 break; case 2: abj.del_person();/刪除聯(lián)系人 break;case 3: abj.show_all();/顯示所有聯(lián)系人 break;case 4: abj.alter();/修改信息 break;case 5: abj.select();/查詢

16、聯(lián)系人 break;case 6: cout endl 謝謝使用 endl; exit(0); break; default: break; return 0;(5)實(shí)驗(yàn)結(jié)果:輸入:1分別輸入虛渺,雨拓,若風(fēng)三人姓名和電話號(hào)碼輸入:2刪除虛渺相關(guān)信息輸入:3顯示已存儲(chǔ)的聯(lián)系人輸入:4修改雨拓電話號(hào)碼輸入:5查詢雨拓電話號(hào)碼輸入:6(6)實(shí)驗(yàn)中遇到的問題及解決方法:在本次實(shí)驗(yàn)中主要在對(duì)類的建立和訪問的編寫的過程中遇到了困難,經(jīng)過上機(jī)調(diào)試和同學(xué)的幫助,順利的改正了這類問題。得到了解決,同時(shí)也對(duì)此類問題有了更好的理解。相信在今后的學(xué)習(xí)中會(huì)用很多的幫助?!緦?shí)驗(yàn)總結(jié)】通過本次實(shí)驗(yàn)我能夠基本掌握面向?qū)ο蟪绦蛟O(shè)計(jì)的基礎(chǔ)知識(shí),在對(duì)電話簿管理程序的編寫過程中了解了面向?qū)ο蟪绦蛟O(shè)計(jì)的應(yīng)用,也在上機(jī)實(shí)踐和對(duì)程序調(diào)試的同時(shí)提高了自己解決問題的能力。在這段時(shí)間的上機(jī)實(shí)踐中,我學(xué)會(huì)了很多,了解了如何應(yīng)用microsoft visual c+環(huán)境實(shí)現(xiàn)工程的創(chuàng)建,類的生成等,可以說這次上機(jī)讓我對(duì)課堂所學(xué)的知識(shí)有

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝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ù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 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ì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論