91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 14KB
    文件類型: .cpp
    金幣: 2
    下載: 1 次
    發(fā)布日期: 2021-06-17
  • 語(yǔ)言: C/C++
  • 標(biāo)簽:

資源簡(jiǎn)介

活期儲(chǔ)蓄賬目管理系統(tǒng),實(shí)現(xiàn)儲(chǔ)戶開(kāi)戶、銷戶、存入、支出等活動(dòng)。其主要要求是能比較迅速地找到儲(chǔ)戶的賬戶,實(shí)現(xiàn)存款、取款,還要能比較簡(jiǎn)單、迅速地實(shí)現(xiàn)插入和刪除,以實(shí)現(xiàn)開(kāi)戶和銷戶的需要: (1)實(shí)現(xiàn)儲(chǔ)戶開(kāi)戶。開(kāi)戶時(shí)需要填寫登記卡,記錄儲(chǔ)戶信息(包括姓名和賬號(hào)),并設(shè)置開(kāi)戶余額為0。 (2)實(shí)現(xiàn)儲(chǔ)戶銷戶。需要先找到儲(chǔ)戶的賬戶信息,然后將其刪除。 (3)向某賬戶存款。需要找到賬戶信息,然后修改賬戶的余額(原來(lái)的余額 + 存入金額)。 (4)從某賬戶取款。需要找到賬戶信息,然后修改賬戶的余額(原來(lái)的余額 ? 取出金額)。 (5)排序顯示所有賬戶信息。根據(jù)賬號(hào)對(duì)所有賬戶信息排序。 (6)查詢某賬戶余額。找到要查找的賬戶,然后顯示賬戶余額。 (7)查詢某賬戶交易記錄。找到要查詢的賬戶,然后顯示該賬戶的交易記錄。 (8)所有賬戶及其交易信息存儲(chǔ)至文件,程序運(yùn)行時(shí)從文件中讀入。

資源截圖

代碼片段和文件信息

#include??
#include?
#include?
#define?initnumber?10001 //開(kāi)戶賬號(hào)
typedef?struct?account{
????int?account;??????????//賬戶號(hào)?
????char?username[9];?????//戶名?
????char?password[6];????//密碼?
????float?balance;???????//余額?
????int?status;??????????//賬戶狀態(tài)?
}Elem;
void?display(Elem?*x);??????????//顯示
int?save(Elem*?elem);???????????//保存
float?getmoney1(); //金額限制1
float?getmoney2(float?i); //金額限制2
Elem*?getN(int?number); //獲取賬號(hào)
void?Exit(); //退出
void?deposit(); //存款
void?withdraw(); //取款
void?openAcount(); //開(kāi)戶
void?closeAcount(); //銷戶
void?query(); //查詢
void?QueryAll(); //查詢?nèi)?br/> void?record();??????????????????//交易記錄?
void?mainmenu(); //系統(tǒng)菜單
void?display(Elem?*x)?{ //顯示
????char?*zt;
if(x->status==0)
????????zt=“正常“;
????else
????????zt=“銷戶“;
printf(“\t\t\t+----------------------------------------------+\n“);
printf(“\t\t\t|????帳號(hào)|????戶名|????密碼|??????余額|????狀態(tài)|\n“);????
????printf(“\t\t\t|%8d|%8s|%8s|%10.1f|%8s|\n“x->accountx->usernamex->passwordx->balancezt);
}
int?save(Elem*?elem){
????Elem*?nap=(Elem*)malloc(sizeof(Elem));
????int?flag=0count=0;
????FILE?*fp;
????fp=fopen(“bank““rb+“);
????if(fp!=NULL){
????????while(!feof(fp)){
????????????count=fread(napsizeof(Elem)1fp);
????????????if(count>0){
????????????????if(elem->account==nap->account){
????????????????????fseek(fp-((long)sizeof(Elem))1);
????????????????????fwrite(elemsizeof(Elem)1fp);
????????????????????flag=1;
????????????????????break;
????????????????}
????????????}
????????}
????????fclose(fp);
????}
????return?flag;
}

float?getmoney1(){ //金額限制1
????float?money=-1;
????while(1){
????????scanf(“%f“&money);
????????fflush(stdin);
????????if(money<=0){
????????????printf(“您輸入的金額小于等于0!請(qǐng)從新輸入......\n“);
????????????continue;
????????}else
????????????break;
????}
????return?money;
}
float?getmoney2(float?i){ //金額限制2
????float?money=-1;
????while(1){
????????scanf(“%f“&money);
????????fflush(stdin);
????????if(money<=0){
????????????printf(“您輸入的金額小于等于0!請(qǐng)從新輸入......\n“);
????????????continue;
????????}
????????else{
????????????if(money<=i)???break;
????????????else{
????????????????printf(“您的帳號(hào)余額已經(jīng)不足您本次的取款!\n“);
????????????????getchar();
????????????????mainmenu();
????????????}
????????}
????}
????return?money;
}

Elem*?getN(int?number){ //獲取賬號(hào)
????Elem?*elem=(Elem*)malloc(sizeof(Elem));
????Elem?*tmp=(Elem*)malloc(sizeof(Elem));
????int?flag=0count=0;
????FILE?*fp;
????fp=fopen(“bank““rb“);
????if(fp!=NULL){
????????while(!feof(fp)){
????????????count=fread(tmpsizeof(Elem)1fp);
????????????if(count>0){
????????????????if(tmp->account==number){
????????????????????flag=1;
????????????????????break;
????????????????????
????????????????}
????????????}
????????}
????????fclose(fp);
????????if(flag){
????????????elem->account=tmp->account;
????????????strcpy(elem->usernametmp->us

評(píng)論

共有 條評(píng)論