❶ 用c語言寫一個銀行AMT模擬系統
沒有分呀 開玩笑呢吧
沒人給你做的 至少要求100分
❷ c語言 設計一個銀行管理系統
功能:能夠輸入和查詢客戶存款取款記錄。在客戶文件中,每個客戶是一條記錄,包括編號、客戶姓名、支取密碼、客戶地址、客戶電話、賬戶總金額;在存取款文件中,每次存取款是一條記錄,包括編號、日期、類別、存取數目、經辦人。類別分為取款和存款兩種。本系統能夠輸入客戶存款或取款記錄;根據客戶姓名查詢存款和取款記錄。分步實施:1、初步完成總體設計,搭好框架,確定人機對話界面,確定函數個數;2、建立一個文件,輸入客戶的必要信息,能對文件進行顯示、輸入、修訂、刪除等。3、進一步要求:完成客戶姓名查詢存款和取款記錄,並能得到每次帳戶總金額。要求:1、用C語言實現系統;2、利用結構體數組實現信息的數據結構設計;3、系統的各個功能模塊要求用函數的形式實現;4、界面友好(良好的人機交互),程序加必要的注釋。課程設計實驗報告要求:1、預習報告:題目、課程設計任務、數據結構、程序的總體設計(演算法)、模塊劃分 。2、實驗總結報告:流程圖、主要源程序代碼(需列印)、測試情況及調試中問題與解決方案、小結等要求:標明所用函數的用途和目的,簡單敘述製作思路。
是否可以解決您的問題?
❸ 數據結構C語言——銀行排隊模擬
這個主要是隊列的應用哦。先到先入隊。後到後出。之前寫過。 這里有
❹ C語言課程設計銀行管理小系統
我這有個個人收支管理系統,你看看是否用得上。
#include<stdio.h>
#include<string.h>
#define N 100
struct money
{
int shunxu;
int year;
int month;
int day;
char zhaiyao[50];
float jine;
float yue;
char bizhong[10];
int biao;
}in[N],out[N],temp[N],*pp,*qq;
void shouru(int x)
{
int i;
char ch;
system("cls");
if(x==1)
pp=in;
else
pp=out;
for(i=1;i<N;i++,pp++)
{
pp->shunxu=i;
pp->biao=x;
printf("\n日期(年 月 日)\t摘要\t金額\t幣種\n");
scanf("%d%d%d%s%f%s",&pp->year,&pp->month,&pp->day,pp->zhaiyao,&pp->jine, pp->bizhong );
printf("是否繼續輸入?1 是 2 否\n");
scanf("%s",&ch);
if(ch=='1')
continue;
else if(ch=='2')
break;
else
{
printf("error!");
system("pause");
break;
}
}
printf("是否保存:1是 2否\n");
scanf("%d",&i);
switch(i)
{
case 1:
if(x==1)
{
xieru(1);
break;
}
else
{
xieru(-1);
break;
}
case 2:
system("pause");
break;
default:
break;
}
}
mingxi()
{
FILE *f;
int y,m,d,y2,m2,d2;
int i;
system("cls");
pp=temp;
if((f=fopen("ff.txt","rt"))==NULL)
{
printf("文件打開錯誤!");
system("pause");
}
for(i=0;i<N;i++,pp++)
fscanf(f,"%d\t%d年%d月%d日\t%s\t%f\t%f\t%s\t%d\n",&pp->shunxu,&pp->year,&pp->month,&pp->day,pp->zhaiyao,&pp->jine,&pp->yue,pp->bizhong,&pp->biao);
pp=temp;
/*for(;pp->shunxu!=0;pp++)
printf("%d %s %f\n",pp->shunxu,pp->bizhong,pp->jine);*/
printf("輸入起止時間(年 月 日):\n");
scanf("%d%d%d%d%d%d",&y,&m,&d,&y2,&m2,&d2);
for(;pp->shunxu!=0;pp++)
{
if(pp->year>=y||pp->month>=m||pp->day>=d)
{
for(;pp->shunxu!=0;pp++)
{
if(pp->year>y2||pp->month>m2||pp->day>d2)
break;
printf("%d年%d月%d日\t%f\n",pp->year,pp->month,pp->day,pp->jine);
}
}
}
system("pause");
}
chaxun()
{
system("cls");
printf("建設中。。。");
system("pause");
}
xieru(int x)
{
FILE *f;
system("cls");
pp=in;
qq=out;
f=fopen("ff.txt","at+");
if(f==NULL)
{
printf("文件打開錯誤!");
system("pause");
}
if(x==1)
for(;pp->shunxu !=0;pp++)
{
fprintf(f,"%d\t%d年%d月%d日\t%s\t%f\t%f\t%s\t%d\n",pp->shunxu,pp->year,pp->month,pp->day,pp->zhaiyao,pp->jine,pp->yue,pp->bizhong,pp->biao);
}
else if(x==-1)
for(;qq->shunxu!=0;qq++)
{
fprintf(f,"%d\t%d年%d月%d日\t%s\t%f\t%f\t%s\t%d\n",qq->shunxu,qq->year,qq->month,qq->day,qq->zhaiyao,qq->jine,qq->yue,qq->bizhong,qq->biao);
}
else
{
for(;pp->shunxu !=0;pp++)
{
fprintf(f,"%d\t%d年%d月%d日\t%s\t%f\t%f\t%s\t%d\n",pp->shunxu,pp->year,pp->month,pp->day,pp->zhaiyao,pp->jine,pp->yue,pp->bizhong,pp->biao);
}
for(;qq->shunxu!=0;qq++)
{
fprintf(f,"%d\t%d年%d月%d日\t%s\t%f\t%f\t%s\t%d\n",qq->shunxu,qq->year,qq->month,qq->day,qq->zhaiyao,qq->jine,qq->yue,qq->bizhong,qq->biao);
}
}
fclose(f);
printf("保存成功!");
system("pause");
}
qu()
{
FILE *f;
char ch;
system("cls");
f=fopen("ff.txt","rb");
if(f==NULL)
{
printf("文件打開錯誤!");
system("pause");
}
ch=fgetc(f);
while(ch!=EOF)
{
putchar(ch);
ch=fgetc(f);
}
fclose(f);
system("pause");
}
void main()
{
int i=1,a;
for(;i!=0;)
{
system("cls");
printf("個人收支管理\n");
printf("1.收入\n2.支出\n3.明細表\n4.查詢與統計\n5.寫入文件\n6.讀取文件\n0.退出\n");
scanf("%d",&a);
switch(a)
{
case 1:
shouru(1);
break;
case 2:
shouru(-1);
break;
case 3:
mingxi();
break;
case 4:
chaxun();
break;
case 5:
xieru(0);
break;
case 6:
qu();
break;
case 0:
i=0;
break;
}
}
}
❺ 數據結構:銀行業務模擬的C語言程序
像這樣的要求嘛,來網路就錯了,你得上專業網站找高手。還急需的話,就不要繼續在這兒浪費時間了
❻ 編寫一個C語言程序模擬銀行ATM機的賬戶管理功能,系統主要實現以下功能
按照你的願意把空都填好了,VC++ 6.0下編譯能通過,有警告信息,運行基本上能用,不過個人認為這個系統有很大的不足,比如輸入賬號的時候沒有輸出反饋信息,以及沒有對誤操作的處理等等。需要的話可以幫你改改!
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#include <string.h>
#define AN 9 //表示賬號8位
#define PN 7 //表示密碼6位
#define ASN 3 //表示系統中共有3個賬戶信息
struct Account
{
char accountnumber[AN]; //表示賬號信息
char password[PN]; //表示賬戶的密碼信息
double balance; //表示賬戶的余額
};
struct Account ats[ASN]={{"00000001","123456",100},{"00000002","123456",200},{"00000003","123456",300}};
//ats數組用於存儲系統中三個賬戶的信息
int isCorrect(char *an,char *psd)
{
int i;
for(i=0;i<ASN;i++)
if(strcmp(ats[i].accountnumber,an)==0 && strcmp(psd,ats[i].password)==0)
return 1;
return 0;
}
double getBalance(char *an)
{
int i;
for(i=0;i<ASN;i++)
if(strcmp(an,ats[i].accountnumber)==0)
return ats[i].balance;
}
void deposit(char *an,int amount)
{
int i;
for(i=0;i<ASN;i++)
if(strcmp(an,ats[i].accountnumber)==0)
ats[i].balance+=amount;
}
int withdraw(char *an,int amount)
{
int i;
for(i=0;i<ASN;i++)
if(strcmp(an,ats[i].accountnumber)==0)
return ats[i].balance-=amount;
}
void main()
{
char AccountNumber[AN]={'\0'};
char psd[PN]={'\0'};
int i,errorcount=0;
while(1)
{
printf("\n請輸入8位賬號:");
for(i=0;i<8;i++)
AccountNumber[i]=getch();
printf("\n請輸入6為密碼:");
for(i=0;i<6;i++)
{
psd[i]=getch();
putchar('*');
}
if(isCorrect(AccountNumber,psd)==1)
{
int tag,amount;
while(1)
{
printf("\n歡迎登錄銀行賬戶管理系統,請選擇您要的服務:1、查詢余額;2、存款操作;3、取款操作;4、退出系統\n");
scanf("%d",&tag);
switch(tag)
{
case 1:
printf("您現在的余額為%f元\n",getBalance(AccountNumber));
break;
case 2:
printf("請輸入您的存款金額:");
scanf("%d",&amount);
deposit(AccountNumber,amount);
printf("存款成功!您的當前余額為:%f元\n",getBalance(AccountNumber));
break;
case 3:
printf("請輸入您的取款金額:");
scanf("%d",&amount);
if(amount<=getBalance(AccountNumber))
printf("取款成功!您的當前余額為:%f元\n",withdraw(AccountNumber,amount));
else
printf("取款失敗!\n");
break;
case 4:
break;
}
if(tag==4)
break;
}
}
else
{
errorcount++;
if(errorcount==3)
{
printf("您已經連續三次輸入錯誤,系統將自動關閉\n");
break;
}
}
}
}
❼ C語言設計銀行賬戶模擬程序
能傳附件嗎?不知道怎麼傳。我就貼給你吧。
#include<iostream>
#include<string>
#include<fstream>
using namespace std;
class account //atm賬戶類
{
private:
string CardNum,Psw; //卡號、密碼
float Balance;
public:
friend class ATM; //atm為友元
/*void get_cardnum();
void get_psw();
void get_balance();*/
account(){}//<---------------------here
account(string num,string passwd,float balance); //構造函數
void Write();
};
class ATM //atm機類
{
private:
int times;
account *ac;
public:
ATM(); void load( account *act ); //裝入賬戶信息
void welcome(); //初始歡迎信息
bool check_passwd( string pwd ); //驗證當前賬戶信息的密碼
void change_psw(); //修改密碼
void get_money(); //取錢
float check_balance(); //查賬
void tran(); //轉賬
void exit(); //退卡
void function_show(); //顯示功能菜單
void lock(); //鎖定賬戶
};
/*
* account::account( string num, string passwd, float balance )
* account類構造函數
* 用途: 使用給定的賬號密碼等信息初始化一個account對象
* 參數: string num 賬號
* string passwd 密碼
* float balance
*/
account::account( string num, string passwd, float balance )
{
CardNum = num;
Psw = passwd;
Balance = balance;
}
//atm類構造函數
/*account::get_cardnum()
{
return CardNum;
}
account::get_psw()
{
return Psw;
}
account::get_balance()
{
return Balance;
}*/
void account::Write()
{
ofstream outfile("atm.txt",ios::binary);//<-----------------here
outfile.write((char *)(this),sizeof(account));//<-------------here
outfile.close();
}
ATM::ATM()
{
}
/*
* void ATM::load( account *act )
* ATM類裝入賬戶信息函數
* 用途: 載入指定的account對象,模擬atm插卡過程
* 參數: account *act 要載入的account對象指針
*/
void ATM::load( account *act )
{
ac = act;
}
/*
* void ATM::welcome()
* ATM類顯示初始歡迎信息函數
* 用途: 顯示歡迎信息,提示密碼輸入並驗證
* 參數: 無
*
*/
void ATM::welcome()
{
times = 0; //記錄密碼輸入錯誤次數
cout << "Welcome to use the China Bank ATM!" << endl;
string pwd; //這一個語句應該上移的,一般來說數據的定義和初始化一塊寫在開頭,下面才是各種操作的語句
while( times < 3 )
{
cout << "Please enter the password: " << endl;
cin >> pwd;
if( !check_passwd( pwd ) )
{
cout << "The password you entered is wrong, please enter again" << endl;
times++;
}
else
{
function_show();
break;
}
}
if( times >= 3 )
lock(); //輸入密碼錯誤次數超過(等於)3次,鎖定賬戶
}
bool ATM::check_passwd( string pwd )
{
if( pwd == ac->Psw )
return true;
else
return false;
}
void ATM::function_show()
{
int n;
cout << "(1) Change Password" << endl;
cout << "(2) Get Money" << endl;
cout << "(3) Check Balance" << endl;
cout << "(4) Transfer accounts" << endl;
cout << "(5) Exit" << endl;
cin >> n;
while(n != 1 && n != 2 && n != 3 && n != 4 && n != 5) //這樣就可以完全限制用戶的輸入
{
cout << "Please enter the right number" << endl;
cin >> n;
}
switch( n )
{
case 1:
change_psw();
break;
case 2:
get_money();
break;
case 3:
cout << check_balance() << endl;
break;
case 4:
tran();
break;
case 5:
exit();
break;
}
}
void ATM::lock()
{
cout << "Sorry! Your card has been confiscated!" << endl;
exit();
}
void ATM::change_psw()
{
string old_psw, new_psw1, new_psw2;
int t = 0 ;
while( t < 3 )
{
cout << "Please enter the old password: ";
cin >> old_psw;
if( !check_passwd( old_psw ) )
{
cout << "The password you enter is wrong, please enter again" << endl;
t++;
}
else
{
cout << "Please enter the new password: ";
cin >> new_psw1;
cout << "Please enter the new password again: ";
cin >> new_psw2;
if( new_psw1 == new_psw2 )
{
ac -> Psw = new_psw2;
cout << "You have change your password successfully!" << endl;
break;
}
else
cout << "Sorry, entered passwords do not match! " << endl;
}
}
//}//<----------------------here
if( t >= 3 )
{
cout << "Sorry, you have inputed the wrong password for three times and more! " << endl;
}
}
void ATM::get_money()
{
float money;
cout << "Please enter the amount of money you want to get: " <<endl;
cin >> money;
while( money > ac -> Balance)
{
cout << "Your balance is not enough, please enter again" << endl;
cin >> money;
}
ac -> Balance = ac -> Balance - money;
}
float ATM::check_balance()
{
return ac -> Balance;
}
void ATM::tran()
{
account a[5];
string cn;
float m;
cout<<"please enter the cardnum of the account you want to transfer money to"<<endl;
cin>>cn;
ifstream infile("atm.txt",ios::binary);
infile.seekg(0,ios::beg);
for(int i=0;i<5;i++)
{
infile.read((char *)(&a[i]),sizeof(a[i]));
}
for(int j=0;j<5;j++)
{
if(cn==a[i].CardNum)
{
cout<<"please enter the amount of money"<<endl;
cin>>m;
while(m>ac->Balance)
{
cout<<"there is no enough money in your account,please enter again"<<endl;
cin>>m;
}
ac->Balance=ac->Balance-m;
a[i].Balance=a[i].Balance+m;
ofstream outfile("atm.txt",ios::binary);
outfile.seekp(i*sizeof(a[0]),ios::beg);
outfile.write((char *) &a[i],sizeof(a[i]));
}
}
if(j>=5)
{
cout<<"the account doesn't exit"<<endl;
}
}
void ATM::exit()
{
cout << "Please take your card!" << endl;
}
int main()
{
account a[5]={account("10001","1111",5000.0f),account("10002","2222",10000.0f),account("10003","3333",15000.0f),
account("10004","4444",20000.0f),account("10005","5555",25000.0f)};
account temp( "10001", "1111", 5000.0f );
ATM atm;
atm.load( &temp );
atm.welcome();
return 0;
}
❽ 急求c語言銀行儲蓄系統課程設計!!!
阿滕宏偉斯圖爾特我個人過
❾ C語言用隊列結構模擬,銀行業務排隊系統實現 1.有儲戶要辦理存取款業務時,取號等待,編號入隊
很明顯 這個只要實現隊列一切就簡單了 其實c++有quene類 這里我們自己實現它
剩下的自己來寫就好了 很簡單的
首先一個鏈表的
#include<iostream>
usingnamespacestd;
//鏈表
typedefstructQDode
{
intn;
structQDode*next;
}*pqdode,qdode;
//隊列
typedefstructMyQueue
{
pqdodefront;
pqdoderear;
}*pmyqueue,myqueue;
boolInit_queue(pmyqueuequ);//初始化隊列
boolIs_empty(pmyqueuequ);//判斷隊列是否為空
voidPut_queue(pmyqueuequ,intval);//入隊
intOut_queue(pmyqueuequ);//出隊
intTravel_queue(pmyqueuequ);//遍歷隊列
voidDestory_queue(pmyqueuequ);//銷毀隊列
//主函數
intmain()
{
myqueuequeue={NULL,NULL};
Init_queue(&queue);//初始化
Put_queue(&queue,5);//入隊
if(!Is_empty(&queue))
{
cout<<"隊列不為空"<<endl;
}
Put_queue(&queue,6);
Put_queue(&queue,7);
Put_queue(&queue,8);
Put_queue(&queue,9);
Travel_queue(&queue);//遍歷
intval=Out_queue(&queue);
cout<<endl<<endl<<val<<endl<<endl;
Travel_queue(&queue);//遍歷
intvall=Out_queue(&queue);
cout<<endl<<endl<<vall<<endl<<endl;
Travel_queue(&queue);//遍歷
Destory_queue(&queue);//銷毀
cout<<endl;
return0;
}
boolInit_queue(pmyqueuequ)
{
qu->front=newqdode;
if(qu->front==NULL)
{
cout<<"動態分配內存失敗!"<<endl;
returnfalse;
}
else
{
qu->rear=qu->front;
qu->front->next=NULL;
returntrue;
}
}
voidDestory_queue(pmyqueuequ)
{
pqdodep=qu->front,q=NULL;
while(p)
{
q=p->next;
deletep;
p=q;
}
p=NULL;
}
voidPut_queue(pmyqueuequ,intval)
{
qu->rear->n=val;
pqdodeq=qu->rear;
pqdodep=newqdode;
p->next=NULL;
qu->rear=p;
q->next=p;
}
boolIs_empty(pmyqueuequ)
{
if(qu->front!=qu->rear)
{
returnfalse;
}
else
{
returntrue;
}
}
intTravel_queue(pmyqueuequ)
{
intcount=0;
if(Is_empty(qu))
{
cout<<"該隊列為空!"<<endl;
return0;
}
else
{
pqdodep=qu->front,q=NULL;
while(p!=qu->rear)
{
count++;
cout<<p->n<<"";
if(!(count%5))
{
cout<<endl;
}
p=p->next;
}
returncount;
}
}
intOut_queue(pmyqueuequ)
{
if(Is_empty(qu))
{
cout<<"該隊列為空!"<<endl;
return-1;
}
else
{
intval=qu->front->n;
pqdodep=qu->front->next;
deletequ->front;
qu->front=p;
returnval;
}
}
然後一個數組實現的
#include<iostream>
usingnamespacestd;
classQUEUE//隊列類
{
private://私有成員
int*pBase;
intfront,rear;
intcount;
public://公有成員
boolIs_empty();//判斷是否為空
boolIs_full();//判斷是否滿
voidenter_queue(intn);//入隊
intout_queue();//出隊
voidtravel_queue();//遍歷隊
QUEUE(intnumber=100)
{
front=rear=0;
pBase=newint[number+1];
count=number+1;
}
~QUEUE()
{
delete[]pBase;
}
};
intmain()
{
QUEUEqueue(5);
queue.enter_queue(1);
queue.enter_queue(2);
queue.enter_queue(3);
queue.enter_queue(4);
queue.enter_queue(5);
queue.enter_queue(6);
queue.travel_queue();
queue.out_queue();
queue.travel_queue();
queue.out_queue();
queue.travel_queue();
queue.out_queue();
queue.travel_queue();
queue.out_queue();
queue.travel_queue();
queue.out_queue();
queue.travel_queue();
queue.out_queue();
if(queue.Is_full())
{
cout<<"wangbadan"<<endl;
}
intn=queue.out_queue();
cout<<n<<endl;
queue.travel_queue();
intn1=queue.out_queue();
cout<<n1<<endl;
queue.travel_queue();
return0;
}
boolQUEUE::Is_empty()//判斷是否滿
{
if(front==rear)
{
returntrue;
}
else
{
returnfalse;
}
}
boolQUEUE::Is_full()//判斷是否空
{
if((rear+1)%count==front)
{
returntrue;
}
else
{
returnfalse;
}
}
voidQUEUE::enter_queue(intn)//入隊
{
if(Is_full())
{
cout<<"隊列已滿!"<<endl;
}
else
{
pBase[rear]=n;
rear=(rear+1)%count;
}
return;
}
intQUEUE::out_queue()//出隊
{
intn=pBase[front];
if(Is_empty())
{
cout<<"該隊列已空!"<<endl;
returnfalse;
}
else
{
front=(front+1)%count;
returnn;
}
}
voidQUEUE::travel_queue()//遍歷
{
intj=0;
for(inti=front;i%count!=rear;i++)
{
j++;
cout<<pBase[i%count]<<"";
if(j==5)
{
cout<<endl;
j=0;
}
}
if(j)
{
cout<<endl;
}
return;
}
❿ 模擬實現一個銀行叫號程序 (c語言)
#include<stdio.h>
main()
{
int n,i;
n=0;
while(1)
{
printf("請輸入指令:");
scanf("%d",&i);
if(i==0)
break;
if(i==1)
{
if(n==0)
printf("您前面無人排隊,請直接去櫃台辦理業務\n");
else
printf("您前面還有%d位,請等待\n",n);
n++;
}
if(i==2)
{
if(n>0)
n--;
}
}
}