帮帮忙~~编一下这个程序~~感激不尽!!!
各位牛人帮忙看一下~~Course Work
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
a) 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
b) 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
底下是翻译~~很不准确的~~大家见谅~~帮帮忙啊~~~
译文
该方案将首先要求他/她的身份证号码(包括两个字母及数字),例如,用户
请输入您的4位数字的ID号:AB1234
方案中应输入验证。
1) 然后程序会提示三个选择:
(1)开始测试
(2)检查评分
(3)退出
b)测试:该计划将给予10数学问题,例如:
12 * 3 = 36
48 + 32 = 80
...
28分之56= 2
注意:
1)学生将在未来一前回答每个问题给出。
2)这些问题应包括加法,减法,乘法和除法。他们是随机生成的。
3)随机生成数字的问题。但是,必须确保这两个问题,结果不超过两位数字。这个问题,其结果应大于或等于零。除数不能为零。
四,经过十年的问题)完成后,由学生记录用于执行10问题的时间。
5)给出了分数,每个学生。保存这名学生的ID,他/她的分数,并到一个名为'文件中使用的时间record.txt'。
6)打印在屏幕上的以下信息:
Prob。 |正确Answ。 |乌尔Answ
c)检查分数:搜索文件'record.txt',并列出了这名学生的所有历史成绩,例如:
你以前的记录是:
AB1234 80 150秒
AB1234 50一八二秒
AB1234 98秒90
谢啦谢啦~~