达内JAVA第一周测题_java开学第一周测试代码

这是一个Java实现的ATM系统,包括Account类和AccountManager类。Account类包含用户账号、姓名、操作日期、操作类型、密码、余额等属性及相应的方法。AccountManager类用于管理账户,包括输入验证、存款、取款、转账、修改密码等功能。用户输入账号和密码后,可以选择不同的操作,并对输入进行合法性检查,如必须是100的整数倍的金额。
摘要由CSDN通过智能技术生成

Account.java

/*

信1705-3 20173612  陈阳阳

*/

package ATM;

public class Account {

private String accountID;//用户的账号

private String accountname;//账户的名称

private String operatedate;//操作的日期

private int operatetype;//操作的类型

private String accountpassword;//用户的密码

private int accountbalance;//账户的余额

private int amount;//操作流水的金额

public Account(String accountID, String accountname, String operatedate, int operatetype,

String accountpassword,int accountbalance,int amount) {

this.accountID = accountID;

this.accountname = accountname;

this.operatedate = operatedate;

this.operatetype = operatetype;

this.accountpassword = accountpassword;

this.accountbalance = accountbalance;

this.amount = amount;}

public String getAccountID() {

return accountID;

}

public void setAccountID(String accountID) {

this.accountID = accountID;

}

public String getAccountName() {

return accountname;

}

public void setAccountName (String accountName) {

this.accountname = accountName;

}

public String getOperatedate() {

return operatedate;

}

public void setOperatedate(String Operatedate) {

this.operatedate = Operatedate;

}

public int getOperatetype() {

return operatetype;

}

public void setOperatetype(int Operatetype) {

this.operatetype = Operatetype;

}

public String getAccountpassword() {

return accountpassword;

}

public void setAccountpassword(String accountpassword) {

this.accountpassword = accountpassword;

}

public int getAccountbalance() {

return accountbalance;

}

public void setAccountbalance(int accountbalance) {

this.accountbalance = accountbalance;

}

public int getAmount() {

return amount;

}

public void setAmount(int amount) {

this.amount = amount;

}

}

AccountManager.java

package ATMOP;

import java.util.*;

public class AccountManager {

@SuppressWarnings({ "resource", "unused" })//(“unused”)未使用的变量  (“resource”)有泛型未指定类型

public static void main(String[] args)  throws NumberErrorException {

// TODO Auto-generated method stub

Scanner in=new Scanner(System.in);

PATM atm=new ATM();

NumberErrorException nee=new NumberErrorException("输入非法!"

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值