| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1817 人关注过本帖, 2 人收藏
标题:银行储存模拟系统
只看楼主 加入收藏
xs_cctv
Rank: 1
来 自:湖南
等 级:新手上路
帖 子:21
专家分:0
注 册:2008-8-19
结帖率:100%
收藏(2)
 问题点数:0 回复次数:1 
银行储存模拟系统
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <conio.h>
#define N 10000                       
struct chuhu                                                             //储户结构信息
{
    char idnum[11];                                             //帐号
    char password[7];                                           //密码
    char name[11];                                              //储户姓名
    char idnumber[19];                                          //储户身份证号码
    double cunkuan;                                             //存款金额
    double lixi;                                                //利息
    double yu;                                                  //余额
    int lei;                                                    //储种
    char address[51];                                           //储户地址
    char Tel[15];                                               //储户的联系电话
    char khdate[40];                                            //开户日期
    int g;                                                      //是否挂失(0为未,1为已)
}hu[N];   
                                                                               //储户结构数组           
void wang();                                                    //显示“※淘气猫小组研发制作※”的函数
int yanzheng();                                                //验证帐号和密码并核查该帐号是否挂失的函数
void li();                                                      //计算利息的函数
void date();                                                     //显示当前日期和时间
void insert();                                                  //开户函数
void display();                                                  //显示所有帐户信息的函数
void in(int);                                                      //存款函数
void find(int);                                                    //查询余额函数
void out(int);                                                     //取款函数
void zhuan(int);                                                   //转帐函数
void changepwd(int);                                               //修改密码的函数                          
void guashi(int);                                                  //挂失函数
void del(int);                                                     //销户函数
void lilvbiao();                                                   //查看利率表
void cxgs();                                                       //撤消挂失的函数
void grxx(int);                                                    //查看个人信息的函数
void help();                                                       //储户须知函数
void bangzhu();                                                     //帮助                    

int i,j,k,A=0,B=0;             //i,j控制循环,id为帐号,A、B分别为开户数和销户数
double jin;                     //存款、取款或转帐金额
char ch='y';                   //控制是否继续的变量
char id[11],password[7];              

void main()                                                               //输出主菜单
{
    int a,b;                                                                //选择功能的变量
    char dlzh[11],pword[7];
    system("color 79");
    date();
    printf("\n\n\n\t\t※※※※※※※※※※※※※※※※※※※※※※※※※\n");
    printf("\t\t※                                              ※\n");   //界面1
    printf("\t\t※                                              ※\n");
    printf("\t\t※            银行储蓄管理模拟系统              ※\n");
    printf("\t\t※                                              ※\n");
    printf("\t\t※                                              ※\n");
    printf("\t\t※                                                ※\n");
    printf("\t\t※                                              ※\n");
    printf("\t\t※※※※※※※※※※※※※※※※※※※※※※※※※\n\n\n\n");
    wang();
    printf("按ENTER键进入下一界面。。。→");
    fflush(stdin);
    scanf("%c",&ch);
    do{
        system("cls");
        system("color f3");
        date();
        printf("\n\n\n\t\t\t");
        for(i=0;i<10000000;i++)
            {
                if(i%340000==0)
                    printf(">");
            }
        printf("\t\t                                                \n"); //界面2
        printf("\t\t        欢迎使用本系统!!!               \n");
        printf("\n\n\t\t          请输入您的登陆帐号:   ");
        fflush(stdin);
        gets(dlzh);
        printf("\n\n\t\t          请输入您的密码:   ");
        for(i=0;i<6;i++)
        {
            fflush(stdin);
            pword[i]=getch();
            printf("*");
        }
        pword[6]='\0';
        fflush(stdin);
        scanf("%c",&ch);
        printf("\t\t                                                \n");
        printf("\t\t                                             \n");
        printf("\n\t\t\t");
        for(i=0;i<10000000;i++)
            {
                if(i%340000==0)
                    printf(">");
            }
        if(strcmp(dlzh,"aa")!=0||strcmp("123456",pword)!=0)
        {
            printf("\n\n\t\t您输入的登陆帐号或密码不正确,请重新输入:\n\n");
            printf("\t\t按ENTER键进入重新输入界面。。。→");
            fflush(stdin);
            scanf("%c",&ch);
        }
    }while(strcmp(dlzh,"aa")!=0||strcmp("123456",pword)!=0);
    do{
        wang();
        printf("\n\n按ENTER键进入/返回主菜单→:");
        fflush(stdin);
        scanf("%c",&ch);
        system("cls");                                                        //清屏
        system("color 57");
        date();
        printf("\t\t\t主菜单\n\n");
        printf("\t\t★★★★★★★★★★★★★★★★★★★★★★\n");               //主菜单界面(界面3)
        printf("\t\t●                                       ●\n");
        printf("\t\t●      ◆  1、 开户                     ●\n");
        printf("\t\t●      ◆  2、 显示所有帐户             ●\n");
        printf("\t\t●      ◆  3、 存款                     ●\n");
        printf("\t\t●      ◆  4、 查询余额                 ●\n");
        printf("\t\t●      ◆  5、 取款                     ●\n");
        printf("\t\t●      ◆  6、 转帐                     ●\n");
        printf("\t\t●      ◆  7、 修改密码                 ●\n");
        printf("\t\t●      ◆  8、 挂失                     ●\n");
        printf("\t\t●      ◆  9、 销户                     ●\n");
        printf("\t\t●      ◆  10、撤消挂失                 ●\n");
        printf("\t\t●      ◆  11、查看储户个人信息         ●\n");
        printf("\t\t●      ◆  12、查看利率表               ●\n");
        printf("\t\t●      ◆  13、储户须知                 ●\n");
        printf("\t\t●      ◆  14、帮助                     ●\n");
        printf("\t\t●      ◆  0、退出程序                  ●\n");
        printf("\t\t●                                       ●\n");
        printf("\t\t★★★★★★★★★★★★★★★★★★★★★★");
        wang();
        printf("请选择功能(0-14):→   ");
        fflush(stdin);
        scanf("%d",&a);
        switch(a)                                                             //选择功能
        {
            case 1:                                                              //选择功能后调用相应的函数
                insert();
                break;
            case 2:
                display();
                break;
            case 3:
                b=yanzheng();
                in(b);
                break;
            case 4:
                b=yanzheng();
                find(b);
                break;
            case 5:
                b=yanzheng();
                out(b);
                break;
            case 6:
                b=yanzheng();
                zhuan(b);
                break;
            case 7:
                b=yanzheng();
                changepwd(b);
                break;
            case 8:  
                b=yanzheng();
                guashi(b);
                break;
            case 9:  
                b=yanzheng();
                del(b);
                break;
            case 10:  
                cxgs();
                break;
            case 11:
                b=yanzheng();
                grxx(b);
                break;
            case 12:  
                lilvbiao();
                break;
            case 13:  
                help();
                break;
            case 14:  
                bangzhu();
                break;
            case 0:
                system("cls");
                system("color f1");
                date();
                printf("\n\n\n\t==========================================================\n");
                printf("\t‖                                                       ‖\n");
                printf("\t‖                      使                         ‖\n");
                printf("\t‖                                                       ‖\n");
                printf("\t‖                                                       ‖\n");
                printf("\t‖                                                       ‖\n");
                printf("\t‖        组长:                                         ‖\n");
                printf("\t‖                                                       ‖\n");
                printf("\t‖                                                       ‖\n");
                printf("\t‖        组员:                                         ‖\n");
                printf("\t‖                                                       ‖\n");
                printf("\t‖                                                       ‖\n");
                printf("\t‖                                                       ‖\n");
                printf("\t‖                                                       ‖\n");
                printf("\t==========================================================");
                wang();
                printf("您真的要退出吗(y/n)?    ");
                fflush(stdin);
                scanf("%c",&ch);
                system("cls");
                break;
            default:
                system("cls");
                printf("\n\n\t您的输入有误,请正确选择功能!!!……");
                break;
        }
        if(a==0&&(ch=='y'||ch=='Y'))
        {
            system("color 0c");
            date();
            printf("\n\n\n\n\t◇                                 使         !   ◇");
            wang();
            break;
        }
    }while(1);    
}

void insert()                                                             //开户
{         
    wang();
    do{
        system("cls");                                                    //清屏
        system("color f0");
        date();
        printf("\n\n\t\t请输入新储户的信息:");
        
        do{
            printf("\n\n\t\t储户帐号(10位):  ");
            fflush(stdin);
            gets(hu[A-B].idnum);
            if(strlen(hu[A-B].idnum)!=10)
            {
                system("cls");
                printf("\n\t\t输入错误!\n\t\t帐号请输入10位数字或字母");
            }
        for(i=0;i<A-B;i++)
            if(strcmp(hu[A-B].idnum,hu[i].idnum)==0)
                break;
        if(i<A-B)
            printf("\n\n\t\t该帐户已存在,请重新输入帐号");
        }while(strlen(hu[A-B].idnum)!=10||i<A-B);
        printf("\n\t\t储户密码(6位):  ");
        for(i=0;i<6;i++)
        {
            fflush(stdin);
            hu[A-B].password[i]=getch();
            printf("*");
        }
        hu[A-B].password[6]='\0';
        fflush(stdin);
        scanf("%c",&ch);

        printf("\n\t\t姓名:  ");
        fflush(stdin);
        gets(hu[A-B].name);

        do{
            printf("\n\t\t储户身份证号码(18位):  ");
            fflush(stdin);
            gets(hu[A-B].idnumber);
            if(strlen(hu[A-B].idnumber)!=18)
                printf("\n\t\t输入错误!\n\t\t身份证请输入18位数字或字母\n");
            for(i=0;i<A-B;i++)
            if(strcmp(hu[A-B].idnumber,hu[i].idnumber)==0&&strcmp(hu[A-B].name,hu[i].name)!=0)
                break;
        if(i<A-B)
            printf("\n\n\t\t前面已有一个不同姓名的储户的身份证号为此号码,\n\t\t同一个身份证号不可以有不同的姓名,\n\n\t\t请重新输入身份证号:\n");
        }while(strlen(hu[A-B].idnumber)!=18||(strcmp(hu[A-B].idnumber,hu[i].idnumber)==0&&strcmp(hu[A-B].name,hu[i].name)!=0));

        printf("\n\t\t存款金额:  ");
        fflush(stdin);
        scanf("%lf",&hu[A-B].cunkuan);

        printf("\n\t\t储种:  ");
        printf("\n\t\t\t0、 活期");
        printf("\n\t\t\t1、 一年定期");
        printf("\n\t\t\t2、 两年定期");
        printf("\n\t\t\t3、 三年定期");
        printf("\n\t\t\t4、 五年定期");
        do{
            printf("\n\t\t请选择(1-4):   ");
            fflush(stdin);
            scanf("%d",&hu[A-B].lei);
            if(hu[A-B].lei<0||hu[A-B].lei>4)
                printf("\n\n\t\t您选择错误,请正确选择!!");
        }while(hu[A-B].lei<0||hu[A-B].lei>4);

        printf("\n\t\t储户电话:  ");
        fflush(stdin);
        gets(hu[A-B].Tel);

        printf("\n\t\t储户地址:  ");
        fflush(stdin);
        gets(hu[A-B].address);

        printf("\n\t\t开户日期:  ");
        gets(hu[A-B].khdate);
        hu[A-B].g=0;
        li();
        hu[A-B].yu=hu[A-B].cunkuan+hu[A-B].lixi;
        A++;
        printf("是否继续(y/n)?    ");
        fflush(stdin);
        scanf("%c",&ch);
    }while(ch=='y'||ch=='Y');
}

void display()                                                            //存款
{  
    struct chuhu z;
    system("cls");                                                        //显示出详细的信息
    for(i=0;i<A-B;i++)                                                    //实现帐号排序功能
        for(j=0;j<A-B-i-1;j++)
            if(hu[j].idnum>hu[j+1].idnum)
            {
                z=hu[j];
                hu[j]=hu[j+1];
                hu[j+1]=z;
            }
    date();
    if(A-B==0)
        printf("\n\n\n\t\t\t储户信息中暂无帐户!");
    else
    {
        printf("\n\n\n\t\t\t储户信息(按照帐号升序排列)\n");
        printf("============================================================================\n\n");
        printf("帐号\t\t姓名\t储种\t余额(已加利息)\t开户日期\t是否挂失(1/0)\n\n");
        for(i=0;i<A-B;i++)
            printf("%s\t%s\t%d\t%.2lf\t\t%s\t%d\n",hu[i].idnum,hu[i].name,hu[i].lei,hu[i].yu,hu[i].khdate,hu[i].g);
        printf("\n\n\t注:     储种中数字的含义为:\n\n\t0: 活期   1: 一年定期   2: 两年定期   3: 三年定期   4: 五年定期");    
    }
}

void in(int count)                                   //存款
{
    if(count<3&&strcmp(id,hu[i].idnum)==0 && strcmp(password,hu[i].password)==0)
    {
        date();
        wang();
        do{
            printf("\n\n\t\t请输入存款金额:  ");
            fflush(stdin);
            scanf("%lf",&jin);
            if(jin<0)
                printf("\n\n\n\t\t存款不能为负数!!!");
        }while(jin<0);
        if(jin>=0)
        {
            hu[i].yu+=jin;
            printf("\n\n\t\t\t您存款成功!\n\n\t\t本次存入金额为:  %.2f",jin);
        }
    }
}

void find(int count)                                 //查找储户余额信息
{
    if(count<3&&strcmp(id,hu[i].idnum)==0 && strcmp(password,hu[i].password)==0)
    {
        date();
        printf("\n\n\t您所查询的储户的信息如下:");
        printf("\n\n\t\t帐号:  %s",hu[i].idnum);
        printf("\n\n\t\t姓名:  %s",hu[i].name);
        printf("\n\n\t\t储种:  %d",hu[i].lei);
        printf("\n\n\t\t余额(已加利息):  %.2lf",hu[i].yu);
        printf("\n\n\t\t开户日期:  %s",hu[i].khdate);    
        printf("\n\n\t注:     储种中数字的含义为:\n\n\t0: 活期   1: 一年定期   2: 两年定期\n\t3: 三年定期   4: 五年定期");
    }
}

void out(int count)                                  //取款
{
    if(count<3&&strcmp(id,hu[i].idnum)==0 && strcmp(password,hu[i].password)==0)
    {
        date();
        do{    
            printf("\n\n\t\t请输入取款金额:  ");
            fflush(stdin);
            scanf("%lf",&jin);
            if(hu[i].yu<jin)
                printf("\n\n\t对不起,您帐上的金额不够,请重新输入取款金额……");
            if(jin<0)
                printf("\n\n\n\t\t取款不能为负数!!!");
        }while(hu[i].yu<jin||jin<0);
        if(hu[i].yu>=jin)
        {
            hu[i].yu-=jin;    
            printf("\n\n按ENTER键打印取款单→:");   //打印取款单
            fflush(stdin);
            scanf("%c",&ch);
            system("cls");
            date();
            printf("\n\n\n\t\t办理业务:  取款");
            printf("\n\n\t\t帐号:  %s",hu[i].idnum);
            printf("\n\n\t\t姓名:  %s",hu[i].name);
            printf("\n\n\t\t储种:  %d",hu[i].lei);
            printf("\n\n\t\t取款金额:  %.2f",jin);
        }    
    }
}

void zhuan(int count)                                //转帐
{
    int p=0,a;
    if(count<3&&p<3)
    {
        date();
        do{
            do{
                wang();
                printf("\n\n\t\t请输入对方的帐号:  ");
                fflush(stdin);
                gets(id);
                printf("\n\n\t\t");
                for(k=0;k<10000000;k++)
                    if(k%340000==0)
                        printf(">");
                for(k=0;k<A-B;k++)
                    if(strcmp(id,hu[k].idnum)==0)
                        break;
                if(k<A-B&&hu[k].g!=1)
                {
                    printf("\n\n按ENTER键继续下一步→:");
                    fflush(stdin);
                    scanf("%c",&ch);
                    system("cls");
                    break;
                }
                else if(k<A-B&&hu[k].g==1)
                {
                    p++;
                    printf("\n\n\t\t您输入的帐号已挂失,您可以选择重新输入或退出。\n\n");
                    printf("\t\t\t1、重新输入\n\t\t\t2、退出此程序");
                    printf("\n\n\t\t请选择→");
                    fflush(stdin);
                    scanf("%d",&a);
                    if(a==2)
                        break;
                }
                else if(count==2)
                {
                    printf("\n\n\t\t对不起,由于您三次输入的帐号都已挂失或不存在,程序将会退出。\n\n\t按任意键两次都会进入主界面。。。→");
                    fflush(stdin);
                    scanf("%c",&ch);
                    break;
                }
                else
                {
                    p++;
                    printf("\n\n\t\t帐户表中没有该帐户!您可以选择重新输入或退出。\n\n");
                    printf("\t\t\t1、重新输入\n\t\t\t2、退出此程序");
                    printf("\n\n\t\t请选择→");
                    fflush(stdin);
                    scanf("%d",&a);
                    if(a==2)
                        break;
                }
                system("cls");
            }while(A-B!=0);
            if(k<A-B&&hu[k].g!=1)
            {
                do{
                    printf("\n\n\t\t请输入转帐金额:  ");
                    fflush(stdin);
                    scanf("%lf",&jin);
                    if(hu[i].yu<jin)
                        printf("\n\n\t对不起,您帐上的金额不够,请重新输入取款金额……");
                    if(jin<0)
                        printf("\n\n\t\t转帐金额不能为负数!!!");
                    }while(hu[i].yu<jin);
                if(jin>=0)
                {        
                    hu[i].yu-=jin;
                    hu[k].yu+=jin;
                    printf("\n\n\t\t\t您已转帐成功!");
                    printf("\n\n\t\t本次转帐金额为(元):  %.2f",jin);
                }    
            }
            printf("\n\n\t\t是否继续(y/n)?");
            fflush(stdin);
            scanf("%c",&ch);
        }while(ch=='y'||ch=='Y');
    }
}

void changepwd(int count)                            //修改密码
{
    int p=0;
    if(count<3&&p<3&&strcmp(id,hu[i].idnum)==0 && strcmp(password,hu[i].password)==0)
    {
        date();
        do{
            printf("\n\t\t请输入新密码(6位):   ");
            for(k=0;k<6;k++)
            {
                fflush(stdin);
                password[k]=getch();
                printf("*");
            }
            password[6]='\0';            
            fflush(stdin);
            scanf("%c",&ch);
            printf("\n\n\t\t请再次输入新密码(6位):   ");
            for(j=0;j<6;j++)
            {
                fflush(stdin);
                hu[i].password[j]=getch();
                printf("*");
            }
            hu[i].password[6]='\0';
            fflush(stdin);
            scanf("%c",&ch);
            if(strcmp(hu[i].password,password)!=0)
            {
                p++;
                printf("\n\n\t\t您两次输入的密码不一致,请重新输入:");
                printf("\n\n按ENTER键进入重新输入界面。。。→");
                fflush(stdin);
                scanf("%c",&ch);
            }
            else
                printf("\n\n\t\t\t密码修改成功! \n\t\t下次办理相关业务时请用这个新密码!");
            if(count==3||p==3)
                break;
        }while(strcmp(hu[i].password,password)!=0);
    }
}

void guashi(int count)                               //挂失
{
    if(count<3&&strcmp(id,hu[i].idnum)==0 && strcmp(password,hu[i].password)==0)
    {
        date();
        system("cls");
        printf("\n\n\n\t\t该帐户确实要挂失(y/n)?    ");
        fflush(stdin);
        scanf("%c",&ch);
        if(ch=='y'||ch=='Y')
        {
            hu[i].g=1;
            printf("\n\n\t\t\t挂失成功!\n\t\t在取消挂失前该帐户将不可用。");
        }
    }
}

void del(int count)                                  //销户
{
    if(count<3&&strcmp(id,hu[i].idnum)==0 && strcmp(password,hu[i].password)==0)
    {
        date();
        printf("\n\n\n\t\t该帐户确实要销户吗(y/n)?    ");
        fflush(stdin);
        scanf("%c",&ch);
        if(ch=='y'||ch=='Y')
        {
            if(hu[i].yu>0)
                printf("\n\n\t\t该帐户上还有余额,不能进行销户\n\n\t\t如需销户请先进行取款操作!!");
            else
            {
                B++;
                for(j=i;j<A-B;j++)                                            //有相应的信息时将其删除
                    hu[j]=hu[j+1];    
                printf("\n\n\t\t\t销户成功!\n\t\t下次如需办理相关业务请先开户。");
            }
        }
    }
}

void lilvbiao()                             //打印利率表
{
    system("cls");
    system("color f5");
    date();
    printf("\n\n\n\t\t\t利率对照表:\n");
    printf("\t≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡\n");
    printf("\t‖                                           ‖\n");
    printf("\t‖储  种 ‖      ‖ˉˉˉˉ‖ˉˉˉˉ‖ˉˉˉˉ‖ˉˉˉˉ‖\n");
    printf("\t‖            一年    二年    三年    五年  ‖\n");
    printf("\t‖ˉˉˉ ‖ˉˉˉ‖ˉˉˉˉ‖ˉˉˉˉ‖ˉˉˉˉ‖ˉˉˉˉ‖\n");
    printf("\t‖利率(%%%)‖ 1.25 ‖  1.98     2.25 ‖   2.52 ‖   2.79 ‖\n");
    printf("\t≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡\n");
    printf("\n\t说明:若为定期,每愈一天,每天利率0.02‰,若未到期提前\n\t支取,按每天计,每月算三十天,利息税20%扣除。\n");
}

void cxgs()                               //挂失
{
    int p=0,a;
    system("cls");
    date();
    do{
        system("color f9");
        printf("\n\n\t\t          请输入您的帐号:   ");
        fflush(stdin);
        gets(id);
        printf("\n\n\t\t          请输入您的密码:   ");
        for(i=0;i<6;i++)
        {
            fflush(stdin);
            password[i]=getch();
            printf("*");
        }
        password[6]='\0';
        fflush(stdin);
        scanf("%c",&ch);
        printf("\n\n\t\t");
        for(i=0;i<10000000;i++)
        {
            if(i%340000==0)
                printf(">");
        }
        for(i=0;i<A-B;i++)
            if(strcmp(id,hu[i].idnum)==0 && strcmp(password,hu[i].password)==0 )
                break;
        if(i<A-B && hu[i].g==1)
        {
            printf("\n\n按ENTER键继续下一步→:");
            fflush(stdin);
            scanf("%c",&ch);
            system("cls");
            break;
        }
        else if(i<A-B && hu[i].g!=1)
        {
            p++;
            printf("\n\n\t\t您输入的帐号没有挂失,您可以选择重新输入或退出。\n\n");
            printf("\t\t\t1、重新输入\n\t\t\t2、退出此程序");
            printf("\n\n\t\t请选择→");
            fflush(stdin);
            scanf("%d",&a);
            if(a==2)
                break;
        }
        else if(A-B==0)
        {
            p++;
            printf("\n\n\t\t帐户表中没有该帐户!\n\n\t\t如需办理相关业务,请先办理开户手续。");
            printf("\n\n按两次ENTER键进入/返回主菜单(可办理开户手续)→:");
            fflush(stdin);
            scanf("%c",&ch);
            break;
        }
        
        else if(p<2&&hu[i].g!=1)
        {
            p++;
            printf("\n\n\t\t您输入的帐号和密码不匹配,您可以选择重新输入或退出。\n\n");
            printf("\t\t\t1、重新输入\n\t\t\t2、退出此程序");
            printf("\n\n\t\t请选择→");
            fflush(stdin);
            scanf("%d",&a);
            if(a==2)
                break;        
        }
        else
        {
            printf("\n\n\t\t对不起,由于您三次输入的数据都不正确,程序将会退出。\n\n\t按任意键两次都会进入主界面。。。→");
            fflush(stdin);
            scanf("%c",&ch);
            break;
        }
        system("cls");
        if(a==2||p==3)
            break;
    }while(A-B!=0&&p<=3);
    if(p<3&&hu[i].g==1&&strcmp(id,hu[i].idnum)==0 && strcmp(password,hu[i].password)==0)
    {
        system("cls");
        printf("\n\n\n\t\t该帐户确实要撤消挂失(y/n)?    ");
        fflush(stdin);
        scanf("%c",&ch);
        if(ch=='y'||ch=='Y')
        {
            hu[i].g=0;
            printf("\n\n\t\t\t已成功撤消挂失!\n\t\t以后该帐户将恢复各项业务办理功能。");
        }
    }
}

void grxx(int count)                                 //查找储户余额信息
{
    system("cls");
    if(count<3&&strcmp(id,hu[i].idnum)==0 && strcmp(password,hu[i].password)==0)
    {
        date();
        printf("\n\n\t您所查询的储户的个人信息如下:");
        printf("\n\n\t\t帐号:  %s",hu[i].idnum);
        printf("\n\n\t\t密码:  %s",hu[i].password);
        printf("\n\n\t\t姓名:  %s",hu[i].name);
        printf("\n\n\t\t身份证号码:  %s",hu[i].idnumber);
        printf("\n\n\t\t储种:  %d",hu[i].lei);
        printf("\n\n\t\t电话:  %s",hu[i].Tel);
        printf("\n\n\t\t地址:  %s",hu[i].address);
        printf("\n\n\t\t开户日期:  %s",hu[i].khdate);    
        printf("\n\n\t注:     储种中数字的含义为:\n\n\t0: 活期   1: 一年定期   2: 两年定期\n\t3: 三年定期   4: 五年定期");
    }
}

void help()                                                               //储户须知
{
    system("cls");
    system("color f0");
    date();
    printf("\n\t\t储                 知");
    printf("\n\n\n\t\t→ 使用本帐号,须遵守我行帐户借记章程及相关业务规定\n\n");
    printf("\t\t→ 若遗失本存折或相应信任卡,请立即通知本银行\n\n");
    printf("\t\t→ 本存折和相应信任卡所有权属本银行\n\n");
    printf("\t\t→ 生肖信任卡是系列卡,每年一款,到期后请按时到本行换卡\n\n");
}

void bangzhu()
{
    system("cls");
    system("color f1");
    date();
    printf("\n\n\t\t\t本系统操作指南:");
    printf("\n\n\t\t1、进入主菜单后,按照编号选择相应的功能,例如:选择“1”,则会\n\t\t弹出开户的对话框");
    printf("\n\n\t\t2、进入相应的对话框以后,再按照的提示一步步操作即可");
    printf("\n\n\t\t\t〓〓〓〓〓 祝您使用愉快 〓〓〓〓〓");
}

int yanzheng()                             //验证帐号或密码
{
    int count=0,a;
    date();
    do{
        system("cls");
        system("color f9");
        printf("\n\n\t\t          请输入您的帐号:   ");
        fflush(stdin);
        gets(id);
        printf("\n\n\t\t          请输入您的密码:   ");
        for(i=0;i<6;i++)
        {
            fflush(stdin);
            password[i]=getch();
            printf("*");
        }
        password[6]='\0';
        fflush(stdin);
        scanf("%c",&ch);
        printf("\n\n\t\t");
        for(i=0;i<10000000;i++)
        {
            if(i%340000==0)
                printf(">");
        }
        for(i=0;i<A-B;i++)
            if(strcmp(id,hu[i].idnum)==0 && strcmp(password,hu[i].password)==0 )
                break;

        if(i<A-B && hu[i].g!=1)
        {
            printf("\n\n按ENTER键继续下一步→:");
            fflush(stdin);
            scanf("%c",&ch);
            system("cls");
            break;
        }
        else if(hu[i].g==1)
        {
            count++;
            printf("\n\n\t\t您输入的帐号已挂失,您可以选择重新输入或退出。\n\n");
            printf("\t\t\t1、重新输入\n\t\t\t2、退出此程序");
            printf("\n\n\t\t请选择→");
            fflush(stdin);
            scanf("%d",&a);
            if(a==2)
                break;
        }
        else if(A-B==0)
        {
            printf("\n\n\t\t帐户表中没有该帐户!\n\n\t\t如需办理相关业务,请先办理开户手续。");
            printf("\n\n按两次ENTER键进入/返回主菜单(可办理开户手续)→:");
            fflush(stdin);
            scanf("%c",&ch);
            break;
        }
        
        else if(count<2&&hu[i].g!=1)
        {
            count++;
            printf("\n\n\t\t您输入的帐号和密码不匹配,您可以选择重新输入或退出。\n\n");
            printf("\t\t\t1、重新输入\n\t\t\t2、退出此程序");
            printf("\n\n\t\t请选择→");
            fflush(stdin);
            scanf("%d",&a);
            if(a==2)
                break;        
        }
        else
        {
            printf("\n\n\t\t对不起,由于您三次输入的帐号和密码都不匹配,程序将会退出。\n\n\t按任意键两次都会进入主界面。。。→");
            fflush(stdin);
            scanf("%c",&ch);
            break;
        }
        system("cls");
        if(a==2||count==3)
            break;
    }while(A-B!=0&&count<=3);
    return count;
}

void li()                                                           //计算利息
{
    double xi;
    if(hu[A-B].lei==1)
        xi=hu[A-B].cunkuan*0.0198*1;
    else if(hu[A-B].lei==2)
        xi=hu[A-B].cunkuan*0.0225*2;
    else if(hu[A-B].lei==3)
        xi=hu[A-B].cunkuan*0.0252*3;
    else if(hu[A-B].lei==4)
        xi=hu[A-B].cunkuan*0.0279*5;
    else
        xi=0;
    hu[A-B].lixi=xi-xi*0.2;
}

void date()
{
    printf("当前日期:  ");
    system("date/t");
    printf("当前时间:  ");
    system("time/t");
}

void wang()                                                               //相当于页脚
{
    printf("\n\n\n\t\t==========※淘气猫小组研发制作※==========\n\n");
}
搜索更多相关主题的帖子: 模拟系统 银行 储存 
2008-09-18 19:55
josen0205
Rank: 2
来 自:江苏
等 级:论坛游民
帖 子:307
专家分:52
注 册:2007-5-8
收藏
得分:0 
一般银行的客户信息和客户的账户信息是分开存储的,也就是放在两张表,通过客户编号关联。银行系统只保存客户账号的余额,而且如果是活期存款,银行采用的是分段计息,通过积数滚动计息,每次客户存款金额变动时计算积数。结息日发放利息,现在人行规定好像是一个季度结息一次。

只有想不到,没有做不到
2008-09-19 10:19
快速回复:银行储存模拟系统
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.033753 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved