圖書管理系統(tǒng)(含代碼)課程設(shè)計(jì)報(bào)告_第1頁(yè)
圖書管理系統(tǒng)(含代碼)課程設(shè)計(jì)報(bào)告_第2頁(yè)
圖書管理系統(tǒng)(含代碼)課程設(shè)計(jì)報(bào)告_第3頁(yè)
圖書管理系統(tǒng)(含代碼)課程設(shè)計(jì)報(bào)告_第4頁(yè)
圖書管理系統(tǒng)(含代碼)課程設(shè)計(jì)報(bào)告_第5頁(yè)
已閱讀5頁(yè),還剩34頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

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

文檔簡(jiǎn)介

中南大學(xué)C++課程設(shè)計(jì)實(shí)踐報(bào)告題目:學(xué)生信息管理系統(tǒng)專業(yè)班級(jí):城地1502指導(dǎo)老師:蔣沖姓名:楊帆學(xué)號(hào):0202150222完成時(shí)間:2023年7月13日中南大學(xué)課程設(shè)計(jì)報(bào)告目錄成員設(shè)計(jì)內(nèi)容簡(jiǎn)介 1第一章系統(tǒng)概述 11.1功能簡(jiǎn)介 21.2設(shè)計(jì)思路 3第二章第二章系統(tǒng)功能的分析和簡(jiǎn)要框圖 32.1主函數(shù)42.2初始化文件42.3主菜單52.4查詢72.5借書操作82.6還書操作92.7新增圖書102.8刪除圖書112.9新增讀者122.10讀者信息132.11借閱記錄14第三章調(diào)試及運(yùn)行結(jié)果 153.1主菜單 153.2查詢圖書信息 163.3歸還圖書 163.4借閱圖書: 173.5讀者注冊(cè): 183.6圖書信息修改 193.7新書采編入庫(kù) 193.8刪除圖書信息 203.9借閱記錄 203.10讀者信息: 21總結(jié) 214.1遇到的問(wèn)題及解決方法 214.2收獲和體會(huì) 234.3致謝23第五章源代碼235.1book.h235.2head.h235.3addbook.cpp245.4addreader.cpp265.5brbook.cpp285.6checkbr.cpp325.7checkreader.cpp325.8delbook.cpp335.9findbook.cpp355.10main.cpp425.11mainmenu.cpp425.11return.cpp445.11setfile.cpp46前言圖書管理在生活中運(yùn)用非常廣泛,因此需要用許多的程序來(lái)對(duì)它們進(jìn)行管理。此程序包含了圖書信息的錄入、圖書信息的瀏覽、圖書的查詢和排序、圖書信息的刪除與借書,還書等。通過(guò)編譯一個(gè)C++語(yǔ)言函數(shù),其中包含一個(gè)主函數(shù),多個(gè)子函數(shù),主函數(shù)調(diào)用其余的子函數(shù)實(shí)現(xiàn)人們能夠簡(jiǎn)易、快捷的了解并找到自己所想要的信息的功能。該圖書信息管理系統(tǒng)記錄了圖書館中圖書的圖書號(hào)、書名、作者姓名、出版社名、圖書的現(xiàn)存量和總庫(kù)存量等書籍?dāng)?shù)據(jù),同時(shí)有對(duì)書籍?dāng)?shù)據(jù)以及借閱者的信息進(jìn)行管理,可以實(shí)現(xiàn)對(duì)書籍和借閱者進(jìn)行添加和管理。成員設(shè)計(jì)內(nèi)容簡(jiǎn)介一、題目及要求題目三:圖書管理系統(tǒng)設(shè)計(jì)圖書管理信息包括:圖書名稱、圖書編號(hào)、單價(jià)、作者、存在狀態(tài)、借書人姓名、性別、學(xué)號(hào)等功能描述1、新進(jìn)圖書根本信息的輸入。2、圖書根本信息的查詢。3、對(duì)撤消圖書信息的刪除。4、為借書人辦理注冊(cè)。5、辦理借書手續(xù)。6、辦理還書手續(xù)要求:使用二進(jìn)制文件方式存儲(chǔ)數(shù)據(jù),系統(tǒng)以菜單方式工作二、目的與意義《C++語(yǔ)言課程設(shè)計(jì)》課程設(shè)計(jì)是計(jì)算機(jī)科學(xué)與技術(shù)專業(yè)實(shí)踐性環(huán)節(jié)之一,要求明確課程設(shè)計(jì)的目的,能根據(jù)課程設(shè)計(jì)的要求,查閱相關(guān)文獻(xiàn),為完成設(shè)計(jì)準(zhǔn)備必要的知識(shí);通過(guò)課程設(shè)計(jì)的綜合訓(xùn)練可以使學(xué)生進(jìn)一步理解和掌握面向?qū)ο蟪绦蛟O(shè)計(jì)課程的根本知識(shí);掌握面向?qū)ο蟪绦蛟O(shè)計(jì)的思路和方法;根本具有利用面向?qū)ο蟮姆椒ㄒ约癈++的編程思想來(lái)完成系統(tǒng)設(shè)計(jì)的能力提高學(xué)生用高級(jí)語(yǔ)言進(jìn)行程序設(shè)計(jì)的能力,重點(diǎn)提高用C語(yǔ)言進(jìn)行文件操作和繪圖應(yīng)用的編程技術(shù)水平。三、小組成員及小組分工小組成員:楊帆、余華龍、姚翔宇楊帆:brkook()findbook()addbook()delbook()姚翔宇:checkreader(),checkbr(),returnbook();mainmenu(),余華龍:頭文件,main(),setfile(),addreader()四、主要參考文獻(xiàn)《C++語(yǔ)言程序設(shè)計(jì)〔第三版〕》,鄭莉,清華大學(xué)出版社,2004《C++PrimerPlus〔第六版〕》,StephenPrata,人民郵電出版社,2023總體設(shè)計(jì)功能簡(jiǎn)介本軟件是一個(gè)簡(jiǎn)單的圖書管理系統(tǒng),軟件為win32控制應(yīng)用臺(tái)程序。完成以下功能:1. 新進(jìn)圖書根本信息的輸入2. 圖書根本信息的查詢3. 對(duì)撤銷圖書信息的刪除4. 為借書人辦理注冊(cè)5. 辦理借書手續(xù)〔非注冊(cè)會(huì)員不能借書〕6. 辦理還書手續(xù)補(bǔ)充要求:使用二進(jìn)制文件方式存儲(chǔ)數(shù)據(jù)系統(tǒng)以菜單方式工作1.2設(shè)計(jì)思路根本功能:主菜單〔1〕新書采編入庫(kù):新購(gòu)入一種書,登記到圖書信息中去。如果這種書在帳中已有,那么只將總庫(kù)存量增加?!?〕刪除圖書:某種書已無(wú)保存價(jià)值,將它從圖書帳目中刪除?!?〕查詢已在圖書庫(kù)中的圖書信息?!?〕對(duì)讀者的信息進(jìn)行管理:新增,查詢?!?〕查看借閱記錄查詢圖書信息:a)按書名查詢:如查找所有書名為“數(shù)據(jù)結(jié)構(gòu)〞的圖書。b)按作者姓名查詢:如查找所有“張三〞編寫的圖書。c)按出版社名查詢:如查找所有“機(jī)械工業(yè)出版社〞出版的圖書。d)按書籍編號(hào)查詢:如查找書籍編號(hào)為“978-7-115-27946-0〞的圖書。e) 組合查詢:如查找所有“張三〞編寫的、由“機(jī)械工業(yè)出版社〞出版的圖書?!?〕借閱:如果一種書的現(xiàn)存量大于零,那么借出一本,登記借閱者的信息,改變?cè)摃默F(xiàn)存量?!?〕歸還:注銷對(duì)借閱者的登記,改變?cè)摃默F(xiàn)存量。整個(gè)程序的主函數(shù)由以下局部構(gòu)成:頭文件head.h、頭文件book.h、setfile、mainmenu1.頭文件head.h、book.h實(shí)現(xiàn)兩個(gè)類的定義bookdate圖書類,實(shí)現(xiàn)對(duì)圖書的描述:圖書根本信息如圖書編號(hào)、書名、作者、出版社、單價(jià)等;圖書的管理信息如查找圖書及新增圖書、刪除圖書〔通過(guò)書的現(xiàn)存量、書的總庫(kù)存量描述〕等;Readerdata讀者及圖書管理類,公有繼承圖書類,實(shí)現(xiàn)對(duì)讀者信息的描敘:讀者的個(gè)人資料如借閱者姓名、學(xué)號(hào)、性別、登陸密碼等;讀者借閱信息如借還圖書本數(shù)等;類的數(shù)據(jù)成員和各函數(shù)的功能描述classbookdata//數(shù)據(jù)成員:charbookisn[50]//圖書編號(hào),bookname[50]//書名writer[50]//作者publishing[50]//出版社;、、、nowstore,//書的現(xiàn)存量allstore,書//的總庫(kù)存量price//單價(jià)classmanagebook數(shù)據(jù)成員:reader[50]//借閱者姓名,rdID[50]//學(xué)號(hào)gender[50]//性別password[50]//登陸密碼num//借還圖書本數(shù)各個(gè)功能函數(shù):voidsetfile();//初始化數(shù)據(jù)文件voidmainmenu();//主菜單函數(shù)voidfindbook(char*file);//查詢圖書voidbrbook(char*file);//借閱圖書voidreturnbook();//歸還圖書voidreturnf(char*file,readerdatap);voidaddbook();//新書采編入庫(kù)voidadd(char*file,bookdatap);voiddelbook();//去除庫(kù)存,刪除圖書信息voiddel(char*file,bookdatap);voidaddreader();//新增讀者信息voidcheckreader();//查詢讀者信息voidcheckbr();//查看借閱記錄系統(tǒng)功能的分析和簡(jiǎn)要框圖算法分析:在本程序中,頭文件定義了兩個(gè)類:classbookdata和classmanagebook,以及各個(gè)功能函數(shù)。運(yùn)行程序,首先執(zhí)行voidsetfile();函數(shù),該函數(shù)初始化數(shù)據(jù)文件,將在exe程序所在文件夾生成所有數(shù)據(jù)文件,假設(shè)該文件夾沒(méi)有數(shù)據(jù)文件,那么生成空的數(shù)據(jù)文件,數(shù)據(jù)文件記錄圖書館管理系統(tǒng)的所有數(shù)據(jù)。然后由voidmainmenu();生成主菜單,主菜單運(yùn)用switch語(yǔ)句區(qū)分指令進(jìn)行執(zhí)行功能,其他菜單亦雷同形成。1.查詢圖書信息2.歸還圖書3.圖書信息修改4.讀者注冊(cè)5.讀者信息6.借閱記錄0.退出系統(tǒng)分別調(diào)用相應(yīng)函數(shù)直接在數(shù)據(jù)文件上對(duì)圖書執(zhí)行相應(yīng)功能。在讓借閱者執(zhí)行查詢,借閱,歸還圖書等操作之前,首先要在初始化的數(shù)據(jù)文件中添加圖書信息,整個(gè)圖書館管理系統(tǒng)大體結(jié)構(gòu)就如上所述,大概可分為圖書信息管理和借閱者信息管理2個(gè)模塊,外加一個(gè)借閱記錄那么構(gòu)成圖書館管理系統(tǒng)。本程序?qū)?shù)據(jù)文件中數(shù)據(jù)的編輯是通過(guò)將數(shù)據(jù)文件中的數(shù)據(jù)編輯后轉(zhuǎn)移至中轉(zhuǎn)文件中,再將中轉(zhuǎn)文件的數(shù)據(jù)復(fù)制回清空了的數(shù)據(jù)文件當(dāng)中,即可完成編輯。//主函數(shù)包含三個(gè)局部:建立數(shù)據(jù)文件setfile();設(shè)置背景為紫色字體亮白色//修改窗口名稱2.2setfile.cpp//初始化數(shù)據(jù)文件初始化數(shù)據(jù)文件,將在exe程序所在文件夾生成所有數(shù)據(jù)文件,假設(shè)該文件夾沒(méi)有數(shù)據(jù)文件,那么生成空的數(shù)據(jù)文件,數(shù)據(jù)文件記錄圖書館管理系統(tǒng)的所有數(shù)據(jù)。包括:中轉(zhuǎn)文件.datReaderdata.datrecord.datbookdata.dat中轉(zhuǎn)文件1.dat通過(guò)將數(shù)據(jù)文件中的數(shù)據(jù)編輯后轉(zhuǎn)移至中轉(zhuǎn)文件中,再將中轉(zhuǎn)文件的數(shù)據(jù)復(fù)制回清空了的數(shù)據(jù)文件當(dāng)中,完成編輯。2.3mainmenu.cpp//主菜單\2.4findbook.cpp//查詢圖書2.5brbook.cpp//借閱圖書是是是否否否是否繼續(xù)查詢圖書本數(shù)缺乏,請(qǐng)重新輸入成功借閱本此圖書!!!Nowstore<0?是否請(qǐng)輸入要借閱此圖書的本數(shù)是k=Y,k=y或k=N,k=n?i=1?該圖書現(xiàn)存量為0,無(wú)法借閱按要求輸入讀者信息nowstore=o?輸出圖書信息確定要借閱此書是否否輸入錯(cuò)誤請(qǐng)重新輸入work=y或work=Y?結(jié)束開始是是是否否否是否繼續(xù)查詢圖書本數(shù)缺乏,請(qǐng)重新輸入成功借閱本此圖書!!!Nowstore<0?是否請(qǐng)輸入要借閱此圖書的本數(shù)是k=Y,k=y或k=N,k=n?i=1?該圖書現(xiàn)存量為0,無(wú)法借閱按要求輸入讀者信息nowstore=o?輸出圖書信息確定要借閱此書是否否輸入錯(cuò)誤請(qǐng)重新輸入work=y或work=Y?結(jié)束開始bookname;reader;rdID;num;圖書是否存在?bookname;reader;rdID;num;圖書是否存在?修改借閱記錄圖書信息修改借閱記錄圖書信息是否繼續(xù)歸還?mainmenuTrueTrueFalseFalse開始結(jié)束booknamebooknamewriterpublishingbookisnnowstore是否添加新書?調(diào)用addbookname、writer、publishing相同?TrueFalse開始TrueFalse該書籍已存在輸入新增加的本數(shù)并通過(guò)中傳文件寫入數(shù)據(jù)文件直接將新書籍信息寫入數(shù)據(jù)文件繼續(xù)添加新書?FalseTruemainmenu結(jié)束2.7addbook.cpp//新書采編入庫(kù)2.8delbook.cpp\//去除庫(kù)存,刪除圖書信息否輸錯(cuò)請(qǐng)重試結(jié)束否K=1?是K=1或k=2?請(qǐng)根據(jù)下面提示輸入所要注銷的書籍的信息是是否是否繼續(xù)刪除圖書本數(shù)缺乏,請(qǐng)重新輸入請(qǐng)輸入注銷本書是否是W=1或w=0?該圖書信息不存在!?。=o?否輸入錯(cuò)誤,請(qǐng)重新輸入!??!開始否輸錯(cuò)請(qǐng)重試結(jié)束否K=1?是K=1或k=2?請(qǐng)根據(jù)下面提示輸入所要注銷的書籍的信息是是否是否繼續(xù)刪除圖書本數(shù)缺乏,請(qǐng)重新輸入請(qǐng)輸入注銷本書是否是W=1或w=0?該圖書信息不存在?。?!w=o?否輸入錯(cuò)誤,請(qǐng)重新輸入!?。¢_始2.9addreader.cpp//新增讀者信息reader;num;讀者信息是否存在?是否要繼續(xù)查詢借閱者信息?mainmenuTreader;num;讀者信息是否存在?是否要繼續(xù)查詢借閱者信息?mainmenuTrueTrueFalseFalse以讀的方式翻開數(shù)據(jù)文件進(jìn)行查詢r(jià)eadergenderrdIDnum;該借閱者信息不存在?。?!num;結(jié)束開始2.11checkbr.cpp//查看借閱記錄開始開始findbook借閱記錄:bookisnbooknamereaderrdIDnum結(jié)束mainmenu從借閱記錄〔record.dat〕中直接讀取第三章調(diào)試及運(yùn)行結(jié)果3.1主菜單3.2查詢圖書信息3.3歸還圖書3.4借閱圖書:3.5讀者注冊(cè):3.6圖書信息修改3.7新書采編入庫(kù)3.8刪除圖書信息3.9借閱記錄3.10讀者信息:第四章總結(jié)4.1遇到的問(wèn)題及解決方案問(wèn)題一:常出現(xiàn)沒(méi)有與這些操作符匹配的運(yùn)算符解決方案是:引入適宜的頭文件,并重新輸入#include內(nèi)容,編譯器的報(bào)錯(cuò)就會(huì)消失。問(wèn)題二:不懂得對(duì)數(shù)據(jù)文件的操作解決方案:通過(guò)對(duì)模板程序的模仿,并了解自學(xué)fstream常用方法的使用。問(wèn)題三:程序常因錯(cuò)誤輸入而崩潰解決方案:運(yùn)用一些可以容錯(cuò)的語(yǔ)句來(lái)防止多余的輸入,并能返回重新輸入。也可以運(yùn)用提示詞來(lái)減少用戶的非法輸入。問(wèn)題四:運(yùn)用二進(jìn)制文件讀寫解決方案:意我們不再使用插入和提取操作符(譯者注:<<和>>操作符).你可以這么做,但它不會(huì)用二進(jìn)制方式讀寫。你必須使用read()和write()方法讀取和寫入二進(jìn)制文件.創(chuàng)立一個(gè)二進(jìn)制文件,看下一行。ofstreamfout("file.dat",ios::binary);這會(huì)以二進(jìn)制方式翻開文件,而不是默認(rèn)的ASCII模式。問(wèn)題五:文件結(jié)構(gòu)的混亂解決方案:在書寫時(shí)保持良好的書寫習(xí)慣,并在適當(dāng)?shù)牡胤皆黾幼⑨?.2收獲和體會(huì)雖然在這個(gè)學(xué)期中,我們已經(jīng)學(xué)習(xí)了《C++語(yǔ)言程序設(shè)計(jì)》這門課,但是知識(shí)的運(yùn)用完全是一個(gè)更高水平的要求。這次設(shè)計(jì),不僅穩(wěn)固了我以前所學(xué)的知識(shí),還讓我對(duì)c++語(yǔ)言有了更深一步的了解,掌握了更多的技巧和技能。在這次課程設(shè)計(jì)中,我們首先對(duì)系統(tǒng)的整體功能進(jìn)行了構(gòu)思,然后用結(jié)構(gòu)化分析方法進(jìn)行分析,將整個(gè)系統(tǒng)清楚的劃分為幾個(gè)模塊,再根據(jù)每個(gè)模塊的功能編寫代碼。而且盡可能的將模塊細(xì)分,最后在進(jìn)行函數(shù)的調(diào)用。我們?cè)诤瘮?shù)的編寫過(guò)程中,我們不僅用到了for循環(huán)、while循環(huán)和switch語(yǔ)句,還用到了函數(shù)之間的調(diào)用〔包括遞歸調(diào)用〕。編寫一個(gè)完整并且有嚴(yán)密邏輯,以及抗非法輸入的程序?qū)τ诔鯇W(xué)者來(lái)說(shuō)還是有相當(dāng)?shù)奶魬?zhàn)性的,我們?cè)诰帉懙倪^(guò)程中遇到了重重困難,有些克服了進(jìn)步了。然而更多地是感受到自己知識(shí)儲(chǔ)藏的缺乏與實(shí)現(xiàn)按想法之間的矛盾。當(dāng)然,我們的程序還有很多不完善的地方,比方說(shuō),我們?cè)噲D以二進(jìn)制的方式保存文件,最終也是心有余而力缺乏沒(méi)有做到,程序在調(diào)試中不斷的冒出bug,大晚上面對(duì)電腦debug到生無(wú)可戀??傊?,這次設(shè)計(jì)程序讓我受益良多,我好好珍惜了這種難得的時(shí)機(jī),并且在這個(gè)過(guò)程中深刻認(rèn)識(shí)到了自己的缺乏。4.3致謝為期半個(gè)月的課設(shè)總算是結(jié)束了,特此向在這短時(shí)間指導(dǎo)過(guò)我們的老師,還有機(jī)房和藹可親的管理老師,一起寫報(bào)告的同學(xué),深夜debug的自己,道一聲謝謝。第五章源代碼Book.h#pragmaonce#include<iostream>#include"head.h"#include<vector>#include<fstream>#include<windows.h>usingnamespacestd;voidsetfile();//初始化數(shù)據(jù)文件voidmainmenu();//主菜單函數(shù)voidfindbook(char*file);//查詢圖書voidbrbook(char*file,readerdatap);//借閱圖書voidreturnbook();//歸還圖書voidreturnf(char*file,readerdatap);voidaddbook();//新書采編入庫(kù)voidadd(char*file,bookdatap);voiddelbook();//去除庫(kù)存,刪除圖書信息voiddel(char*file,bookdatap);voidaddreader();//新增讀者信息voidcheckreader();//查詢讀者信息voidcheckbr();//查看借閱記錄Head.h#pragmaonce#include<iostream>#include<string.h>#include<iomanip>#include<fstream>#include<cstdlib>usingnamespacestd;//圖書類classbookdata{public://構(gòu)造函數(shù) bookdata(char*bn="bookname\0",char*w="writer\0",char*p="publishing\0",char*bisn="bookisn\0",intn=0,inta=0,intpri=0) { strcpy_s(bookname,bn); strcpy_s(writer,w); strcpy_s(publishing,p); strcpy_s(bookisn,bisn); nowstore=n; allstore=a; price=pri; }bookdata*next;//數(shù)據(jù)成員charbookisn[50],bookname[50],writer[50],publishing[50];//圖書編號(hào)、書名、作者、出版社intnowstore,allstore,price;//書的現(xiàn)存量、書的總庫(kù)存量、單價(jià)};//讀者及圖書管理類,公有繼承圖書類classreaderdata:publicbookdata{public://構(gòu)造函數(shù) readerdata(char*rn="reader\0",char*id="0202150222\0",char*ge="男\(zhòng)0",char*p="password\0") { strcpy_s(reader,rn); strcpy_s(rdID,id); strcpy_s(gender,ge); strcpy_s(password,p); }charreader[50],rdID[50],gender[50],password[50];//借閱者姓名、學(xué)號(hào)、性別、登陸密碼intnum;//借還圖書本數(shù)};Addbook.cpp#include"head.h"#include"book.h"voidaddbook(){ system("cls");while(1) {bookdatap;charwork; cout<<"\t確定要添加新書?(y/n):"<<endl;while(1) { cin>>work;if(work=='Y'||work=='y')break;elseif(work=='N'||work=='n'){system("cls");return;}else{cout<<"\n\t輸入錯(cuò)誤,請(qǐng)重新輸入?。。?<<endl;continue;} } system("cls"); cout<<endl<<"\t\t根據(jù)下面提示輸入新書籍的信息"<<endl<<endl<<"\t書名:"; cin>>p.bookname; cout<<"\t"; cin>>p.writer; cout<<"\t出版社:"; cin>>p.publishing; cout<<"\t圖書編號(hào):"; cin>>p.bookisn; cout<<"\t單價(jià):"; cin>>p.price; cout<<"\t數(shù)量:"; cin>>p.nowstore; add("bookdata.dat",p); system("cls");charch; cout<<"\t添加成功?。?!\n\t是否要繼續(xù)添加新書?(y/n):"<<endl;while(1) { cin>>ch;if(ch=='Y'||ch=='y') { system("cls");addbook(); }//函數(shù)嵌套調(diào)用,判斷是否繼續(xù)進(jìn)行添加操作elseif(ch=='N'||ch=='n'){system("cls");return;}else{cout<<"\n\t輸入錯(cuò)誤,請(qǐng)重新輸入?。。?<<endl;continue;} } }}voidadd(char*file,bookdatap){intc=0;bookdatat;intj=0;//標(biāo)記書籍是否已經(jīng)存在ofstreamf("中轉(zhuǎn)文件.dat",ios::binary|ios::out);f.close();//清空中轉(zhuǎn)文件ifstreamfa(file,ios::binary|ios::in); f.open("中轉(zhuǎn)文件.dat",ios::binary|ios::app);while(fa>>t.bookname>>t.writer>>t.bookisn>>t.price>>t.publishing>>t.nowstore>>t.allstore) {if((!strcmp(t.bookname,p.bookname))&&(!strcmp(t.writer,p.writer))&&(!strcmp(t.publishing,p.publishing))) { cout<<"\t該書籍已存在,請(qǐng)輸入新增加的本數(shù):";//判斷新添加的書籍是否已存在 cin>>c; t.nowstore=t.nowstore+c; t.allstore=t.allstore+c;j=1; }//新添加的書籍已存在,那么直接改動(dòng)現(xiàn)存量和總庫(kù)存量 f<<t.bookname<<"\t"<<t.writer<<"\t"<<t.bookisn<<"\t"<<t.price<<"\t"<<t.publishing<<"\t"<<t.nowstore<<"\t"<<t.allstore<<endl; }if(j){ fa.close();f.close(); f.open(file,ios::binary|ios::out);f.close(); fa.open("中轉(zhuǎn)文件.dat",ios::binary|ios::in); f.open(file,ios::binary|ios::app);while(fa>>t.bookname>>t.writer>>t.bookisn>>t.price>>t.publishing>>t.nowstore>>t.allstore) { f<<t.bookname<<"\t"<<t.writer<<"\t"<<t.bookisn<<"\t"<<t.price<<"\t"<<t.publishing<<"\t"<<t.nowstore<<"\t"<<t.allstore<<endl; } fa.close(); f.close(); }else{ fa.close();f.close(); f.open(file,ios::binary|ios::app);p.allstore=p.nowstore;//新添加的書籍尚未存在,那么直接在數(shù)據(jù)文件中追加 f<<p.bookname<<"\t"<<p.writer<<"\t"<<p.bookisn<<"\t"<<p.price<<"\t"<<p.publishing<<"\t"<<p.nowstore<<"\t"<<p.allstore<<endl; f.close(); }}Addreader.cpp#include"head.h"#include"book.h"voidaddreader(){ system("cls");readerdatap,t;charwork; cout<<"\t確定要添加新的借閱者信息?(y/n):"<<endl;while(1)//詢問(wèn)添加新的借閱者與否 { cin>>work;if(work=='Y'||work=='y')break;elseif(work=='N'||work=='n'){system("cls");return;}else{cout<<"\n\t輸入錯(cuò)誤,請(qǐng)重新輸入?。?!"<<endl;continue;} } cout<<endl<<"\t\t根據(jù)下面提示輸入新的借閱者的信息"<<endl<<endl<<"\t姓名:"; cin>>p.reader; cout<<"\t學(xué)號(hào):"; cin>>p.rdID; cout<<"\t性別:"; cin>>p.gender; cout<<"\t密碼:"; cin>>p.password;inti=0;ifstreamf("readerdata.dat",ios::binary|ios::in);while(f>>t.reader>>t.rdID>>t.gender>>t.password) {if((!strcmp(t.reader,p.reader))&&(!strcmp(t.rdID,p.rdID)))//判斷新添加的借閱者是否已存在 { cout<<"\t該借閱者已記錄在案?。?!"<<endl;i=1;break; } } f.close();if(!i){ofstreamf1("readerdata.dat",ios::binary|ios::app); f1<<p.reader<<"\t"<<p.rdID<<"\t"<<p.gender<<"\t"<<p.password<<endl;//新添加的借閱者假設(shè)不存在,那么進(jìn)行添加 f1.close(); } system("cls");charch; cout<<"\t添加成功!??!\n是否要繼續(xù)添加新的借閱者信息?(y/n):"<<endl;while(1) {//函數(shù)嵌套調(diào)用,判斷是否繼續(xù)進(jìn)行添加操作 cin>>ch;if(ch=='Y'||ch=='y') { system("cls");addreader(); }elseif(ch=='N'||ch=='n'){system("cls");mainmenu();}else{cout<<"\n\t輸入錯(cuò)誤,請(qǐng)重新輸入?。。?<<endl;continue;} }}Brbook.cpp#include"head.h"#include"book.h"voidbrbook(char*file,readerdatap){intw=0;readerdatat,q;p.num=0;ofstreamf("中轉(zhuǎn)文件.dat",ios::binary|ios::out);f.close();ifstreamfa(file,ios::binary|ios::in); f.open("中轉(zhuǎn)文件.dat",ios::binary|ios::app);while(fa>>t.bookname>>t.writer>>t.bookisn>>t.price>>t.publishing>>t.nowstore>>t.allstore) {if(!strcmp(t.bookisn,p.bookisn)){ cout<<"\t\t================================================="<<endl; cout<<"\t該書信息:"<<endl; cout<<endl; cout<<"\t書名:"<<t.bookname<<endl; cout<<"\t"<<t.writer<<endl; cout<<"\t圖書號(hào):"<<t.bookisn<<endl; cout<<"\t圖書單價(jià):"<<t.price<<endl; cout<<"\t出版社:"<<t.publishing<<endl; cout<<"\t現(xiàn)存量:"<<t.nowstore<<endl; cout<<"\t總庫(kù)存量:"<<t.allstore<<endl;chark;while(1) { cout<<"\n\t確定要借閱此圖書?(y/n):"<<endl; cin>>k;if(k!='Y'&&k!='y'&&k!='N'&&k!='n') { cout<<"\t輸入錯(cuò)誤,請(qǐng)重新輸入!!!"<<endl;continue; }elsebreak; }if(k=='Y'||k=='y') {while(1) {if(t.nowstore==0) { system("cls");cout<<"\t該圖書現(xiàn)存量為0,無(wú)法借閱!??!"<<endl;mainmenu(); } system("cls"); cout<<"\t請(qǐng)輸入你的姓名:"; cin>>p.reader; cout<<"\t請(qǐng)輸入你的學(xué)號(hào):"; cin>>p.rdID; cout<<"\t請(qǐng)輸入密碼:"; cin>>p.password;inti=0;ifstreamf("readerdata.dat",ios::binary|ios::in);while(f>>t.reader>>t.rdID>>t.gender>>t.password) {if((!strcmp(t.reader,p.reader))&&(!strcmp(t.rdID,p.rdID))) {if((!strcmp(t.password,p.password))) { i=1;break; }else { i=2;break; } }else { i=0; }//i為判斷標(biāo)志,該借閱者信息存在為1.不存在為0,密碼輸入錯(cuò)誤為2,其它輸入容錯(cuò) } f.close();if(i==0){ system("cls"); cout<<"\n\t該借閱者信息不存在!??!\n"<<endl; brbook("bookdata.dat",p); }elseif(i==2) { system("cls"); cout<<"\n\t密碼輸入錯(cuò)誤!??!\n"<<endl;brbook("bookdata.bat,",p); }while(1) { system("cls"); cout<<"\t請(qǐng)輸入要借閱此圖書的本數(shù):"<<endl; cin>>p.num; t.nowstore=t.nowstore-p.num;//成功借閱后,對(duì)圖書信息的現(xiàn)存量進(jìn)行修改if(t.nowstore<0)//判斷圖書本數(shù)足夠與否 { t.nowstore=t.nowstore+p.num; cout<<"\t圖書本數(shù)缺乏,請(qǐng)重新輸入!!!"<<endl;continue; }else{ w=1;//所借閱圖書現(xiàn)存量足夠時(shí),w=1,否那么w=0inta=0;ofstreamf0("中轉(zhuǎn)文件1.dat",ios::binary|ios::out);f0.close(); f0.open("中轉(zhuǎn)文件1.dat",ios::binary|ios::app);ifstreamf("record.dat",ios::binary|ios::in);while(f>>q.bookisn>>q.bookname>>q.reader>>q.rdID>>q.num) {if((!strcmp(t.bookisn,q.bookisn))&& (!strcmp(t.bookname,q.bookname))&&(!strcmp(t.reader,q.reader))&& (!strcmp(t.rdID,q.rdID))&&!strcmp(t.password,q.password)) { q.num=q.num+p.num;a=1; }//a為判斷標(biāo)志,該借閱記錄存在為1.不存在為0 f0<<q.bookisn<<"\t"<<q.bookname<<"\t"<<q.reader<<"\t"<<q.rdID<<"\t"<<q.num<<endl; } f0.close();f.close();if(a){ofstreamf0("record.dat",ios::binary|ios::out);f0.close(); f0.open("record.dat",ios::binary|ios::app);ifstreamf("中轉(zhuǎn)文件1.dat",ios::binary|ios::in);//借閱記錄存在時(shí),直接修改借閱本數(shù)q.numwhile(f>>q.bookisn>>q.bookname>>q.reader>>q.rdID>>q.num) f0<<q.bookisn<<"\t"<<q.bookname<<"\t"<<q.reader<<"\t"<<q.rdID<<"\t"<<q.num<<endl; f0.close();f.close(); }else{ofstreamf1("record.dat",ios::binary|ios::app);//借閱記錄不存在,直接添加新的記錄 f1<<t.bookisn<<"\t"<<t.bookname<<"\t"<<p.reader<<"\t"<<p.rdID<<"\t"<<p.num<<endl; }break; } }break; } }elseif(k=='N'||k=='n')return; } f<<t.bookname<<"\t"<<t.writer<<"\t"<<t.bookisn<<"\t"<<t.price<<"\t"<<t.publishing<<"\t"<<t.nowstore<<"\t"<<t.allstore<<endl; } fa.close();f.close(); f.open(file,ios::binary|ios::out);f.close(); fa.open("中轉(zhuǎn)文件.dat",ios::binary|ios::in); f.open(file,ios::binary|ios::app);//成功借閱后,對(duì)圖書信息的現(xiàn)存量進(jìn)行修改while(fa>>t.bookname>>t.writer>>t.bookisn>>t.price>>t.publishing>>t.nowstore>>t.allstore) { f<<t.bookname<<"\t"<<t.writer<<"\t"<<t.bookisn<<"\t"<<t.price<<"\t"<<t.publishing<<"\t"<<t.nowstore<<"\t"<<t.allstore<<endl; } fa.close(); f.close();if(!w) { cout<<"\t該圖書不存在或庫(kù)存缺乏?。?!"<<endl; }else{ cout<<"\t成功借閱"<<p.num<<"本此圖書!!!"<<endl; system("pause");return; }}Checkbr.cpp#include"head.h"voidcheckbr(){ system("cls");readerdatat; cout<<"\n\t借閱記錄:\n"<<endl;ifstreamf("record.dat",ios::binary|ios::in);//直接輸出借閱記錄while(f>>t.bookisn>>t.bookname>>t.reader>>t.rdID>>t.num){ cout<<"\t圖書號(hào):"<<t.bookisn<<"\n"<<"\t書名:"<<t.bookname<<"\n"<<"\t借閱者:"<<t.reader<<"\n"<<"\t學(xué)號(hào):"<<t.rdID<<"\n"<<"\t借閱數(shù)量:"<<t.num<<endl; cout<<"\t============================================"<<endl; } system("pause"); system("cls");}Checkreader.cpp#include"head.h"#include"book.h"voidcheckreader(){ system("cls");readerdatat,p;inti=0; cout<<"\n\t輸入要查詢的借閱者姓名:\n"<<endl; cin>>p.reader;ifstreamf("readerdata.dat",ios::binary|ios::in);//以讀的方式翻開數(shù)據(jù)文件進(jìn)行查詢while(f>>t.reader>>t.rdID>>t.gender>>t.password) {if(!strcmp(t.reader,p.reader)) { cout<<"\n\t借閱者:"<<t.reader<<"\t"<<"性別:"<<t.gender<<"\n"<<"\t學(xué)號(hào):"<<t.rdID<<endl; cout<<"\t============================================"<<endl; i=1; } }if(!i)cout<<"\t該借閱者信息不存在!?。?<<endl;charch1; cout<<"\n\t是否要繼續(xù)查詢借閱者信息?(y/n):"<<endl;while(1)//函數(shù)嵌套調(diào)用,判斷是否繼續(xù)進(jìn)行查詢操作 { cin>>ch1;if(ch1=='Y'||ch1=='y') checkreader();elseif(ch1=='N'||ch1=='n'){system("cls");return;}else{cout<<"\n\t輸入錯(cuò)誤,請(qǐng)重新輸入?。?!"<<endl;continue;} }}Delbook.cpp#include"head.h"#include"book.h"voiddelbook(){ system("cls");while(1) {bookdatap; cout<<endl<<"\t請(qǐng)根據(jù)下面提示輸入所要注銷的書籍的信息"<<endl<<endl<<"\t圖書編號(hào):"; cin>>p.bookisn;//調(diào)用刪除函數(shù)對(duì)圖書信息進(jìn)行注銷 del("bookdata.dat",p); }}voiddel(char*file,bookdatap){intc=0,w=0;bookdatat;ofstreamf("中轉(zhuǎn)文件.dat",ios::binary|ios::out);f.close();ifstreamfa(file,ios::binary|ios::in); f.open("中轉(zhuǎn)文件.dat",ios::binary|ios::app);while(fa>>t.bookname>>t.writer>>t.bookisn>>t.price>>t.publishing>>t.nowstore>>t.allstore) {if((!strcmp(t.bookisn,p.bookisn))) { cout<<"\t該書信息:"<<endl;w=1; cout<<"\t書名:"<<t.bookname<<endl; cout<<"\t"<<t.writer<<endl; cout<<"\t圖書號(hào):"<<t.bookisn<<endl; cout<<"\t圖書單價(jià):"<<t.price<<endl; cout<<"\t出版社:"<<t.publishing<<endl; cout<<"\t現(xiàn)存量:"<<t.nowstore<<endl; cout<<"\t總庫(kù)存量:"<<t.allstore<<endl;chark;while(1) { cout<<"\t請(qǐng)選擇:(1.完全刪除此種圖書)(2.只刪除局部此種圖書)"<<endl; cin>>k;if(k=='1'||k=='2')break;else{cout<<"\t輸入錯(cuò)誤,請(qǐng)重新輸入!!!"<<endl;continue;} }if(k=='1')continue;elseif(k=='2') {while(1) { cout<<"\t請(qǐng)輸入要注銷的本數(shù):"<<endl; cin>>c; t.nowstore=t.nowstore-c;t.allstore=t.allstore-c;if(t.nowstore<0||t.allstore<0) { t.nowstore=t.nowstore+c;t.allstore=t.allstore+c; cout<<"\t輸入錯(cuò)誤,請(qǐng)重新輸入!!!"<<endl;continue; }elsebreak; } } } f<<t.bookname<<"\t"<<t.writer<<"\t"<<t.bookisn<<"\t"<<t.price<<"\t"<<t.publishing<<"\t"<<t.nowstore<<"\t"<<t.allstore<<endl; } fa.close();f.close(); f.open(file,ios::binary|ios::out);f.close(); fa.open("中轉(zhuǎn)文件.dat",ios::binary|ios::in);//通過(guò)中轉(zhuǎn)文件進(jìn)行對(duì)圖書信息刪除 f.open(file,ios::binary|ios::app);while(fa>>t.bookname>>t.writer>>t.bookisn>>t.price>>t.publishing>>t.nowstore>>t.allstore) { f<<t.bookname<<"\t"<<t.writer<<"\t"<<t.bookisn<<"\t"<<t.price<<"\t"<<t.publishing<<"\t"<<t.nowstore<<"\t"<<t.allstore<<endl; } fa.close(); f.close();if(!w)cout<<"\n\t該圖書信息不存在?。?!\n\t是否要繼續(xù)刪除圖書?(y/n):"<<endl;elsecout<<"\n\t成功對(duì)該圖書進(jìn)行了注銷?。?!\n\t是否要繼續(xù)刪除圖書?(y/n):"<<endl;charch;while(1) {//函數(shù)嵌套調(diào)用,判斷是否繼續(xù)進(jìn)行添加操作 cin>>ch;if(ch=='Y'||ch=='y') { system("cls");delbook(); }elseif(ch=='N'||ch=='n'){system("cls");mainmenu();}else{cout<<"\n\t輸入錯(cuò)誤,請(qǐng)重新輸入!??!"<<endl;continue;} }}Findbook.cpp#include"head.h"#include"book.h"voidfindbook(char*file){ system("cls");while(1) { cout<<"\n\t\t============================================"<<endl; cout<<"\t\t\t請(qǐng)選擇查詢方式\t"<<endl; cout<<"\t\t\t1.按書名查詢\t"<<endl; cout<<"\t\t\t2.按作者姓名查詢\t"<<endl; cout<<"\t\t\t3.按出版社名查詢\t"<<endl; cout<<"\t\t\t4.按書名與作者(組合)查詢\t"<<endl; cout<<"\t\t\t5.按書名與出版社(組合)查詢\t"<<endl; cout<<"\t\t\t6.按作者與出版社(組合)查詢\t"<<endl; cout<<"\t\t\t7.按圖書編號(hào)查詢\t"<<endl; cout<<"\t\t\t8.輸出所有圖書\t"<<endl; cout<<"\t\t\t0.返回上一層菜單\t"<<endl; cout<<"\t\t============================================"<<endl;//菜單chark; cin>>k;if(k=='0'){system("cls");mainmenu();}if(k!='1'&&k!='2'&&k!='3'&&k!='4'&&k!='5'&&k!='6'&&k!='7'&&k!='8'&&k!='0') { system("cls");cout<<"\t輸入錯(cuò)誤,請(qǐng)重新輸入!!!"<<endl;continue; }//判斷指令輸入的對(duì)錯(cuò) bookdatap,t; readerdatah;//已查詢的圖書信息保存inttag=0;if(k=='1') { system("cls"); cout<<"\t請(qǐng)輸入要查詢的書名:";cin>>p.bookname; ifstreamf(file,ios::binary|ios::in); cout<<"\t所查詢的圖書信息:"<<endl;while(f>>t.bookname>>t.writer>>t.bookisn>>t.price>>t.publishing>>t.nowstore>>t.allstore) {if(!strcmp(t.bookname,p.bookname)) { tag=1;//tag為判斷標(biāo)志,該圖書信息存在為1.不存在為0 cout<<"\t書名:"<<t.bookname<<endl; cout<<"\t"<<t.writer<<endl; cout<<"\t圖書號(hào):"<<t.bookisn<<endl; cout<<"\t圖書單價(jià):"<<t.price<<endl; cout<<"\t出版社:"<<t.publishing<<endl; cout<<"\t現(xiàn)存量:"<<t.nowstore<<endl; cout<<"\t總庫(kù)存量:"<<t.allstore<<endl; strcpy_s(h.bookisn,t.bookisn); } }if(tag==0){ cout<<"\n\t該書不存在!!!"<<endl; } }elseif(k=='2') { system("cls"); cout<<"\t請(qǐng)輸入要查詢的書籍作者姓名:";cin>>p.writer; ifstreamf(file,ios::binary|ios::in); cout<<"\t所查詢的圖書信息:"<<endl;while(f>>t.bookname>>t.writer>>t.bookisn>>t.price>>t.publishing>>t.nowstore>>t.allstore){if(!strcmp(t.writer,p.writer)) { tag=1; cout<<"\t書名:"<<t.bookname<<endl; cout<<"\t"<<t.writer<<endl; cout<<"\t圖書號(hào):"<<t.bookisn<<endl; cout<<"\t圖書單價(jià):"<<t.price<<endl; cout<<"\t出版社:"<<t.publishing<<endl; cout<<"\t現(xiàn)存量:"<<t.nowstore<<endl; cout<<"\t總庫(kù)存量:"<<t.allstore<<endl; strcpy_s(h.bookisn,t.bookisn); } }if(tag==0){ cout<<"\n\t該書不存在!!!"<<endl; } }elseif(k=='3') { system("cls"); cout<<"\t請(qǐng)輸入要查詢的書籍出版社:";cin>>p.publishing; ifstreamf(file,ios::binary|ios::in); cout<<"\t所查詢的圖書信息:"<<endl;while(f>>t.bookname>>t.writer>>t.bookisn>>t.price>>t.publishing>>t.nowstore>>t.allstore) {if(!strcmp(t.publishing,p.publishing)) { tag=1; cout<<"\t書名:"<<t.bookname<<endl; cout<<"\t"<<t.writer<<endl; cout<<"\t圖書號(hào):"<<t.bookisn<<endl; cout<<"\t圖書單價(jià):"<<t.price<<endl; cout<<"\t出版社:"<<t.publishing<<endl; cout<<"\t現(xiàn)存量:"<<t.nowstore<<endl; cout<<"\t總庫(kù)存量:"<<t.allstore<<endl; strcpy_s(h.bookisn,t.bookisn); } }if(tag==0){ cout<<"\n\t該書不存在!!!"<<endl; } }elseif(k=='4'){ system("cls"); cout<<"\t請(qǐng)輸入要查詢的書籍書名:"; cin>>p.bookname; cout<<"\t請(qǐng)輸入要查詢的書籍作者姓名:"; cin>>p.writer; ifstreamf(file,ios::binary|ios::in); cout<<"\t所查詢的圖書信息:"<<endl;while(f>>t.bookname>>t.writer>>t.bookisn>>t.price>>t.publishing>>t.nowstore>>t.allstore) {if(!strcmp(t.bookname,p.bookname)&&!strcmp(t.writer,p.writer)) { tag=1; cout<<"\t書名:"<<t.bookname<<endl; cout<<"\t"<<t.writer<<endl; cout<<"\t圖書號(hào):"<<t.bookisn<<endl; cout<<"\t圖書單價(jià):"<<t.price<<endl; cout<<"\t出版社:"<<t.publishing<<endl; cout<<"\t現(xiàn)存量:"<<t.nowstore<<endl; cout<<"\t總庫(kù)存量:"<<t.allstore<<endl; strcpy_s(h.bookisn,t.bookisn); } }if(tag==0){ cout<<"\n\t該書不存在!!!"<<endl; } }elseif(k=='5') { system("cls"); cout<<"\t請(qǐng)輸入要查詢的書籍書名:";cin>>p.bookname; cout<<"\t請(qǐng)輸入要查詢的書籍出版社:";cin>>p.publishing; ifstreamf(file,ios::binary|ios::in); cout<<"\t所查詢的圖書信息:"<<endl;while(f>>t.bookname>>t.writer>>t.bookisn>>t.price>>t.publishing>>t.nowstore>>t.allstore) {if(!strcmp(t.bookname,p.bookname)&&!strcmp(t.publishing,p.publishing)) { tag=1; cout<<"\t書名:"<<t.bookname<<endl; cout<<"\t"<<t.writer<<endl; cout<<"\t圖書號(hào):"<<t.bookisn<<endl; cout<<"\t圖書單價(jià):"<<t.price<<endl; cout<<"\t出版社:"<<t.publishing<<endl; cout<<"\t現(xiàn)存量:"<<t.nowstore<<endl; cout<<"\t總庫(kù)存量:"<<t.allstore<<endl; strcpy_s(h.bookisn,t.bookisn); } }if(tag==0) { cout<<"\n\t該書不存在!!!"<<endl; } }elseif(k=='6') { system("cls"); cout<<"\t請(qǐng)輸入要查詢的書籍作者姓名:";cin>>p.writer; cout<<"\t請(qǐng)輸入要查詢的書籍出版社:";cin>>p.publishing; ifstreamf(file,ios::binary|ios::in); cout<<"\t所查詢的圖書信息:"<<endl;while(f>>t.bookname>>t.writer>>t.bookisn>>t.price>>t.publishing>>t.nowstore>>t.allstore) {if(!strcmp(t.writer,p.writer)&&!strcmp(t.publishing,p.publishing)) { tag=1; cout<<"\t書名:"<<t.bookname<<endl; cout<<"\t"<<t.writer<<endl; cout<<"\t圖書號(hào):"<<t.bookisn<<endl; cout<<"\t圖書單價(jià):"<<t.price<<endl; cout<<"\t出版社:"<<t.publishing<<endl; cout<<"\t現(xiàn)存量:"<<t.nowstore<<endl; cout<<"\t總庫(kù)存量:"<<t.allstore<<endl; strcpy_s(h.bookisn,t.bookisn); } }if(tag==0)cout<<"\n\t該書不存在!!!"<<endl; }elseif(k=='7') { system("cls"); ifstreamf(file,ios::binary|ios::in); cout<<"\t請(qǐng)輸入要查詢的書籍編號(hào):"<<endl; cin>>p.bookisn;while(f>>t.bookname>>t.writer>>t.bookisn>>t.price>>t.publishing>>t.nowstore>>t.allstore){if(!strcmp(t.bookisn,p.bookisn)) { tag=1; cout<<"\t書名:"<<t.bookname<<endl; cout<<"\t"<<t.writer<<endl; cout<<"\t圖書號(hào):"<<t.bookisn<<endl; cout<<"\t圖書單價(jià):"<<t.price<<endl; cout<<"\t出版社:"<<t.publishing<<endl; cout<<"\t現(xiàn)存量:"<<t.nowstore<<endl; cout<<"\t總庫(kù)存量:"<<t.allstore<<endl; strcpy_s(h.bookisn,t.bookisn); } }if(tag==0)cout<<"\n該書不存在!!!"<<endl; }elseif(k=='8') { system("cls"); ifstreamf(file,ios::binary|ios::in); cout<<"\t所有圖書信息:"<<endl;while(f>>t.bookname>>t.writer>>t.bookisn>>t.price>>t.publishing>>t.nowstore>>t.allstore){ tag=1; cout<<"\t============================================"<<endl; cout<<"\t\t書名:"<<t.bookname<<endl; cout<<"\t\t"<<t.writer<<endl; cout<<"\t\t圖書號(hào):"<<t.bookisn<<endl; cout<<"\t\t圖書單價(jià):"<<t.price<<endl; cout<<"\t\t出版社:"<<t.publishing<<endl; cout<<"\t\t現(xiàn)存量:"<<t.nowstore<<endl; cout<<"\t\t總庫(kù)存量:"<<t.allstore<<endl; cout<<"\t============================================"<<endl; }charch1; cout<<"\n\t是否要繼續(xù)查詢圖書?(y/n):"<<endl;while(cin>>ch1) {if(ch1=='Y'||ch1=='y') { system("cls");return; }elseif(ch1=='N'||ch1=='n'){ system("cls");mainmenu(); }else{cout<<"\n\t輸入錯(cuò)誤,請(qǐng)重新輸入?。。?<<endl;continue

溫馨提示

  • 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ì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論