Atm机中英转换去取款存款等C语言_atm机界面中英文对照
Atm机中英转换去取款存款等C语言由刀豆文库小编整理,希望给你工作、学习、生活带来方便,猜你可能喜欢“atm机界面中英文对照”。
#include #include #include
void LanguageMenu();void MainMenu_c();void Query_c();void Deposit_c();void WithDraw_c();void MainMenu_e();void Query_e();void Deposit_e();void WithDraw_e();float Money=1000;void main(){
int bExit=1,Exit=1;int i,j;while(Exit!=0){ LanguageMenu();
j=getche();
system(“cls”);
bExit=1;switch(j){case'1':while(bExit!=0)
{
MainMenu_c();
i=getche();
system(“cls”);
switch(i)
{
case'1':Query_c();break;
case'2':Deposit_c();break;
case'3':WithDraw_c();break;
case'4':bExit=0;break;
default:break;
}
} break;
case'2': while(bExit!=0)
{
MainMenu_e();
i=getche();
system(“cls”);
switch(i)
{
case'1':Query_e();break;
case'2':Deposit_e();break;
case'3':WithDraw_e();break;
case'4':bExit=0;break;
default:break;
}
} break;
case'3':Exit=0;break;default:break;} } }
void LanguageMenu(){
printf(“1.中文n2.Englishn3.退出”);}
void MainMenu_c(){ printf(“1查询n2存钱n3取钱n4退出n”);}
void Query_c(){ printf(“此帐户有%.2f 元n”,Money);system(“pause”);system(“cls”);}
void Deposit_c(){ float n;printf(“输入你要存的数目并确认:元”);scanf(“%f”,&n);Money=Money+n;
system(“pause”);system(“cls”);
}
void WithDraw_c(){ printf(“输入取款金额并确认: 元”);float n;scanf(“%f”,&n);while(n>Money)
{
printf(“n余额不足,请重新输入!n”);
system(“pause”);
system(“cls”);
printf(“输入取款金额并确认: 元”);
scanf(“%f”,&n);
} Money=Money-n;system(“pause”);system(“cls”);}
void MainMenu_e(){ printf(“1Queryn2Depositn3Withdrawn4Exitn”);
}
void Query_e(){ printf(“This account has %.2f yuann”,Money);system(“pause”);system(“cls”);}
void Deposit_e()
{ float n;printf(“Input your the amount you want to deposit and confirmation: yuan”);scanf(“%f”,&n);Money=Money+n;system(“pause”);system(“cls”);
}
void WithDraw_e(){ printf(“Input the amount and confirmation: yuan”);float n;scanf(“%f”,&n);while(n>Money)
{
printf(“nBalance is insufficient, please enter again!n”);
system(“pause”);
system(“cls”);
printf(“Input the amount and confirm it: yuan”);
scanf(“%f”,&n);
} Money=Money-n;system(“pause”);system(“cls”);}