本文持续更新
项目名称: Bank Arcount Management银行账户管理系统简称BAM。
写一个账户类(Account)
属性: ld 账户号码 长整数
password 账户密码 字符类型
Name:真实姓名 字符类型
Personld:身份证号码 字符类型
Email:客户的电子邮箱 字符类型
Balance:账号余额 double类型
方法:deposit:存款方法,参数是double类型的金额
Withdraw:取款方法,参数是double类型的金额
构造方法:有参和无参数,有参构造方法用于设置必要(必须)的属性
将 Account类作成完全封装,即设置每个属性的set/get方法。
account类
import java.util.Scanner;
public class Account {
long ID; //账号号码
String password; //账户密码
String Name; //真实姓名
String PersonID; //身份证号
String Email; //电子邮件
double Banlance; //账号余额
Account(){
}
Account(long id,String pw,String N,String PID,String E,double B ){
this.ID = id;
this.password = pw;
this.Name = N;
this.PersonID = PID;
this.Email = E;
this.Banlance = B;
}
void SetID(){
long id;
System.out.println("Please input ID:");
Scanner reader = new Scanner(System.in);
id = reader.nextLong();
this.ID = id;
}
Long GetID(){
return this.ID;
}
void SetPassWord()