- 9
- 0
- 约1.57千字
- 约 2页
- 2021-01-27 发布于河北
- 举报
Coursework 2016 DeadLine June 27th
?
Write a program that will help elementary school pupils practice math.
a)??????The program will first ask the user for his/her ID number (including two letters 4 digits), e.g.
Please input your four digit ID no:?AB1234
???????The program should have input validation.
Then the program prompts three choices:
(1)???Start a test
(2)???Check scores
(3)???Exit
?
Test: the program will give 10 math problems, e.g.:
?
12 *??3 =?36
48 + 32 =?80
…
56 / 28 =?2
?
Note:
i) Pupils will answer each problem before the next one is given.
?
ii) The problems should include addition, subtraction, multiplication and division. They are randomly generated.
?
iii) Randomly generates numbers for problems. However, must ensure that both the problem and the result are no larger than two digits. The problem and the result should be greater than or equal to zero. The divisor cannot be zero.
?
iv) After ten problems are finished, record the time used by the student to do the ten problems.
?
v) Gives a score to each student. Saves this student’s ID, his/her score and the time used into a file named ‘record.txt’.
?
vi) Print the following information on the screen:
Prob. | Correct Answ.? | ?Ur Answ
?
c)??????Check scores: Searches the file ‘record.txt’ and lists all the historical scores for this student, e.g.:
?
Your previous records are:
AB1234??80??150 seconds
AB1234??50??182 seconds
AB1234??90??98 seconds
?
?
You will be marked based on your program’s:
(1)????Correctiveness
(2)????Readability
(3)????Robustness
(4)????Conciseness
您可能关注的文档
- cisco 静态路由与默认路由配置.ppt
- citilog与威路特技术对比文件.doc
- cip改善案例讲解.ppt
- cisp0205网络安全设备(周军修改).ppt
- cmis30基础数据提取软件(fep)v200.doc
- cmos 集成逻辑门电路.ppt
- cites(华盛顿公约)介绍.ppt
- commvault备份软件指标.doc
- company intranet 企业内部网络.doc
- comsol multiphysics acdc模块用户指南.pdf
- 伟明环保-市场前景及投资研究报告-境内业务稳健运行,印尼市场贡献边际增量.pdf
- 桂东县法院系统招聘考试真题2025.pdf
- 贵州省黔南布依族2026年中考三模物理试题及答案.pdf
- 贵州省黔南州2026年中考语文二模试卷附答案.pdf
- 贵州省铜仁市2026年中考语文二模试卷附答案.pdf
- 2026上半年安徽事业单位联考合肥市庐江县招聘36人备考题库及一套完整答案详解.docx
- 贵州省毕节市2026年中考语文一模试卷附答案.pdf
- 贵州省贵阳市南明区2026年中考语文一模试卷附答案.pdf
- 2026上半年安徽事业单位联考合肥市庐江县招聘36人备考题库及一套参考答案详解.docx
- 贵州省贵阳市白云区2026年中考二模物理试题附答案.pdf
原创力文档

文档评论(0)