vb程序設(shè)計(jì)課程設(shè)計(jì)報(bào)告學(xué)生成績(jī)管理系統(tǒng)_第1頁(yè)
vb程序設(shè)計(jì)課程設(shè)計(jì)報(bào)告學(xué)生成績(jī)管理系統(tǒng)_第2頁(yè)
vb程序設(shè)計(jì)課程設(shè)計(jì)報(bào)告學(xué)生成績(jī)管理系統(tǒng)_第3頁(yè)
vb程序設(shè)計(jì)課程設(shè)計(jì)報(bào)告學(xué)生成績(jī)管理系統(tǒng)_第4頁(yè)
vb程序設(shè)計(jì)課程設(shè)計(jì)報(bào)告學(xué)生成績(jī)管理系統(tǒng)_第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)介

1、 vb程序設(shè)計(jì)課程設(shè)計(jì)報(bào)告 班 級(jí): 資工10902班 學(xué)生姓名: 序 號(hào): 200903201 指導(dǎo)老師: 日 期: 2011年2月 目 錄1、課設(shè)的目的32、界面設(shè)計(jì)和功能設(shè)計(jì)43、系統(tǒng)功能實(shí)施錯(cuò)誤!未定義書簽。45、總結(jié)和體會(huì)錯(cuò)誤!未定義書簽。91. 課設(shè)的目的1.通過(guò)本次課程設(shè)計(jì),提高實(shí)踐動(dòng)手能力;2.通過(guò)本次課程設(shè)計(jì),進(jìn)一步理解計(jì)算機(jī)程序設(shè)計(jì)的思路與方法;3.通過(guò)本次課程設(shè)計(jì),進(jìn)一步熟練運(yùn)用vb的語(yǔ)言元素和流程控制語(yǔ)句;4.通過(guò)本次課程設(shè)計(jì),達(dá)到能熟練使用各種常見(jiàn)的vb控件,理解面向?qū)ο蟮乃枷耄?.通過(guò)本次課程設(shè)計(jì),熟悉用戶界面的設(shè)計(jì);6.通過(guò)本次課程設(shè)計(jì),熟悉數(shù)據(jù)訪問(wèn)控件ado及相

2、關(guān)對(duì)象的使用,能基于ado控件實(shí)現(xiàn)access的數(shù)據(jù)訪問(wèn)與操縱;設(shè)計(jì)環(huán)境:1. 硬件環(huán)境pentium ii以上微機(jī),內(nèi)存32mb以上,建議64mb。2. 操作系統(tǒng) windows 98/2000/xp。3. 編程環(huán)境visual basic 6.0程序設(shè)計(jì)語(yǔ)言,access97/2000數(shù)據(jù)庫(kù)。2. 界面設(shè)計(jì)和功能設(shè)計(jì)1. 用戶登錄界面(form10)以windows7的登陸界面為背景,簡(jiǎn)單清新,為操作簡(jiǎn)單考慮,無(wú)需輸入用戶名與密碼,直接點(diǎn)擊登錄即可進(jìn)入學(xué)生成績(jī)管理系統(tǒng)的主窗體。2. 學(xué)生成績(jī)管理系統(tǒng)(form1)學(xué)生成績(jī)管理系統(tǒng)這個(gè)窗體有學(xué)生管理(添加與刪除)、查詢與統(tǒng)計(jì)、統(tǒng)計(jì)總分、排名、

3、統(tǒng)計(jì)直方圖、優(yōu)等生界面這五大主要功能。其中查詢統(tǒng)計(jì)功能又分各科成績(jī)查詢、姓名查詢、班級(jí)查詢、各科成績(jī)段查詢這五個(gè)功能。3. 學(xué)生管理窗體(form2)該窗體通過(guò)adodc控件能直接瀏覽acess表格上學(xué)生的信息,還可以通過(guò)添加按鈕添加某學(xué)生的信息,通過(guò)刪除按鈕刪除某學(xué)生的信息,通過(guò)保存按鈕保存添加的學(xué)生信息,點(diǎn)擊返回主窗口按鈕可直接返回form1主窗口。其程序代碼如下:4. 成績(jī)的查詢窗體(form3)通過(guò)該窗體可直接輸入的查詢條件分別對(duì)vb、math、english這三門課程各成績(jī)段學(xué)生情況統(tǒng)計(jì)。5. 統(tǒng)計(jì)總分窗體(form4)該窗體界面上有兩個(gè)command按鈕,一個(gè)ado控件,還有一個(gè)d

4、atagrid控件,可以計(jì)算acess表格上各學(xué)生所有課程的總分。6. 排名窗體(form5)該窗體界面上有兩個(gè)command按鈕,一個(gè)ado控件,還有一個(gè)datagrid控件,可根據(jù)acess表格上各學(xué)生所有課程的總分對(duì)學(xué)生進(jìn)行排名。7. 各科成績(jī)段統(tǒng)計(jì)窗體(form6)該窗體可直接實(shí)現(xiàn)對(duì)各門課程中優(yōu)秀人數(shù)、良好人數(shù)、中等人數(shù)、及格人數(shù)、不及格人數(shù)進(jìn)行統(tǒng)計(jì)。8. 統(tǒng)計(jì)直方圖窗體(form7)該窗體有3個(gè)command按鈕,一個(gè)chart控件,一個(gè)ado控件,可實(shí)現(xiàn)將各門功課所有學(xué)生的成績(jī)以直方圖的形式呈現(xiàn)出來(lái),更加直觀!9. 姓名查詢(form8)通過(guò)輸入姓名可以查詢?cè)撋行畔ⅰ?0. 班

5、級(jí)查詢窗口(form9)通過(guò)輸入班級(jí)可以查詢?cè)摪嗨袑W(xué)生的信息。11.優(yōu)等生界面(form11)該窗體有一個(gè)command按鈕,一個(gè)ado控件,還有一個(gè)datagrid控件,可以篩選出滿足:1) 平均成績(jī)大于90分;或平均分大于85分且至少有一門功課為100分;或者平均分大于85分且至少兩門課程成績(jī)?yōu)?5分以上;2) 名次在前三名;3) 每門功課及格以上;3. 系統(tǒng)功能實(shí)施1.建立如下access數(shù)據(jù)庫(kù) 圖1 數(shù)據(jù)庫(kù)2、建立簡(jiǎn)單的學(xué)生成績(jī)管理系統(tǒng)界面和實(shí)現(xiàn)功能(1)主界面 圖2 主界面程序代碼如下:private sub command1_click() form2.showend subpr

6、ivate sub command10_click() form11.showend subprivate sub command3_click() form4.showend subprivate sub command4_click() form5.showend subprivate sub command5_click() form7.showend subprivate sub command6_click() form3.showend subprivate sub command7_click() form8.showend subprivate sub command8_cli

7、ck() form9.showend subprivate sub command9_click() form6.showend sub(2)學(xué)生管理界面 圖3 學(xué)生管理界面如何加載ado步驟一步驟二步驟三各個(gè)界面的ado控件如何連接數(shù)據(jù)庫(kù)(分兩步):步驟一: 如下面界面中的5個(gè)步驟步驟2:選中ado控件adodc1,點(diǎn)擊鼠標(biāo)右鍵選擇屬性,然后界面設(shè)置如下:控件綁定數(shù)據(jù)庫(kù)的字段操作說(shuō)明:屬性設(shè)置說(shuō)明:下面以學(xué)號(hào)為例,姓名、班級(jí)等都可參考此。將學(xué)號(hào)對(duì)應(yīng)的文本框text1連接adodc1顯示數(shù)據(jù)庫(kù)中的學(xué)號(hào),需要設(shè)置datasource和datafield兩個(gè)屬性,首先選中text1文本框,并進(jìn)行下

8、面的兩步操作,即可綁定數(shù)據(jù)庫(kù)的學(xué)號(hào)字段。設(shè)置datasource:設(shè)置datafield:當(dāng)在圖2中點(diǎn)擊學(xué)生管理,則進(jìn)入圖3界面,可以進(jìn)行學(xué)生添加、刪除、修改等操作。參考代碼:(在圖3工程的學(xué)生管理點(diǎn)擊事件中加)private sub command1_click() 添加 me.adodc1.recordset.addnewend subprivate sub command2_click() 刪除if me.adodc1.recordset.recordcount = 0 or me.adodc1.recordset.eof then exit subend ifme.adodc1.rec

9、ordset.deleteme.adodc1.recordset.movenextif me.adodc1.recordset.recordcount = 0 then exit subend ifif me.adodc1.recordset.eof then me.adodc1.recordset.movelastend subprivate sub command4_click() 保存me.adodc1.recordset.saveend subprivate sub command5_click() 返回主窗體 unload me form1.showend sub(3)成績(jī)查詢界面

10、圖4 成績(jī)查詢界面當(dāng)在圖2中點(diǎn)成績(jī)查詢,則進(jìn)入圖4界面,可以按課程和輸入條件進(jìn)行查詢。查詢之前結(jié)果:點(diǎn)擊查詢之后的結(jié)果:控件datagrid,實(shí)現(xiàn)數(shù)據(jù)的批量處理,該控件在控件庫(kù)microsoft datagrid control 6.0中。說(shuō)明:datagrid控件屬性設(shè)置dim kc_條件 as stringdim kc as stringprivate sub command1_click()kc_條件 = me.text1me.adodc1.recordsource = "select * from stu where " + kc + " " +

11、 kc_條件me.adodc1.refreshend subprivate sub form_load()kc_條件 = ">=92"kc = "vb"end subprivate sub option1_click()kc = "vb"end subprivate sub option2_click()kc = "math"end subprivate sub option3_click()kc = "english"end sub(4)姓名查詢界面(參考成績(jī)查詢界面) 圖5姓名查詢界面

12、輸入姓名后查詢程序代碼如下dim kc_條件 as stringdim kc as stringprivate sub command1_click()kc_條件 = me.text1me.adodc1.recordsource = "select * from stu where " + kc + "='" + kc_條件 + "'"me.adodc1.refreshend subprivate sub form_load()kc = "name"end sub(5)班級(jí)查詢界面(參考成績(jī)查詢界面

13、) 圖6班級(jí)查詢界面輸入班級(jí)后查詢dim kc_條件 as stringdim kc as stringprivate sub command1_click()kc_條件 = me.text1me.adodc1.recordsource = "select * from stu where " + kc + "='" + kc_條件 + "'"me.adodc1.refreshend subprivate sub form_load()kc = "class"end sub(6)統(tǒng)計(jì)總分界面。當(dāng)在圖

14、2中點(diǎn)統(tǒng)計(jì)總分,則進(jìn)入圖5界面。實(shí)現(xiàn)功能:當(dāng)點(diǎn)擊計(jì)算總分,則datagrid表格中total列為三門課的總分,結(jié)果如下 圖7 統(tǒng)計(jì)總分界面當(dāng)點(diǎn)擊清除總分列時(shí),則datagrid表格中total列清空,結(jié)果如下: 圖8 清除總分界面private sub command1_click()dim vb as integerdim math as integerdim english as integerme.adodc1.recordset.movefirstfor i = 1 to me.adodc1.recordset.recordcount vb = me.adodc1.recordset.

15、fields("vb").value math = me.adodc1.recordset.fields("math").value english = me.adodc1.recordset.fields("english").value me.adodc1.recordset.fields("total").value = vb + math + english me.adodc1.recordset.update me.adodc1.recordset.movenextnext iend subprivate

16、 sub command2_click()me.adodc1.recordset.movefirstfor i = 1 to me.adodc1.recordset.recordcount me.adodc1.recordset.fields("total").value = null me.adodc1.recordset.update me.adodc1.recordset.movenextnext iend sub(7)排名界面當(dāng)在圖2中點(diǎn)排名,則進(jìn)入圖9界面。 圖9 排名界面實(shí)現(xiàn)功能:當(dāng)總分計(jì)算完后,可以根據(jù)總分計(jì)算排名。當(dāng)點(diǎn)擊排名,則datagrid表格中mc列為

17、顯示出名次,結(jié)果如下:實(shí)現(xiàn)功能:當(dāng)點(diǎn)擊清除排名后,則datagrid表格中mc列為空,結(jié)果如下:private sub command1_click() 排名me.adodc1.recordsource = "select * from stu order by total desc"me.adodc1.refreshme.adodc1.recordset.movefirstfor i = 1 to me.adodc1.recordset.recordcount me.adodc1.recordset.fields("mc").value = i me.

18、adodc1.recordset.update me.adodc1.recordset.movenextnext iend subprivate sub command2_click() 清除排名me.adodc1.recordset.movefirstfor i = 1 to me.adodc1.recordset.recordcount me.adodc1.recordset.fields("mc").value = null me.adodc1.recordset.update me.adodc1.recordset.movenextnext iend sub(8)各

19、科成績(jī)段統(tǒng)計(jì)界面當(dāng)在圖2中點(diǎn)各科成績(jī)段統(tǒng),則進(jìn)入圖9界面。 圖9 各科成績(jī)段統(tǒng)計(jì)界面實(shí)現(xiàn)功能:在本界面上對(duì)各科的分?jǐn)?shù)段進(jìn)行統(tǒng)計(jì),并顯示在相應(yīng)的文本框中。當(dāng)點(diǎn)擊計(jì)算分?jǐn)?shù)段統(tǒng)計(jì),則在相應(yīng)的文本框中顯示各科的分?jǐn)?shù)段。private sub command1_click()dim vb_a as integer, vb_b as integer, vb_c as integer, vb_d as integer, vb_e as integerdim math_a as integer, math_b as integer, math_c as integer, math_d as integer,

20、math_e as integerdim english_a as integer, english_b as integer, english_c as integer, english_d as integer, english_e as integer me.adodc1.recordsource = "select * from stu where vb>=90" me.adodc1.refresh vb_a = me.adodc1.recordset.recordcount me.text1 = vb_a me.adodc1.recordsource = &

21、quot;select * from stu where vb>=80 and vb<90" me.adodc1.refresh vb_b = me.adodc1.recordset.recordcount me.text4 = vb_b me.adodc1.recordsource = "select * from stu where vb>=70 and vb<80" me.adodc1.refresh vb_c = me.adodc1.recordset.recordcount me.text7 = vb_c me.adodc1.re

22、cordsource = "select * from stu where vb>=60" me.adodc1.refresh vb_d = me.adodc1.recordset.recordcount me.text10 = vb_d me.adodc1.recordsource = "select * from stu where vb<60" me.adodc1.refresh vb_e = me.adodc1.recordset.recordcount me.text13 = vb_e me.adodc1.recordsource

23、= "select * from stu where vb>=90" me.adodc1.refresh math_a = me.adodc1.recordset.recordcount me.text2 = math_a me.adodc1.recordsource = "select * from stu where vb>=80 and vb<90" me.adodc1.refresh math_b = me.adodc1.recordset.recordcount me.text5 = math_b me.adodc1.reco

24、rdsource = "select * from stu where vb>=70 and vb<80" me.adodc1.refresh math_c = me.adodc1.recordset.recordcount me.text8 = math_c me.adodc1.recordsource = "select * from stu where vb>=60 " me.adodc1.refresh math_d = me.adodc1.recordset.recordcount me.text11 = math_d me.

25、adodc1.recordsource = "select * from stu where vb<60" me.adodc1.refresh math_e = me.adodc1.recordset.recordcount me.text14 = math_e me.adodc1.recordsource = "select * from stu where vb>=90" me.adodc1.refresh english_a = me.adodc1.recordset.recordcount me.text3 = english_a m

26、e.adodc1.recordsource = "select * from stu where vb>=80 and vb<90" me.adodc1.refresh english_b = me.adodc1.recordset.recordcount me.text6 = english_b me.adodc1.recordsource = "select * from stu where vb>=70 and vb<80" me.adodc1.refresh english_c = me.adodc1.recordset.

27、recordcount me.text9 = english_c me.adodc1.recordsource = "select * from stu where vb>=60 " me.adodc1.refresh english_d = me.adodc1.recordset.recordcount me.text12 = english_d me.adodc1.recordsource = "select * from stu where vb<60" me.adodc1.refresh english_e = me.adodc1.r

28、ecordset.recordcount me.text15 = english_eend sub(9)直方圖界面實(shí)現(xiàn)的功能:生成各科成績(jī)的直方圖。步驟如下:步驟1、在部件中加載chart控件: 步驟2、 步驟3:chart屬性設(shè)置如下:點(diǎn)擊生成vb直方圖按鈕后:private sub command1_click()me.adodc1.refresh mschart1.rowcount = 1 mschart1.columncount = me.adodc1.recordset.recordcount me.adodc1.recordset.movefirst for lngi = 1 to

29、 me.adodc1.recordset.recordcount mschart1.column = lngi mschart1.data = val(adodc1.recordset.fields("vb").value) mschart1.columnlabel = adodc1.recordset.fields("name").value adodc1.recordset.movenext next lngi mschart1.rowlabel = "vb成績(jī)直方圖"end subprivate sub command2_cli

30、ck()me.adodc1.refresh mschart1.rowcount = 1 mschart1.columncount = me.adodc1.recordset.recordcount me.adodc1.recordset.movefirst for lngi = 1 to me.adodc1.recordset.recordcount mschart1.column = lngi mschart1.data = val(adodc1.recordset.fields("math").value) mschart1.columnlabel = adodc1.r

31、ecordset.fields("name").value adodc1.recordset.movenext next lngi mschart1.rowlabel = "math成績(jī)直方圖"end subprivate sub command3_click()me.adodc1.refresh mschart1.rowcount = 1 mschart1.columncount = me.adodc1.recordset.recordcount me.adodc1.recordset.movefirst for lngi = 1 to me.adod

32、c1.recordset.recordcount mschart1.column = lngi mschart1.data = val(adodc1.recordset.fields("english").value) mschart1.columnlabel = adodc1.recordset.fields("name").value adodc1.recordset.movenext next lngi mschart1.rowlabel = "english成績(jī)直方圖"end sub(10)優(yōu)等生界面點(diǎn)擊圖2的優(yōu)等生界面,出現(xiàn)

33、圖10 圖10 優(yōu)等生界面點(diǎn)擊統(tǒng)計(jì)優(yōu)等生,出現(xiàn)private sub command1_click()dim vb as integerdim math as integerdim english as integerme.adodc1.recordsource = "select * from stu where (math+english+vb)/3>=90) or(math+english+vb)/3>=85 and (math=100 or english=100 or vb=100 )or(vb+english+math)/3>=85 and (vb>=95 and english >=95)or (english>=95 and math>=95)or ( math>=95 and vb>=95 )and (mc<=3) and (vb>=60 and english>=60 and math>=60)"me.adodc1.refreshend sub4.總結(jié)與體會(huì)通過(guò)本次課程設(shè)計(jì),我深刻感受

溫馨提示

  • 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)論