- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
CS1005 DATE \@ yyyy/M/d 2002/1/21
PAGE 5/ NUMPAGES 5
期末考評分標準
考題:
1. (15%) 請寫一個程式使用‘*’字元印出三角形型式的圖形。你的程式將請使用者輸入一個介於1到49(含)的正奇數整數,這個整數是三角形的底的大小。程式測試方式如下:
This program prints a triangle of stars 1 分
Key in the size of the base as an odd positive integer less than 50: 0 1 分
The input should be an odd integer between 1 and 49! 1 分
Key in the size of the base as an odd positive integer less than 50: 50
The input should be an odd integer between 1 and 49! 1 分
Key in the size of the base as an odd positive integer less than 50: 1
* 3 分
Press any key to continue
This program prints a triangle of stars
Key in the size of the base as an odd positive integer less than 50: 9 *
***
***** 4 分
*******
*********
Press any key to continue
This program prints a triangle of stars
Key in the size of the base as an odd positive integer less than 50: 49 /* Too long! omiited here */ 4 分
Press any key to continue
2. (15%) 請寫一個程式利用計算梯形面積的方式來計算一個一元三次方程式的積分。你的程式將先請使用者輸入一元三次方程式ax3 + bx2 + cx + d的四個係數,次方高的係數先輸入,再輸入積分的下限及上限,最後輸入欲分割的梯形的個數。程式執行的範例如下:
This program integrates a third order polynomial using the trapezoidal rule 1 分
Key in 4 doubles as the coefficients of the polynomial: -2 3 1 –4 1 分
Key in two doubles as the limits of the integration: 1 5 1 分
Key in an integer as the number of trapezoids to be used: 4 1 分
The result of the integration is –202.000000 1 + 2分
Press any key to continue
This program integrates a third order polynomial using the trapezoidal rule
Key in 4 doubles as the coefficients of the polynomial: -2 3 1 –4
Key in two doubles as the limits of the integration: 1 5
Key in an integer as the number of trapezoids to be used: 6
The result of the integration is –196.444444 2 分
Press any key to continue
This program integrates a third order polynomial using the trapezoidal rule
Key in 4 doubles as the coefficients of the polynomial: -2 3 1 –4
Key in two doubles as the limits of the integration: 1 5
Key in an intege
您可能关注的文档
最近下载
- 2025贵州毕节十九小教师“跨校竞聘”工作考试备考试题及答案解析.docx VIP
- 中国国家标准 GB/T 45007-2024职业健康安全管理体系 小型组织实施GB/T 45001—2020指南.pdf
- 2025贵州毕节二小教师“跨校竞聘”工作备考试题及答案解析.docx VIP
- 算法合集之《浅析倍增思想在信息学竞赛中的应用》.ppt VIP
- TCSEB 0010-2019 爆破安全监理规范.docx VIP
- 《水土保持工程施工监理规范》SL 523-2011.pdf VIP
- 《周期性麻痹》课件.ppt VIP
- 输液导管相关静脉血栓形成中国专家共识解读培训课件-中心医院.pptx
- 一种连续铸造半熔态轧制的铜铝复合板带及其生产工艺.pdf VIP
- 办公楼物业安全管理服务方案.docx VIP
文档评论(0)