




版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、功能:計(jì)算一整學(xué)年的加權(quán)平均分,輸出各科成績(jī)及加權(quán)平均分。流程圖:開(kāi)始輸出 input the students No:輸入No/ 輸出 input the students Birthday(YYYY-MM-DD):輸入 Year,Month,Day輸出 input the students Scores(Math1):輸入Math1輸出 input the students Scores(Math2):輸入Math2輸出 input the students Scores(IdeologicalandMoralCultivationandBasicLawEducation):輸入 Ideo
2、logicalandMoralCultivationandBasicLawEducationTotal=Math1+Math2+IdeologicalandMoralCultivationandBasicLawEducationAverage=Total/17WeightedAverage=(5*Math1+5*Math2+3*English1+3*English2+1*MilitaryTheory+3*Chemistry+4*Physics+2*theModernHistoryofChina+3.5*Computer+0.5*MathematicalExperiment1+0.5*Mathe
3、maticalExperiment2+5*Circuit+3*LinearAlgebra+2.5*PrincipleofMarxism+2*MentalHealth+2.5*EngineeringGraphics+2.5*IdeologicalandMoralCultivationandBasicLawEducation)/(5+5+3+3+1+3+4+2+3.5+0.5+0.5+5+3+2.5+2+2.5+2.5)輸出 Math1,Math2,Total,Average,WeightedAverage結(jié)束N-S 圖:輸出 input the students No:輸入No輸出 input
4、the students Birthday(YYYY-MM-DD):輸入 Year,Month,Day輸出 input the students Scores(Math1):輸入Math1輸出 input the students Scores(IdeologicalandMoralCultivationandBasicLawEducation):輸入 IdeologicalandMoralCultivationandBasicLawEducation1Total=Math1+Math2+IdeologicalandMoralCultivationandBasicLawEducationAve
5、rage=Total/17WeightedAverage=(5*Math1+5*Math2+3*English1+3*English2+1*MilitaryTheory+3*Chemistry+4*Physics+2*theModernHistoryofChina+3.5*Computer+0.5*MathematicalExperiment1+0.5*MathematicalExperiment2+5*Circuit+3*LinearAlgebra+2.5*PrincipleofMarxism+2*MentalHealth+2.5*EngineeringGraphics+2.5*Ideolo
6、gicalandMoralCultivationandBasicLawEducation)/(5+5+3+3+1+3+4+2+3.5+0.5+0.5+5+3+2.5+2+2.5+2.5)輸出 Math1,Math2,Total,Average,WeightedAverage源代碼:#include void main ()unsigned long No; 學(xué)號(hào)/unsigned int Year,Month,Day/ 生日f(shuō)loat Math1,Math2,English1,English2,MilitaryTheory,Chemistry,Physics,theModernHistoryo
7、fChina,Computer;成績(jī)/float MathematicalExperiment1,MathematicalExperiment2,Circuit,LinearAlgebra,PrincipleofMarxism; / 成 績(jī)/float MentalHealth,EngineeringGraphics,IdeologicalandMoralCultivationandBasicLawEducation; 成績(jī)/float Total,Average,WeightedAverage; /總分、平均分、加權(quán)平均分/printf(input the students No:);sca
8、nf(%8ld,&No);printf(input the students Birthday(YYYY-MM-DD):);scanf(%4d-%2d-%2d,&Year,&Month,&Day);printf(input the students Scores(Math1):);scanf(%f,&Math1);printf(input the students Scores(Math2):);scanf(%f,&Math2);printf(input the students Scores(English1):);scanf(%f,&English1);printf(input the s
9、tudents Scores(English2):);scanf(%f,&English2);printf(input the students Scores(MilitaryTheory):);scanf(%f,&MilitaryTheory);printf(input the students Scores(Chemistry):);scanf(%f,&Chemistry);printf(input the students Scores(Physics):);scanf(%f,&Physics);printf(input the students Scores(theModernHist
10、oryofChina):);scanf(%f,&theModernHistoryofChina);printf(input the students Scores(Computer):);scanf(%f,&Computer);printf(input the students Scores(MathematicalExperiment1):);scanf(%f,&MathematicalExperiment1);printf(input the students Scores(MathematicalExperiment2):);scanf(%f,&MathematicalExperimen
11、t2);printf(input the students Scores(Circuit):);scanf(%f,&Circuit);printf(input the students Scores(LinearAlgebra):);scanf(%f,&LinearAlgebra);printf(input the students Scores(PrincipleofMarxism):);scanf(%f,&PrincipleofMarxism);printf(input the students Scores(MentalHealth):);scanf(%f,&MentalHealth);
12、printf(input the students Scores(EngineeringGraphics):);scanf(%f,&EngineeringGraphics);printf(input the students Scores(IdeologicalandMoralCultivationandBasicLawEducation):); scanf(%f,&IdeologicalandMoralCultivationandBasicLawEducation);Total=Math1+Math2+English1+English2+MilitaryTheory+Chemistry+Ph
13、ysics+theModernHistoryofChina+Com puter+MathematicalExperiment1+MathematicalExperiment2+Circuit+LinearAlgebra+PrincipleofMarxism+Mental Health+EngineeringGraphics+IdeologicalandMoralCultivationandBasicLawEducation;Average=Total/17;WeightedAverage=(5*Math1+5*Math2+3*English1+3*English2+1*MilitaryTheo
14、ry+3*Chemistry+4*Physics+2 *theModernHistoryofChina+3.5*Computer+0.5*MathematicalExperiment1+0.5*MathematicalExperiment2+5*Cir cuit+3*LinearAlgebra+2.5*PrincipleofMarxism+2*MentalHealth+2.5*EngineeringGraphics+2.5*IdeologicalandMor alCultivationandBasicLawEducation)/(5+5+3+3+1+3+4+2+3.5+0.5+0.5+5+3+
15、2.5+2+2.5+2.5);printf(nNo:%8ldnBirthday:1%4d-%2d-%2dnMath1:%7.2fnMath2:%7.2fnEnglish1:%7.2fnEnglish2:%7.2f nMilitaryTheory:%7.2fnChemistry:%7.2fnPhysics:%7.2fntheModernHistoryofChina:%7.2fnComputer:%7.2fn MathematicalExperiment1:%7.2fnMathematicalExperiment2:%7.2fnCircuit:%7.2fnLinearAlgebra:%7.2fnP
16、rinci pleofMarxism:%7.2fnMentalHealth:%7.2fnEngineeringGraphics:%7.2fnIdeologicalandMoralCultivationandBasic LawEducation:%7.2fnTotal:%7.2fnAverage:%7.2fnnWeightedAverage:%7.2fn,No,Year,Month,Day,Math1,Mat h2,English1,English2,MilitaryTheory,Chemistry,Physics,theModernHistoryofChina,Computer,Mathema
17、ticalExperim ent1,MathematicalExperiment2,Circuit,LinearAlgebra,PrincipleofMarxism,MentalHealth,EngineeringGraphics,Ideo logicalandMoralCultivationandBasicLawEducation,Total,Average,WeightedAverage);運(yùn)行結(jié)果:+Microsoft Visual SludMyProjectspractiseDebugwei ghted avefae.exeinput input; input input: input
18、 input input input input in put: input input; liipiiit input input: input input Input input 1tlie tlic the tFie the tlie tlic the the the tlie tlic tlie the the t:llG tlic tllE thestiident1 窖 stiidentf 葬stuilEnts s stmilBnt1 s studentJ $student*sstmdDntJ s stiidentf 葬 student1s stuflents s studentJ
19、s studentJ $ studentJs student*s叵Nos &21tQlld5D ipfchday ( V V V-HH-ID: 1957-i i-20Scoiresl1 =9?ScDres:81cavesCEnyllslil D : 0ScoresEng*LiliS1 : 92Score3 :91SicoresChenilstr ) : 88Scoves:78S c: ares C t he Haderr H is. t a viof Ch in a :8&ScorasConpLiter ) s 83corcscpcr!incntl = 92Scores = 96Scores:98ScaivestLiinieavAlgehpa) :7SScoiBsPpi.nci.pleofs 95Scorcs =8GS cares :?9S
溫馨提示
- 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ì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 學(xué)校教室裝修項(xiàng)目的施工合同
- 新建自建房購(gòu)買(mǎi)合同樣本
- 全新夫妻離婚前財(cái)產(chǎn)分割合同
- 建設(shè)工程合同管理規(guī)范
- 度渠道拓展合作合同
- 餐飲服務(wù)合同模板與消防相關(guān)
- 音樂(lè)藝人經(jīng)紀(jì)合同范本
- 化工產(chǎn)品出口代理合同書(shū)
- 簡(jiǎn)易彩鋼瓦合同范本
- Module 6 Unit 3 language in use 教學(xué)設(shè)計(jì) 2024-2025學(xué)年外研版八年級(jí)英語(yǔ)上冊(cè)
- 二年級(jí)下冊(cè)計(jì)算小能手帶答案
- 2024年臨滄市工業(yè)產(chǎn)業(yè)發(fā)展集團(tuán)限公司招聘2名公開(kāi)引進(jìn)高層次人才和急需緊缺人才筆試參考題庫(kù)(共500題)答案詳解版
- 2023年3月云南專(zhuān)升本大??肌堵糜螌W(xué)概論》試題及答案
- 一年級(jí)趣味數(shù)學(xué)幾和第幾
- 2024年中國(guó)科學(xué)技術(shù)大學(xué)創(chuàng)新班物理試題答案詳解
- 方案優(yōu)缺點(diǎn)對(duì)比表模板
- 數(shù)據(jù)真實(shí)性承諾書(shū)
- 充電站風(fēng)險(xiǎn)管理的法律法規(guī)研究
- 類(lèi)案檢索報(bào)告
- 數(shù)字媒體藝術(shù)概論數(shù)字媒體藝術(shù)理論概述
- 企業(yè)開(kāi)展防震減災(zāi)知識(shí)講座
評(píng)論
0/150
提交評(píng)論