C语言考试系统
数据结构
课程设计报告
设计题目:设计一个C语言考试系统
专 业 软件工程
班 级 0911
学 生 彭仕剑
学 号
指导教师 邓松
起止时间 -6-15 至 -7-8
实验目的
1、加深对授课内容的理解
2、通过设计,熟练上机调试程序
3、提高C语言综合程序设计能力
二、实验题目与相关说明
题目: 设计一个C语言考试系统
功能: 该考试系统主要针对客观题(单选题)进行自动出题与答题。首先要根据章节,难度录入试题,即每道题目有章节也有难度。要设计一个教师试卷设计模块,让教师选择考试的章节与每个章节要多少道题目,题目由难度系数为多少。系统根据教师的选择,随机选择题目组成一试卷,让学生答题
要求:1)界面友好,函数功能要划分好
2)总体设计应画一流程图
3)程序要加必要的注释
4) 要提供程序测试方案
5) 程序一定要经得起测试,宁可功能少一些,也要能运行起来,不能运行的程序是没有价值的。
三、程序功能简介
该考试系统主要针对客观题(单选题)进行自动出题与答题。它具有录入试题,选题测验等功能。
“录入试题”为教师试题设计模块,在该模块中教师可以输入相应的C语言试题,系统会自动将输入的试题存入一个相关文件中。“选题测验”为教师试卷设计模块,在该模块中教师可以规定考试要多少道题目,,系统将根据教师的需要,随机选择题目组成一份试卷,让学生答题,但模块中试题的章节和难度系数设计我还未完成。
此外,我在该系统中添加了试卷评分功能。它能够根据试卷题目的数量,以及考生做对的试题数来评分。
四、程序相关函数及说明
int MenuChoice(void);
该函数主要负责进入系统主界面,教师可以在此界面选择相应的功能。
struct question *InsertList(struct question *fst, const struct question *ad);
该函数用于实现试题的存储,它用的是动态存储方式。
struct question *ListSeek(struct question *seek, long len, long max);
该函数用于试题的搜索,即“选题测验”模块中对试题的选择。
void GetQuestion(struct question *src);
该函数用于实现试题的录入,函数中还调用了int GetAnswer(void)。
void SaveFile(const struct question *ed, FILE *saf);
该函数用于打开系统文件,此文件中为考试试题。
struct question *LoadFile(struct question *td, FILE *laf);
该函数用于创建文件,函数返回值为数据的存放地址。
int GetAnswer(void);
该函数用于存储各试题的正确答案,答案只限A、B、C、D。
void ExplainQuestion(const struct question *que, int n);
该函数用于对考生答题后的试卷评分,即实现系统评分功能。
五、程序源码
#include
#include
#include
#include "conio.h"
struct question {
char ask[200];
char answer[4][80];
int right;
struct question *next;
};
int MenuChoice(void);
struct question *InsertList(struct question *fst, const struct question *ad);
struct question *ListSeek(struct question *seek, long len, long max);
void GetQuestion(struct question *src);
void SaveFile(const struct question *ed, FILE *saf);
struct question *LoadFile(struct question *td, FILE *laf);
int GetAnswer(void);
void ExplainQuestion(const struct question *que, int n);
struct question *Lis
如果觉得《C语言的考试系统 C语言考试系统.doc》对你有帮助,请点赞、收藏,并留下你的观点哦!