简单的银行管理系统的C语言代码

合集下载

C语言银行储蓄系统源码

C语言银行储蓄系统源码
putchar('*');
}
printf("\n");
r=strcmp(banks[accountnum].password,password1);
if(r!=0)
{
printf("两次密码不相同,开户失败!\n");
return;
}
banks[accountnum].balance=0;
banks[accountnum].state=0;
if(money==0)
{
printf("转账失败\n");
return;
}
else
{
if(money>banks[nowaccount].balance)
printf("您的账户没有这么多余额,转账失败!\n");
else
{
banks[nowaccount].balance-=money;
banks[a].balance+=money;
C语言银行储蓄系统源码
这篇文章主要为大家详细介绍了C语言银行储蓄系统源码,具有一定的参考价值,感兴趣的小伙伴们可以参考一下:
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <string.h>
void openaccount();//开户
{
r1=strcmp(account1,banks[j].account);
r2=strcmp(password1,banks[j].password);

C语言课程设计报告(银行账户信息管理系统)

C语言课程设计报告(银行账户信息管理系统)

银行账户管理系统C语言程序设计摘要银行账户管理系统是针对银行账户的日常管理而设计,操作方便而且界面简洁,使用较为简单的C语言作为编程语言,采用软件工程的开发原理,按照需求分析、概要设计、详细设计、程序编码、软件测试等过程进行规范设计。

本银行账户管理系统具有良好的容错性,在出现误操作时能及时的给出相关错误提示,以便于用户及时地更正。

此方案运用C语言设计的简易的银行账户管理系统,具体实现的功能有显示用户在银行留下的账户信息,以及选择账户查询的功能对用户存取款记录进行查询,可以比较清晰的反映出所要查询的内容。

关键词账户管理C语言查询目录银行账户管理系统C语言程序设计 (I)摘要 (I)1需求分析 (3)1.1需求概述 (3)1.2需求环境 (3)1.3功能描述 (3)2 概要设计 (4)2.1程序功能模块 (4)2.2程序流程图 (5)2.3数据的设计 (5)3 详细设计 (6)3.1代码功能 (6)3.2功能实现代码 (6)3.3流程图 (9)4 实际C语言代码 (13)5.运行结果 (24)5.1登陆界面 (24)5.2..主菜单 (24)5.3.插入新账户 (25)5.4.列出所有账户 (25)5.5.查找账户存款信息 (26)5.6.删除账户 (26)5.7.取款 (26)5.8.存款 (27)6.问题与不足 (27)7.结语 (27)参考文献 (28)1需求分析1.1需求概述进入21世纪之后,随着科技的飞速发展和社会进步,尤其是计算机在大范围的普及,人工智能化的计算机应用也逐步的由大规模科学计算的海量数据处理转向大规模的事务处理和对工作流的管理,这就产生了以计算机为核心,以数据库管理系统为开发环境的管理信息系统在大规模的事务处理和对工作流的管理等方面的应用,特别是在银行账户管理之中的应用日益受到人们的关注。

自中国加入WTO之后,我国信息产业发展迅速,手工管理方式在银行账户管理等需要大量事务处理的应用中已显得越来越不适用,采用IT技术提高服务质量和管理水平势在必行,银行必须提高自己的工作效率,所以迫切需要合适的信息化的银行账户管理系统。

C++简单银行系统代码

C++简单银行系统代码
#include <iostream>
#include <string>
using namespace std;
class Man;
class Save
{
public:
Save();
Save(string n,string m,int c):name(n),mima(m),cun(c){}
void display();
char p;
while(p!='c')
{
shenfenxuanze();
cin>>p; if(p=='a') { while(d!=1) { denglu(s1); } char s; while(s!='0') { xuanzejiemian(); cout<<"请输入服务项目号码(按回车确定):"; cin>>s; if(s=='1'||s=='2'||s=='3'||s=='4'||s=='5') switch(s) {
//查询函数
{
s1.display();
}
void huanyinjiemian()
//欢迎界面
{
cout<<"——————————————————"<<endl;
cout<<"——————————————————"<<endl;
cout<<" "<<endl;
cout<<" 欢迎使用杰克银行管理系统"<<endl;

银行管理系统c语言程序设计代码

银行管理系统c语言程序设计代码

银行管理系统c语言程序设计代码以下是一个简单的银行管理系统的C语言程序设计代码示例:```c#include <stdio.h>#include <stdlib.h>struct BankAccount {int accountNumber;char accountHolder[50];float balance;};void createAccount(struct BankAccount *account) {printf("请输入账户号码: ");scanf("%d", &(account->accountNumber));printf("请输入账户持有人姓名: ");scanf("%s", account->accountHolder);printf("请输入账户余额: ");scanf("%f", &(account->balance));printf("账户创建成功!\n");}void deposit(struct BankAccount *account) {float amount;printf("请输入存款金额: ");scanf("%f", &amount);account->balance += amount;printf("存款成功!\n");}void withdraw(struct BankAccount *account) {float amount;printf("请输入取款金额: ");scanf("%f", &amount);if (amount > account->balance) {printf("余额不足,取款失败!\n");} else {account->balance -= amount;printf("取款成功!\n");}}void displayAccount(struct BankAccount *account) {printf("账户号码: %d\n", account->accountNumber);printf("账户持有人姓名: %s\n", account->accountHolder); printf("账户余额: %.2f\n", account->balance);}int main() {struct BankAccount account;int choice;while (1) {printf("\n银行管理系统\n");printf("1. 创建账户\n");printf("2. 存款\n");printf("3. 取款\n");printf("4. 显示账户信息\n");printf("5. 退出\n");printf("请选择操作: ");scanf("%d", &choice);switch (choice) {case 1:createAccount(&account); break;case 2:deposit(&account);break;case 3:withdraw(&account);break;case 4:displayAccount(&account);break;case 5:printf("感谢使用银行管理系统,再见!\n");exit(0);default:printf("无效的选择,请重新输入。

C语言做的银行系统

C语言做的银行系统

C语言做的银行系统#include<stdio.h>#include<stdlib.h>#include<string.h>struct cust{int zhanghao; //帐号char mingzi[20]; //名字float bal; //开户的金额};struct tran{int acc_no;char trantype;float amt;};void addcust();void rectran();void prnlowbal();void huizong();void main(){int choice;while(choice!=5){system("cls");printf("\n****************************************\n");printf("\n* 银行交易系统 *\n");printf("\n* -1- 创建新用户信息 *\n");printf("\n* -2- 银行业务办理 *\n"); printf("\n* -3- 显示低存款用户信息 *\n");printf("\n* -4- 汇总 *\n");printf("\n* -5- 退出 *\n");printf("\n****************************************\n");printf("请选择:");scanf(" %d",&choice);switch(choice){case 1:addcust();break;case 2:rectran();break;case 3:prnlowbal();break;case 4:huizong();break;default:exit(0);}}}void addcust(){FILE *fp;char flag='y';struct cust people;if((fp=fopen("sql.txt","w"))==NULL){printf("\n **** 操作错误,重新输入 ****\n"); getchar();return;}while(flag=='y'){system("cls");printf("\n 帐号:");scanf("%d",&people.zhanghao);printf("\n 姓名:");scanf("%s",&people.mingzi);printf("\n 金额:");scanf("%f",&people.bal);fwrite(&people,sizeof(struct cust),1,fp);getchar();printf("\n 是否继续(y/n)?:");scanf(" %c",&flag);}fclose(fp);}void rectran(){FILE *fp1,*fp2;char flag='y',found,val_flag;struct cust people;struct tran people2;int size=sizeof(struct cust);if((fp1=fopen("sql.txt","a+f"))==NULL){printf("\n **** 操作错误,重新输入! ****\n");getchar();exit(0);}if((fp2=fopen("trans.dat","a+f"))==NULL){printf("\n **** 操作错误,重新输入! ****\n");getchar();return;}while(flag=='y'){system("cls");printf("\n帐号:");scanf("%d",&people2.acc_no);found='n';val_flag='n';rewind(fp1);while((fread(&people,size,1,fp1))==1 && found=='n'){if(people.zhanghao==people2.acc_no){found='y';break;}}if(found=='y'){while(val_flag=='n'){printf("\n 选择交易方式存/取(D/W)?:");scanf(" %c",&people2.trantype);if(people2.trantype!='D'&&people2.trantype!='d'&&people2.trantype!='w'&&people2.trantype!='W') {printf("\n **** 交易错误,重新输入 ****\n");}else{val_flag='y';}}val_flag='n';while(val_flag=='n'){printf("\n 金额:");scanf("%f",&people2.amt);if(people2.trantype=='w'||people2.trantype=='W'){if(people2.amt>people.bal){printf("\n *** 余额:%.2f不足.重新输入。

银行管理系统c语言程序设计代码

银行管理系统c语言程序设计代码

银行管理系统C语言程序设计代码简介银行管理系统是一个用于模拟银行业务的计算机程序。

它可以实现用户账户的创建、存取款、转账等功能,同时还可以进行利息计算、账单管理等操作。

本文将详细介绍银行管理系统的设计和实现,包括系统的功能模块、数据结构和算法等内容。

功能模块银行管理系统主要包括以下功能模块:1.用户管理:包括用户账户的创建、修改、删除等操作。

2.账户管理:包括存款、取款、查询余额、转账等操作。

3.利息计算:根据存款金额和存款期限计算利息。

4.账单管理:记录用户的交易明细和账户余额变动。

数据结构银行管理系统使用了以下数据结构:1.用户账户结构体:包括账户ID、账户名称、账户类型等信息。

2.用户交易结构体:包括交易类型、交易金额、交易时间等信息。

3.用户账户链表:用于保存所有用户账户的信息。

4.用户交易链表:用于保存用户的交易明细。

算法设计银行管理系统使用了以下算法:1.用户账户创建算法:通过用户输入的信息创建新的账户,并将其添加到账户链表中。

2.存款算法:根据用户输入的存款金额,将其添加到账户余额中。

3.取款算法:根据用户输入的取款金额,从账户余额中扣除相应金额。

4.转账算法:根据用户输入的转账金额和目标账户ID,将相应金额从当前账户中转到目标账户中。

5.利息计算算法:根据存款金额和存款期限,计算相应的利息。

6.账单记录算法:将用户的交易明细和账户余额变动记录到交易链表中。

代码实现以下是银行管理系统的C语言代码示例:#include <stdio.h>// 用户账户结构体typedef struct {int accountId;char accountName[100];char accountType[100];float balance;} Account;// 用户交易结构体typedef struct {int accountId;char transactionType[100];float amount;char transactionTime[100];} Transaction;// 用户账户链表typedef struct {Account account;struct AccountNode* next;} AccountNode;// 用户交易链表typedef struct {Transaction transaction;struct TransactionNode* next;} TransactionNode;// 创建用户账户void createAccount(AccountNode** head, Account account) { // 创建新的账户节点AccountNode* newNode = (AccountNode*)malloc(sizeof(AccountNode)); newNode->account = account;newNode->next = NULL;// 将新的账户节点添加到链表中if (*head == NULL) {*head = newNode;} else {AccountNode* current = *head;while (current->next != NULL) {current = current->next;current->next = newNode;}}// 存款void deposit(AccountNode* head, int accountId, float amount) {AccountNode* current = head;while (current != NULL) {if (current->account.accountId == accountId) {current->account.balance += amount;break;}current = current->next;}}// 取款void withdraw(AccountNode* head, int accountId, float amount) {AccountNode* current = head;while (current != NULL) {if (current->account.accountId == accountId) {if (current->account.balance >= amount) {current->account.balance -= amount;} else {printf("Insufficient balance.\n");}break;}current = current->next;}}// 转账void transfer(AccountNode* head, int sourceAccountId, int targetAccountId, flo at amount) {AccountNode* current = head;while (current != NULL) {if (current->account.accountId == sourceAccountId) {if (current->account.balance >= amount) {current->account.balance -= amount;break;} else {printf("Insufficient balance.\n");}current = current->next;}current = head;while (current != NULL) {if (current->account.accountId == targetAccountId) {current->account.balance += amount;break;}current = current->next;}}// 利息计算float calculateInterest(float principal, int years) {float rate = 0.05; // 假设利率为5%return principal * rate * years;}// 账单记录void recordTransaction(TransactionNode** head, Transaction transaction) { // 创建新的交易节点TransactionNode* newNode = (TransactionNode*)malloc(sizeof(TransactionNod e));newNode->transaction = transaction;newNode->next = NULL;// 将新的交易节点添加到链表中if (*head == NULL) {*head = newNode;} else {TransactionNode* current = *head;while (current->next != NULL) {current = current->next;}current->next = newNode;}}int main() {AccountNode* accountList = NULL;TransactionNode* transactionList = NULL;// 创建账户Account account1 = {1, "John Doe", "Savings", 1000.0};createAccount(&accountList, account1);Account account2 = {2, "Jane Smith", "Checking", 2000.0};createAccount(&accountList, account2);// 存款deposit(accountList, 1, 500.0);// 取款withdraw(accountList, 1, 200.0);// 转账transfer(accountList, 1, 2, 300.0);// 利息计算float interest = calculateInterest(1000.0, 1);printf("Interest: %.2f\n", interest);// 账单记录Transaction transaction1 = {1, "Deposit", 500.0, "2022-01-01 10:00:00"};recordTransaction(&transactionList, transaction1);Transaction transaction2 = {1, "Withdraw", 200.0, "2022-01-02 11:00:00"};recordTransaction(&transactionList, transaction2);return 0;}总结银行管理系统是一个功能丰富的计算机程序,通过使用C语言进行设计和实现,可以实现用户账户的创建、存取款、转账等功能,同时还可以进行利息计算、账单管理等操作。

C语言 银行账户管理作业附源码

C语言 银行账户管理作业附源码

银行账户管理系统一、设计思路用结构体链表来存放个人银行账户的信息,通过静态分配结构体数组的大小,然后通过对链表的插入、查找、删除、排序、保存操作实现账户管理的功能。

程序退出时自动将内存中的数据保存到文件中,再次运行时程序会自动从文件中读取数据扫内存中。

程序启动时要求输入用户名和密码用户名:admin 密码:123456二、各个功能的实现1、建立账户功能:struct account *insert(struct account*head, struct account *new);该函数通过对链表进行插入操作,从而实现建立账户的功能。

2、显示所有账户功能:void print(struct account *head);对链表进行输出,列出所有账户。

3、按照账号搜索的功能:struct account *find(struct account*head,long account_num);对指针进行遍历,找到符合条件的数据。

4、按照账号删除账户:struct account *del(struct account*head,long account_num);对链表进行查找,如有匹配的则执行删除,若没有找的不做任何操作。

5、模拟取钱功能:struct account *Withdrawal (structaccount *head,long account_num); 用户输入账号,然后对链表进行查找,要求用户输入账户密码,若匹配则可进行取钱(对余额做减法)。

6、模拟存钱功能:struct account *saving(struct account*head,long account_num);与取钱类似,对余额做加法。

7、排序功能:struct account *order (struct account *head);根据账号对链表进行排序8、保存数据和读取文件功能:void save(struct account*head);save函数实现保存功能,退出程序时自动保存数据,再次执行程序时自动从根目录中读取文件数据。

银行卡管理系统C语言实现

银行卡管理系统C语言实现

银⾏卡信息包括:卡号、持卡⼈姓名、身份证号码、密码、标志该卡是否启⽤、账户⾦额、积分、收⽀记录等。

制卡指申请⼀张新的银⾏卡。

账户信息存储到账户信息⽂件中,当制作⼀新卡时,就把该新卡追加到账户信息⽂件。

⼀个⼈可以有多张卡。

实现对账户各项信息的查询。

实现卡⾦融交易积分功能。

实现卡报表功能。

读账户信息⽂件,分屏输出所有账户的帐号和交易⾦额。

#include <stdio.h>#include <stdlib.h>#include <string.h>#define MAX_ACCOUNTS 1000#define FILENAME "accounts.txt"struct Account {char card_number[20];char name[50];char id_number[20];char password[20];int enabled;double balance;int points;char transactions[1000];};struct Account accounts[MAX_ACCOUNTS];int num_accounts = 0;void load_accounts() {FILE *file = fopen(FILENAME, "r");if (file != NULL) {while (fscanf(file, "%s %s %s %s %d %lf %d %s",accounts[num_accounts].card_number,accounts[num_accounts].name,accounts[num_accounts].id_number,accounts[num_accounts].password,&accounts[num_accounts].enabled,&accounts[num_accounts].balance,&accounts[num_accounts].points,accounts[num_accounts].transactions) != EOF) {num_accounts++;}fclose(file);}}void save_accounts() {FILE *file = fopen(FILENAME, "w");if (file != NULL) {for (int i = 0; i < num_accounts; i++) {fprintf(file, "%s %s %s %s %d %lf %d %s\n",accounts[i].card_number,accounts[i].name,accounts[i].id_number,accounts[i].password,accounts[i].enabled,accounts[i].balance,accounts[i].points,accounts[i].transactions);}fclose(file);}}void create_account() {struct Account account;printf("Enter card number: ");scanf("%s", account.card_number);printf("Enter name: ");scanf("%s", );printf("Enter ID number: ");scanf("%s", account.id_number);printf("Enter password: ");scanf("%s", account.password);account.enabled = 1;account.balance = 0;account.points = 0;account.transactions[0] = '\0';accounts[num_accounts] = account;num_accounts++;save_accounts();printf("Account created successfully.\n");}void show_account() {char card_number[20];printf("Enter card number: ");scanf("%s", card_number);struct Account *account = NULL;for (int i = 0; i < num_accounts; i++) {if (strcmp(accounts[i].card_number, card_number) == 0) { account = &accounts[i];break;}}if (account == NULL) {printf("Account not found.\n");return;}printf("Card number: %s\n", account->card_number);printf("Name: %s\n", account->name);printf("ID number: %s\n", account->id_number);printf("Enabled: %d\n", account->enabled);printf("Balance: %.2lf\n", account->balance);printf("Points: %d\n", account->points);printf("Transactions:\n%s\n", account->transactions);}void print_all_accounts() {printf("Card number\tBalance\tTransactions\n");for (int i = 0; i < num_accounts; i++) {printf("%s\t%.2lf\t%s\n",accounts[i].card_number,accounts[i].balance,accounts[i].transactions);}}struct Account *find_account(char *card_number) {for (int i = 0; i < num_accounts; i++) {if (strcmp(accounts[i].card_number, card_number) == 0) { return &accounts[i];}}return NULL;}void deposit() {char card_number[20];double amount;printf("Enter card number: ");scanf("%s", card_number);struct Account *account = find_account(card_number);if (account == NULL) {printf("Account not found.\n");return;}printf("Enter amount: ");scanf("%lf", &amount);account->balance += amount;sprintf(account->transactions + strlen(account->transactions), "Deposit: +%.2lf\n", amount);save_accounts();printf("Deposit completed successfully.\n");}void withdraw() {char card_number[20];double amount;printf("Enter card number: ");scanf("%s", card_number);struct Account *account = find_account(card_number);if (account == NULL) {printf("Account not found.\n");return;}printf("Enter amount: ");scanf("%lf", &amount);if (amount > account->balance) {printf("Insufficient balance.\n");return;}account->balance -= amount;sprintf(account->transactions + strlen(account->transactions),"Withdrawal: -%.2lf\n", amount);save_accounts();printf("Withdrawal completed successfully.\n");}void transfer() {char sender_card_number[20];char receiver_card_number[20];double amount;printf("Enter sender's card number: ");scanf("%s", sender_card_number);struct Account *sender_account = find_account(sender_card_number);if (sender_account == NULL) {printf("Sender's account not found.\n");return;}printf("Enter receiver's card number: ");scanf("%s", receiver_card_number);struct Account *receiver_account = find_account(receiver_card_number); if (receiver_account == NULL) {printf("Receiver's account not found.\n");return;}printf("Enter amount: ");scanf("%lf", &amount);if (amount > sender_account->balance) {printf("Insufficient balance.\n");return;}sender_account->balance -= amount;receiver_account->balance += amount;sprintf(sender_account->transactions + strlen(sender_account->transactions),"Transfer to %s: -%.2lf\n", receiver_card_number, amount);sprintf(receiver_account->transactions + strlen(receiver_account->transactions), "Transfer from %s: +%.2lf\n", sender_card_number, amount);save_accounts();printf("Transfer completed successfully.\n");}void add_points() {char card_number[20];int points;printf("Enter card number: ");scanf("%s", card_number);struct Account *account = find_account(card_number);if (account == NULL) {printf("Account not found.\n");return;}printf("Enter points to add: ");scanf("%d", &points);account->points += points;save_accounts();printf("Points added successfully.\n");}void print_report() {printf("Card number\tName\tBalance\tPoints\n");for (int i = 0; i < num_accounts; i++) {printf("%s\t%s\t%.2lf\t%d\n",accounts[i].card_number,accounts[i].name,accounts[i].balance,accounts[i].points);}}int main() {load_accounts();while (1) {int choice;printf("\n1. Create account\n");printf("2. Show account details\n");printf("3. Show all accounts\n");printf("4. Deposit\n");printf("5. Withdraw\n");printf("6. Transfer\n");printf("7. Add points\n");printf("8. Print report\n");printf("9. Exit\n");printf("Enter your choice: ");scanf("%d", &choice);switch (choice) {case 1:create_account();break;case 2:show_account();break;case 3:print_all_accounts();break;case 4:deposit();break;case 5:withdraw();break;case 6:transfer();break;case 7:add_points();break;case 8:print_report();break;case 9:printf("Exiting...\n");return 0;default:printf("Invalid choice.\n"); }}}。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
printf("\t‖‖\n");
printf("\t==========================================================");
cekong();
printf("您真的要退出吗(y/n)? ");
fflush(stdin);
scanf("%c",&ch);
简单的银行管理系统的C语言代码
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <conio.h>
#define N 10000
struct chuhu //储户结构信息
{
char idnum[9]; //帐号
char password[7]; //密码
}//认证成功
fclose(fkey);
menu();
return 0;
}
void menu()
{
int a,b;//选择功能的变量
do{
printf("\n\n按ENTER键进入/返回主菜单→:");
fflush(stdin);
scanf("%c",&ch);
system("cls"); //清屏
printf("\n\n\t\t储户存单: ");
fflush(stdin);
gets(hu[A].idnum);
printf("\n\t\t储户密码(6位): ");
for(i=0;i<6;i++)
{
fflush(stdin);
hu[A].password[i]=getch();
printf("*");
A++;
printf("\n是否继续(y/n)? ");
fflush(stdin);
scanf("%c",&ch);
}while(ch=='y'||ch=='Y');
printf("存入成功\n");
system("pause");
system("cls");
fclose(nchuhu);
fclose(fchuhu);
do{
printf("\n\t\t请选择(1-5):");
fflush(stdin);
scanf("%d",&hu[A].lei);
if(hu[A].lei<1||hu[A].lei>5)
printf("\n\n\t\t您选择错误,请正确选择!!");
}while(hu[A].lei<1||hu[A].lei>5);
break;
if(i<A)
printf("\n\n\t\t前面已有一个不同姓名的储户的身份证号为此号码,\n\t\t同一个身份证号不可以有不同的姓名,\n\n\t\t请重新输入身份证号:\n");
}while(strlen(hu[A].idnumber)!=18||(strcmp(hu[A].idnumber,hu[i].idnumber)==0&&strcmp(hu[A].name,hu[i].name)!=0));
system("cls");
break;
default:
system("cls");
printf("\n\n\t您的输入有误,请正确选择功能!!!……");
break;
}
if(a==0&&(ch=='y'||ch=='Y'))
{
system("color f0");
date();kaifa();
printf("\n\n\n\n\t欢迎下次再使用! ");
void xitong();
int rrekey();
void kaifa(); //开发人员
void cekong();
int yanzheng(); //验证帐号和密码
void date(); //显示当前日期和时间
void insert(); //开户函数
void display(); //显示查询帐户信息的函数
char name[11]; //储户姓名
char idnumber[19]; //储户身份证号码
double cunkuan; //存款金额
int lei; //储种
char address[51]; //储户地址
char Tel[15]; //储户的联系电话
double lilv;//利率
}hu[N]; //储户结构数组
void in(int); //存款函数
void out(int); //取款函数
void lilvbiao(); //查看利率表
void menu();
int A=0,key; //A为开户数
double jin;
char ch='y'; //控制是否继续的变量
char id[11],password[7];
}
hu[A].password[6]='\0';
fflush(stdin);
scanf("%c",&ch);
printf("\n\t\t姓名:");
fflush(stdin);
gets(hu[A].name);
do{
printf("\n\t\t储户身份证号码(18位): ");
fflush(stdin);
printf("按ENTER键进入下一界面→");
fflush(stdin); //功能:清空输入缓冲区
scanf("%c",&ch);
if(!fkey)
{
printf("密码文件不存在,系统已自创\n");
xitong();
menu();
return 0;
}
system("cls");
fscanf(fkey,"%d",&key);
gets(hu[A].address);
printf("\n\t\t储种: ");
printf("\n\t\t\t1、一年定期");
printf("\n\t\t\t2、两年定期");
printf("\n\t\t\t3、三年定期");
printf("\n\t\t\t4、四年定期");
printf("\n\t\t\t5、五年定期");
printf("\n\t\t存单金额: anf("%lf",&hu[A].cunkuan);
printf("\n\t\t储户电话: ");
fflush(stdin);
gets(hu[A].Tel);
printf("\n\t\t储户地址: ");
fflush(stdin);
printf("\n\t\t利率为:%f",hu[A].lilv);
fprintf(fchuhu,"%s\t%s\t%s\t%s\t%lf\t%s\t%s\t%d\t%f\n",hu[A].idnum,hu[A].password,hu[A].name,hu[A].idnumber,hu[A].cunkuan,hu[A].Tel,hu[A].address,hu[A].lei,hu[A].lilv);
{
printf("文件不存在,系统将创建.\n");
}
do{
system("cls"); //清屏
system("color f0"); //设置系统背景为白色
date();
printf("\n\n\t\t请输入新储户的信息:");
fscanf(nchuhu,"%s\t%s\t%s\t%s\t%lf\t%s\t%s\t%d\t%lf\n",&hu[A].idnum,&hu[A].password,&hu[A].name,&hu[A].idnumber,&hu[A].cunkuan,&hu[A].Tel,&hu[A].address,&hu[A].lei,&hu[A].lilv);
system("color f0");
date();
printf("\n\t\t\t\t主菜单\n\n");
printf("\t\t1、开户\n");//主菜单界面(界面3)
printf("\t\t2、查询\n");
printf("\t\t3、用户密码验证\n");
printf("\t\t4、存款\n");
printf("\t‖‖\n");
printf("\t‖‖\n");
printf("\t‖‖\n");
相关文档
最新文档