C++獎學(xué)金評定系統(tǒng)課設(shè)報(bào)告_第1頁
C++獎學(xué)金評定系統(tǒng)課設(shè)報(bào)告_第2頁
C++獎學(xué)金評定系統(tǒng)課設(shè)報(bào)告_第3頁
C++獎學(xué)金評定系統(tǒng)課設(shè)報(bào)告_第4頁
C++獎學(xué)金評定系統(tǒng)課設(shè)報(bào)告_第5頁
已閱讀5頁,還剩8頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

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

文檔簡介

1、精選優(yōu)質(zhì)文檔-傾情為你奉上沈陽航空航天大學(xué)實(shí) 驗(yàn) 報(bào) 告課程名稱: 面向?qū)ο蟪绦蛟O(shè)計(jì)及C+實(shí)驗(yàn)題目: 學(xué)生獎學(xué)金評定系統(tǒng)院(系):計(jì)算機(jī)學(xué)院專 業(yè):計(jì)算機(jī)科學(xué)與技術(shù)班 級: 學(xué) 號:姓 名:一、實(shí)驗(yàn)?zāi)康倪_(dá)到對所學(xué)面向?qū)ο蟪绦蛟O(shè)計(jì)知識的一次綜合運(yùn)用,熟練掌握面象對象分析問題、解決問題的方法。2、 實(shí)驗(yàn)內(nèi)容描述 該實(shí)驗(yàn)室評定學(xué)生獎學(xué)金的一個(gè)系統(tǒng),包括查看學(xué)生獎學(xué)獲得的情況,以及錄入學(xué)生信息,修改學(xué)生信息,查看個(gè)人獎學(xué)金等功能。結(jié)果都將保存在文件中,在下次程序開始時(shí)會自動調(diào)用上一次修改的結(jié)果。3、 類設(shè)計(jì)及描述name(姓名)學(xué)生類number(學(xué)號)sex(性別)GPA(績點(diǎn))money(錢數(shù))m

2、o(期末成績)Zhong(期中成績)Pingding(成員函數(shù),由成績計(jì)算出該學(xué)生的績點(diǎn)以及獎學(xué)金數(shù)額)考試類(基類)English(英語成績)Math(數(shù)學(xué)成績)Sport(體育成績)Practise(實(shí)踐成績)Zong(總成績)期中考試類Zong(計(jì)算期中總成績)Zong(計(jì)算期末總成績)考試類期末考試類 派生四、關(guān)鍵函數(shù)描述初始化學(xué)生信息函數(shù)chushihua();:把文件中已有的學(xué)生信息讀取出來查尋學(xué)生獲得獎學(xué)金信息函數(shù)paihang();:查詢所有學(xué)生獎學(xué)金獲得情況錄入學(xué)生成績函數(shù)fun1();:錄入新學(xué)生姓名,性別,學(xué)號,以及成績修改學(xué)生成績函數(shù)amend();:可以修改已有學(xué)生任

3、何一次考試的任何一門成績查尋個(gè)人獎學(xué)金函數(shù)find();:可以查尋已有學(xué)生獎學(xué)金獲得的情況。五、程序測試/運(yùn)行的結(jié)果 圖4.1*查詢文件中已有學(xué)生信息*圖4.2*初始化學(xué)生信息*圖4.3*查詢學(xué)生獲得獎學(xué)金信息* 圖4.4* 查詢結(jié)果 *圖4.5*如果沒有錄入此人信息*六、實(shí)驗(yàn)總結(jié)這是我第一次做比較大的C+程序,在制作的過程中遇到過很多問題,不過還在在老師和同學(xué)的幫助下把這些問題都得到了解決。程序可以流暢運(yùn)行,但是依然存在著很多缺陷,比如說界面,做的并沒有呢么完美,功能方面也有待加強(qiáng),我會繼續(xù)努力,爭取做出更好的作品。附錄(實(shí)驗(yàn)代碼)#include#include#include#inclu

4、deusing namespace std;static int n=0;class exam /成績類public:float Math;float English;float Sport;float practise;float zong;class final:public exampublic:float zongchengji(float a=0,float b=0,float c=0,float d=0);class midterm:public exampublic:float zongchengji(float a=0,float b=0,float c=0,float d=0

5、);float midterm:zongchengji(float a,float b,float c,float d)zong=a+b+c+d;return a+b+c+d;float final:zongchengji(float a,float b,float c,float d)zong=a+b+c+d;return a+b+c+d;class student /學(xué)生類public:float pingding();public:string name; /姓名string number; /學(xué)號char sex5; /性別int money; /獎學(xué)金數(shù)額float GPA; /績點(diǎn)

6、midterm zhong; /期中考試成績final mo; /期末考試成績;float student:pingding()float a,b;a=(mo.Math*4+mo.English*3+mo.Sport*2+mo.practise*1.5)*0.7/10.5/10;b=(zhong.English*3.5+zhong.Math*4+zhong.practise*1.5+zhong.Sport*2)*0.3/10.5/10;GPA=a+b;if(GPA=8)money=1000;else if(GPA=7&GPA=6&GPA7)money=300;else if(GPA=5)mon

7、ey=150;elsemoney=0;return GPA;class guanlipublic:void print();int gameprint1();void fun1(student *stu);void paihang(student *stu);void find(student *stu);void amend(student *stu);void chushi(student *stu);void guanli:print() /打印界面函數(shù)cout-endl;cout* 獎學(xué)金評定 *endl;cout* 1初始化學(xué)生信息 *endl;cout* 2查看獎學(xué)金信息 *end

8、l;cout* 3查詢個(gè)人獎學(xué)金 *endl;cout* 4修改個(gè)人成績 *endl;cout* 5退出 *endl;cout-endl;int guanli:gameprint1() /打印函數(shù)int a;cout繼續(xù)操作請按1,退出請按0a;return a;void guanli:chushi(student *stu) /初始化學(xué)生信息函數(shù)ifstream p;int i;p.open(E:基本信息.txt);if(!p)cout打開失敗stun.numberstun.sexstun.mo.Mathstun.mo.Englishstun.mo.Sportstun.mo

9、.practisestun.zhong.Mathstun.zhong.Englishstun.zhong.Sportstun.zhong.practise;n+;for(i=0;in;i+)stui.pingding();p.close();void guanli:fun1(student *stu) /錄入學(xué)生信息函數(shù)float a,b,c,d,i; cout輸入學(xué)生姓名,學(xué)號,性別stun.numberstun.sex;cout請選擇輸入的成績endl;cout請輸入該生期中成績-請按-數(shù)學(xué) 英語 體育 實(shí)踐 的順序輸入,否則默認(rèn)為0abcd;stun.

10、zhong.Math=a;stun.zhong.English=b;stun.zhong.Sport=c;stun.zhong.practise=d;stun.zhong.zongchengji(a,b,c,d);cout請輸入該生期末考試成績-請按-數(shù)學(xué) 英語 體育 實(shí)踐 的順序輸入,否則默認(rèn)為0abcd;stun.mo.Math=a;stun.mo.English=b;stun.mo.Sport=c;stun.mo.practise=d;stun.mo.zongchengji(a,b,c,d);ofstream p;p.open(E:基本信息.txt,ios:app);if(!p)cout

11、打開失敗endl;exit(0); stun.number stun.sexstun.mo.Math stun.mo.English stun.mo.Sport stun.mo.practise stun.zhong.Math stun.zhong.English stun.zhong.Sport stun.zhong.practise;n+;void guanli:paihang(student *stu) /查看獎學(xué)金信息函數(shù)int i;cout姓名 績點(diǎn) 獎學(xué)金數(shù)額endl;for(i=0;in;i+)stui.pingding();

12、 stui.GPA stui.moneyendl;void guanli:find(student *stu) /查詢獎學(xué)金函數(shù)int a;float b;cout請輸入所查詢學(xué)生學(xué)號ch;int i;for(i=0;i=6&b7)cout恭喜獲得綜合三等獎學(xué)金,數(shù)額為300=5&b6)cout恭喜獲得單項(xiàng)獎學(xué)金,數(shù)額為150=7&b8)cout恭喜獲得綜合二等獎學(xué)金,數(shù)額為500=8)cout恭喜獲得綜合一等獎學(xué)金,數(shù)額為1000endl;elsecout該生未獲得獎學(xué)金,請繼續(xù)努力endl;return ;cout查無

13、此人endl;void guanli:amend(student *stu) /修改學(xué)生成績函數(shù)string s;int i=0,a,b;char ch;float aa;cout請輸入修改學(xué)生的姓名s;for(i=0;in;i+)if(=s)ofstream p;p.open(E:基本信息.txt);if(!p)cout打開失敗endl;exit(0);loop1:cout請輸入要修改的成績endl;cout 1期中 endl;cout 2期末 a;if(a=1)cout請輸入要修改的學(xué)科endl;cout 1數(shù)學(xué)endl;cout 2英語endl;cout 3體育endl

14、;cout 4實(shí)踐b;cout請輸入修改后的成績aa;switch(b)case 1:stui.zhong.Math=aa;break;case 2:stui.zhong.English=aa;break;case 3:stui.zhong.Sport=aa;break;case 4:stui.zhong.practise=aa;break;else if(a=2)cout請輸入要修改的學(xué)科endl;cout 1數(shù)學(xué)endl;cout 2英語endl;cout 3體育endl;cout 4實(shí)踐b;cout請輸入修改后的成績aa;switch(b)case 1:stui.mo.Math=aa;b

15、reak;case 2:stui.mo.English=aa;break;case 3:stui.mo.Sport=aa;break;case 4:stui.mo.practise=aa;break;elsecout輸入錯誤請重新輸入endl;goto loop1;cout繼續(xù)修改?ch;if(ch=y)goto loop1;for(i=0;in;i+) stun.number stun.sexstun.mo.Math stun.mo.English stun.mo.Sport stun.mo.practise stun.zhong.Math stun.zhong.English stun.zhong.Sport stun.zhong.practise;p.close();return;cout查無此人i;if(i!=1&i!=2&i!=3&i!=4&i!=5)cout輸入錯誤,請重新輸入endl;goto loop1;elseswitch(i)case 1:a.fun1(CH); lin=a.gameprint1();if(lin=1)goto loop1;else

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

最新文檔

評論

0/150

提交評論