银行自助管理系统

本学期的课程设计作业。经过苦思冥想之后,确定了银行自助管理系统。

系统功能主要有一下几点:账户注册,账户登陆,账户信息修改,账户密码修改,账户存款取款,管理员账户登陆,指定账号冻结,指定账号解冻,指定账号信息查看,管理员密码修改,信息保存,文件储存。为美化界面所用界面背景颜色以及字体颜色控制,界面中的光标移动,清屏函数,按任意键继续函数等。

功能很多,运用模块化思想,使用函数进行系统的拼接,写出高效,简洁代码。不过本次课程设计有所不足,功能中有一个功能由于时间以及我个人能力不足,删去一个有关交易记录功能,这个功能初始想法是运用邻接表储存数据,写到文件中,进行读取,写入。但是交易记录储存一块代码运行出现问题,由于时间的问题,删去了这一功能。考虑而系统信息储存用数组会造成数据过多而带来系统崩溃,因此主要的思想是运用链表操作来实现文件的储存遍历,查找。所以说我这次课程设计很水,没有达到预期效果。自己还是很菜很菜的菜鸟。

#include<stdio.h> 
#include<stdlib.h>
#include<time.h>
#include<algorithm> 
#include<windows.h>
#include<conio.h>
#include<string.h>
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
typedef struct stu{
char name[110];//姓名 
long long account;//账号 
char password[110];//密码 
char license[110];//证件号 
char address[110];//住址 
long long balance;//余额 
long long Deposit;//存款金额 
int v;//账号是否冻结 
stu *l; 
}st,*J;
void gotoxy(int x, int y)//设置光标位置
{
    COORD pos = {x,y};
    SetConsoleCursorPosition(hConsole, pos);
}
int flag1;
J now;//当前账户  
long long x1;
long long Ap;
void Main_interface(J head,J tail);//主界面 
void login_interface(J head,J tail);//用户登录界面 
void Loan_advice(J head,J tail);//贷款利率表 
void Storage_consulting(J head,J tail);//存储利率表 
void Register_account(J heda,J tail);//账号注册
void Information_read(J head,J tail);//信息读取
void Management(J head,J tail);//用户业务办理 
void Withdrawal(J head,J tail);//取款 
void deposit(J head,J tail);//存款 
void Modification(J head,J tail);//信息修改
void Change_password(J head,J tail);//密码修改
void Administrator(J head,J tail);//管理员管理
void Option(J head,J tail);//管理员选项
void search(J head,J tail);//账户搜索 
void freeze_Thaw(J head,J tail,int c);//冻结账号
void Change(J head,J tail);//管理员密码更改 
void save(J head,J tail);//信息写入文件 
void ALook_(J head,J tail);//指定账户信息查看 
char* fun()
{
    time_t t1;
    t1=time(NULL);
    char *t2;
    t2=ctime(&t1);
    return t2;
}
int main()
{
    x1=123456;
    Ap=111111;
st *head;
st *tail;
flag1=0;
srand((unsigned int)time(NULL));
system("mode con: cols=90 lines=30");
system("color 74");
head=new st;
tail=head;
Information_read(head,tail);
Main_interface(head,tail);
return 0; 
}
void Information_read(J head,J tail)
{
st *p;
head->l=NULL;
tail=head; 
system("mode con: cols=90 lines=30");
FILE *fp1;
if((fp1=fopen("个人信息.txt","r"))==NULL)
{
printf("后台文件出错,无法正常工作,请尽快联系管理员处理。");
flag1=1;
}
long long x;
while(fscanf(fp1,"%lld",&x)!=EOF)
{
   p =new st;
   p->l=NULL;
   p->account=x;
fscanf(fp1,"%s",p->name);
fscanf(fp1,"%lld",&p->balance);
fscanf(fp1,"%s",p->password);
fscanf(fp1,"%s",p->license);
fscanf(fp1,"%s",p->address);
fscanf(fp1,"%lld",&p->balance);
fscanf(fp1,"%lld",&p->Deposit);
fscanf(fp1,"%d",&p->v);
tail->l=p;
tail=p;
}
fclose(fp1);
}
void Main_interface(J head,J tail)
{
int i;
system("mode con: cols=90 lines=30");
gotoxy(0,1);
printf("*****************************************************************************************\n");
for(i=1;i<29;i++)
{
gotoxy(0,i);
printf("*");
gotoxy(89,i);
printf("*");

gotoxy(32,5);
printf("欢迎使用银行自主管理系统"); 
gotoxy(36,11);
printf("1.用户登录\n");
gotoxy(36,12);
printf("2.贷款利率\n");
gotoxy(36,13);
printf("3.存储利率\n");
gotoxy(36,14);
printf("4.账号注册\n");
gotoxy(36,15);
printf("5.管理员登陆\n");
gotoxy(0,29);
printf("*****************************************************************************************\n");
gotoxy(36,22);
printf("请输入您的选择:");
char s[110];
scanf("%s",s);
if(strlen(s)>1||s[0]-'0'<1||s[0]-'0'>5)
{
   system("cls");
gotoxy(36,21);
printf("输入有误,请重新输入\n");
Main_interface(head,tail); 
}
else
{
int x;
sscanf(s,"%d",&x);
switch(x)
{
case 1:system("cls");login_interface(head,tail); break;
case 2:system("cls");Loan_advice(head,tail);break; 
case 3:system("cls");Storage_consulting(head,tail);break;
    case 4:system("cls");Register_account(head,tail);break; 
case 5:system("cls");Administrator(head,tail);break; 

 }

void Management(J head,J tail)
{
int i;
system("mode con: cols=90 lines=30");
gotoxy(0,1); 
printf("*****************************************************************************************\n");
for(i=1;i<29;i++)
{
gotoxy(0,i);
printf("*");
gotoxy(89,i);
printf("*");

gotoxy(36,10);
printf("1.取款\n");
gotoxy(36,11);
printf("2.存款\n");
gotoxy(36,12);
printf("3.个人信息修改\n");
gotoxy(36,13);
printf("4.密码修改\n");
gotoxy(36,14);
printf("5.返回主界面\n");
gotoxy(0,29);
printf("*****************************************************************************************\n");
gotoxy(36,22);
printf("请输入您的选择:");
char s[110];
scanf("%s",s);
if(strlen(s)>1||s[0]-'0'<1||s[0]-'0'>5)
{
   system("cls");
gotoxy(36,21);
printf("输入有误,请重新输入\n");
login_interface(head,tail); 

  • 2
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值