/** * @author admin * 该程序的功能为实现模拟银行ATM自动取款机提款,查询等功能. */ import Java.io.*/*该类为实现客户信息及部分功能*/ class Account { private String code =null//信用
卡号 private String name =null//客户姓名 private String password=null//客户密码 private double money =0.0//卡里金额 public Account(String code,String name,String password,double money) { this.code=codethis.name=namethis.password=passwordthis.money=money} protected String get_Code() { return code} protected String get_Name() { return name} protected String get_Password() { return password} public double get_Money() { return money} /*得到剩余的钱的数目*/ protected void set_Balance(double mon) { money -= mon} } /**********实现具体取款机功能*********/ class ATM { Account act// private String name// private String pwdpublic ATM() { act=new Account("000000","Devil","123456",50000)} /***********欢迎
界面***********/ protected void Welcome() { String str="---------------------------------"System.out.print(str "\n" "欢迎使用Angel模拟自动取款机程序.\n" str "\n")System.out.print(" 1.>取款." "\n" " 2.>查询信息." "\n" " 3.>密码设置." "\n" " 4.>退出系统." "\n")} /**********登陆系统**********/ protected void Load_Sys() throws Exception { String card,pwdint counter=0BufferedReader br=new BufferedReader(new InputStreamReader(System.in))do { System.out.println("请输入
您的xyk号:")card=br.readLine()System.out.println("请输入您的密码:")pwd=br.readLine()if(!isRight(card,pwd)) { System.out.println("您的卡号或密码输入有误.")counter } else SysOpter()}while(counter<3)Lock_Sys()} 回复获取全部这个不是太难吧?就画几个界面。。
第一个界面:登录界面,卡号和密码,把这两个保存到数据库里面去,然后去匹配是否正确。。
第二个界面:是用来存、取、修改密码的界面,这个钱自然也是要保存到数据库里面去,然后一些很简单的逻辑判断,你应该会吧?
第三个界面:是修改密码的界面。。也是从数据库里面读取数据,再update更改掉。
第四个界面:对钱的 *** 作。。
楼主你好,下面是源程序!可以在VC++上试一下!
#include <stdio.h>
void main()
{
int Password=0,Number=0,price=58,i=0
while( Password != 1234 )
{
if( i >= 3 )
return
i++
puts("Please input Password: ")
scanf("%d",&Password)
}
i=0
while( Number!=price )
{
do{
puts("Please input a number between 1 and 100: ")
scanf("%d",&Number)
printf("Your input number is %d\n",Number)
}while( !(Number>=1 &&Number<=100) )
if( Number >= 90 )
{
printf("Too Bigger! Press any key to try again!\n")
}
else if( Number >= 70 &&Number <90 )
{
printf("Bigger!\n")
}
else if( Number >= 1 &&Number <= 30 )
{
printf("Too Small! Press any key to try again!\n")
}
else if( Number >30 &&Number <= 50 )
{
printf("Small! Press any key to try again!\n")
}
else
{
if( Number == price )
{
printf("OK! You are right! Bye Bye!\n")
}
else if( Number <price )
{
printf("Sorry,Only a little smaller! Press any key to try again!\n")
}
else if( Number >price )
printf(" Sorry, Only a little bigger! Press any key to try again!\n")
}
getch()
}
}
评论列表(0条)