聊城大学C语言课程实训任务书wangh_第1页
聊城大学C语言课程实训任务书wangh_第2页
聊城大学C语言课程实训任务书wangh_第3页
聊城大学C语言课程实训任务书wangh_第4页
聊城大学C语言课程实训任务书wangh_第5页
已阅读5页,还剩10页未读, 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、C语言实训任务书一、实训目标通过项目实战,掌握C语言掌握C语言的精髓:指针、函数、结构体的使用、文件读写。课程要求从两个方面的能力目标实现,素养目标要求学员在通过学习具备相对应的学习技能、素养要求;技术目标要求学员必须掌握课程产品所定义的知识与技能。(1)素养目标v 阅读帮助文档的能力;v 问题解决能力、总结归纳能力;(2)技术目标v 使用C语言编程的能力;二、实训内容(见附录)三、实训进度安排按教学计划规定,该设计总学时数为3周,其进度及时间大致分配如下:序号设计内容天数(约占比例)1基于控制台的学员管理系统22基于控制台的名片管理系统23基于控制台的银行存储系统模拟项目34项目点评、总结1

2、总计8天四、考核评定考核分类考核方式成绩比例过程考核课堂表现学习态度、课堂提问40项目考核项目考核项目实战表现、自主学习60 聊城大学C语言实训题目 ATM机银行仿真模拟系统 指导教师: 王春哲 姓名: 王秀明 学号: 班级: 2012级3班 专业: 电子信息科学与技术 地点: 聊城大学 时间: 7月15 日 至 7月22日 一、项目名称创建ATM模拟管理系统二、功能要求摘要二十世纪末,随着金融服务的迅速发展,银行提款机已经发展成了各大银行金融服务战略中的重要一环,同时,银行提款机系统也经历了持续的更新换代为广大用户提供了更加便捷和人性化的服务。模拟ATM系统就是对提款机操作系统在个人PC上及

3、主流操作平台上的编程实现,其开发主要包括后台数据库的建立和维护以及前端应用程序的开发制作两个方面。对于前者要求建立起数据一致性和完整性强、数据安全性好的库。而对于后者则要求应用程序功能完备,易使用界面友好等特点。本系统采用VS2005,微软SQLSERVER2005,实现了用户身份的认证、取款转帐、交易明细的查询等功能。分析并解决实现中遇到的若干问题,例如数据库资料如何实现更新,文本框的文字输出需要用到什么技术,如何实现中英文两种界面,用户服务功能如何实现等等。 三、需求分析四、设计思想,在头文件下面建立一个ATM.h和function.h的头文件。头文件的ATM.h的文件是对执行文件的信息进

4、行声明。Char zhanghao40;/,char xingming 40;/用户姓名,char phone20;/电话号码,char mima 20;/密码,char ximima20;/新密码,double cm:/存入金额,static double;/利率。function.h文件是对函数就行声明/int kehu();/客户,int guanli();/管理端,int change();/修改密码,int open();/开户,int query();/查询,int lilv();/利率计算,int jiexi();/计息五、具体实现六、附录typedef structchar a

5、ccount40; /账号 char name20; /姓名 char phone20; /电话号码 char password40; /密码char npassword40; /新密码double cm; /存入的金额double qm; /取走的金额double sm; /剩余的金额double zm; /转账的金额static double lilv; /利率ATM; #include"stdafx.h"#include<conio.h>#include<malloc.h>#include<string.h>#include&quo

6、t;atm.h"extern ATM*atm;extern int current; extern int total; int kehu()char account40;char password40;printf("请输入账户名: n");scanf("%s",account);int i;for (i=0;i<current;i+)if(strcmp(atmi.account,account)=0)break;if(i>=current)printf("该账号不存在! n");return 1;elsepr

7、intf("请输入密码 n");scanf("%s",password);if(strcmp(atmi.password,password)!=0)printf("密码错误! n");return 1;char choice; while (1)printf("n");printf("t 用户端功能主菜单 n"); printf("t * n");printf("t 1.取款 n");printf("t 2.存款 n");printf(

8、"t 3.查询账户 n");printf("t 4.转账 n");printf("t 5.修改密码 n");printf("t 0.返回上一级 n");printf("t * n");printf("n");printf("t 请选择: n");choice=getch();switch(choice)case'1':printf("温馨提示:当前金额为%lfn",atmi.sm);printf("取款值必须为

9、100的倍数,且最多不得超过2000! n");printf("请输入取款金额:");scanf("%lf",&atmi.qm);atmi.sm=atmi.sm-atmi.qm;printf("当前金额:%lf保存成功n",atmi.sm);break;case '2':printf("请输入要存金额:");scanf("%lf", &atmi.cm);atmi.sm=atmi.sm+atmi.cm;printf("当前余额为:%lf保存成功n

10、",atmi.sm);break;case '3': printf("账户信息如下 n"); printf("账户名:%sn", atmi.account);printf("姓名:%sn", );printf("电话号码:%sn", atmi.phone);printf("余额:%lfn",atmi.sm);break;case'4':printf("请输入转账金额:");scanf("%lf",

11、 &atmi.zm);printf("请输入转账对象账号:");scanf("%s", account);int j;for (j = 0; j < current; j+)if (strcmp(atmj.account, account) = 0)break;if (j >= current)printf("转账对象账号不存在!n");elseatmi.sm = atmi.sm-atmi.zm;atmj.sm = atmj.sm+atmi.zm;printf("该用户当前余额为:%lfn",

12、atmi.sm);break;case'5':printf("请输入原密码:");scanf("%s",password);printf("请输入新密码:");scanf("%s", atmi.npassword);printf("保存成功!n");break;case'0':return 0;default:printf("非法选择,请重新选择n");extern ATM *atm;extern int current;extern int

13、total;double ATM:lilv=0.045;int guanli() char adminPass40; /管理员密码 printf("t 请输入密码: n");scanf("%s",adminPass);if(strcmp("00",adminPass)!=0) printf("管理员密码错误!n");return 1; char choice; while(1) printf("t 程序功能n"); printf("t 1:开户 n"); printf(&qu

14、ot;t 2:查询账户信息n"); printf("t 3:修改账户密码n"); printf("t 4:设置利率n"); printf("t 5:结息n"); printf("t 6:删除账户信息n"); printf("t 0:返回上一级n"); printf("n"); printf("请选择:n"); choice=getch(); char password40; char account40; int i; switch(choice

15、) case '0': return 0; case '1': while(total<=0)printf ("请输入要开户的个数:");scanf ("%d",&total);if(atm=NULL)atm=(ATM*)malloc(total * sizeof(ATM);if(atm=NULL)printf("内存空间不够!n");return 1;if (total <= 0)atm = (ATM*) malloc(2 * sizeof(ATM);if (atm != NULL

16、)total = 2;elseprintf("内存空间不够!n");return 1;if (current >= total)ATM *t = NULL;t = (ATM*) malloc(total + 2) * sizeof(ATM);if (t = NULL)printf("内存空间不够!n");return 1;memcpy(t, atm, total * sizeof(ATM);free(atm);atm = t;total = total + 2;printf("请输入账号:");scanf("%s&qu

17、ot;, atmcurrent.account); for(i=0;i<current;i+)if (strcmp(atmi.account, atmcurrent.account) = 0)break;if( i < current )printf("该账号已经存在!n");elseprintf("请输入姓名:");scanf("%s", );printf("请输入电话号码:");scanf("%s", atmcurrent.phone);printf

18、("请输入存入的金额:");scanf("%lf", &atmcurrent.cm);printf("请输入密码:");scanf("%s", atmcurrent.password);printf("请重新输入密码:");scanf("%s", atmcurrent.npassword);atmcurrent.qm = 0;atmcurrent.sm = atmcurrent.cm - atmcurrent.qm;if (strcmp(atmcurrent.pass

19、word, atmcurrent.password) != 0)printf("两次密码不一致:n");elseprintf("操作成功,信息如下:n");printf("t 账号:%sn", atmcurrent.account);printf("t 姓名:%sn", );printf("t 电话号码:%sn", atmcurrent.phone);printf("t余额:%lfn", atmcurrent.sm);printf("t

20、 保存成功! n");current+;break; case'2': printf("请输入要查询的账户名:"); scanf("%s", account);for (i = 0; i < current; i+)if (strcmp(atmi.account, account) = 0)break;if( i >= current )printf("该账户不存在!nn");elseprintf("第%d个账户信息 n", i + 1);printf("账户信息如下

21、 n");printf("账户名:%sn", atmi.account);printf("姓名:%sn", );printf("电话号码:%sn", atmi.phone);printf("余额:%lfn",atmi.sm);break; case '3': printf("请输入要修改密码的账户名:"); scanf("%s", account);for ( i = 0; i < current; i+)if (strcmp

22、(atmi.account, account) = 0)break;if( i >= current )printf("该账户不存在!nn");elseprintf("请输入原始密码:");scanf("%s", password);if (strcmp(atmi.password, password) = 0)printf("请输入新密码:");scanf("%d", atmcurrent.npassword);printf("保存成功!n");elseprintf(

23、"密码错误,请重新输入!nn");return 1;break;case '4':printf("当前利率是:%lfn",ATM:lilv);printf("请输入新的利率:");scanf("%lf",&ATM:lilv);printf("保存成功!n");break;case'5': printf("请输入要结息的账户名:"); scanf("%s", account);for ( i = 0; i < c

24、urrent; i+)if (strcmp(atmi.account, account) = 0)break;if( i >= current )printf("该账户不存在!nn");elseprintf("该用户的结息金额为:%lfn", atmi.sm+atmi.sm*ATM:lilv);atmi.sm = atmi.sm+atmi.sm*ATM:lilv;break;case '6':printf("请输入要删除的账户名:");scanf("%s", account);for ( i

25、= 0; i < current; i+)if (strcmp(atmi.account, account) = 0)break;if( i >= current )printf("该账户不存在!nn");elseprintf("第%d个账户信息 n", i + 1);printf("账户信息如下 n");printf("账户名:%sn", atmi.account);printf("姓名:%sn", );printf("电话号码:%sn", a

26、tmi.phone);printf("余额:%lfn", atmi.sm);memcpy(atm+i, atm+i+1, (current-i) * sizeof(ATM);-current;printf("删除成功n");break; default:printf("非法选择,请重新选择n"); return 0;/ Atm Manager.cpp : 定义控制台应用程序的入口点。/#include "stdafx.h"#include<conio.h>#include"atm.h"#include <malloc.h>#include "function.h"#include<string.h>ATM*atm;int current=0; /存入的金额int total; /总金额int _tmain(int argc, _TCHAR* argv)while(1)char choice;char password40;char in

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论