1、 面面向向对对象象程程序序设设计计 课课程程设设计计 题 目: 教学游戏 院 系: 数学与计算科学 专 业: 信息与计算科学 姓名学号: 指导老师: 日 期: 2014 年 12 月 01 日 摘 要 这次课程设计是编写一个教学游戏,教授学生学习算术计算。程序将对 加法和减法进行测试。 程序共有四个难度级别, 第 1 级测试两个小于 10 并且 和也小于 10 的数字加法; 第 2 级进行任何两个 1 位数字的加法; 第 3 级是差 为非负的两个 1 位数的减法。程序将随机产生问题并读取游戏参与者输入的 答案;第 4 级是执行一个两位数的加法。对于每一个问题,游戏参与者都有 两次回答问题的机会
2、。在得到 5 分后游戏进入下一级。为此,本文首先通过 建立 CRC 卡片分析程序要求,拟定要建立的类与功能,然后建立 UML 类图, 把功能函数具体化,最后进行代码的填充和调试。此外,我还设计了一个简 单的控制台界面, 使得游戏的互动操作更加友好, 具体的分析可以详见下文, 经过最后运行结果的调试是没有问题的,本次课程设计对于我来说也是有一 定的启示意义的,让我学到了许多面向对象开发的流程和技巧。 关键字:教学游戏关键字:教学游戏 算术计算算术计算 CRC 卡片卡片 UML 类图类图 Abstract This course is designed to write a teaching ga
3、mes, teaching students to grasp arithmetic calculations. The program will be tested on addition and subtraction. The program with a total of four difficulty levels, the level 1 tests two less than 10 and their sum also less than 10 digital addition. the level 2 will be underway any two one digits ad
4、dition. Level 3 is the difference for non-negative two one digits subtraction. The program will be randomly generated problems and reads the game participants enter the answer; Phase 4 is to perform a double-digit addition. For each question, the game players have two chances to answer the question. After gaining five points the game turn to the next level. Therefore, this paper through establishin