package banking.reports;
import banking.domain.*;
import java.text.NumberFormat;
public class CustomerReport {
public void generateReport() {
NumberFormat currency_format = NumberFormat.getCurrencyInstance();
Bank bank = Bank.getBank() ; /*** STEP 1: RETRIEVE BANK SINGLETON OBJECT HERE ***/
Customer customer;
System.out.println("\t\t\tCUSTOMERS REPORT");
System.out.println("\t\t\t================");
for ( int cust_idx = 0; cust_idx < bank.getNumOfCustomers(); cust_idx++ ) {
customer = bank.getCustomer(cust_idx);
System.out.println();
System.out.println("Customer: "
+ customer.getLastName() + ", "
+ customer.getFirstName());
for ( int acct_idx = 0; acct_idx < customer.getNumOfAccounts(); acct_idx++ ) {
Account account = customer.getAccount(acct_idx);
String account_type = "";
// Determine the account type
if ( account instanceof SavingsAccount ) {
account_type = "Savings Account";
} else if ( account instanceof CheckingAccount ) {
account_type = "Checking Account";
} else {
account_type = "Unknown Account Type";
}
// Print the current balance of the account
System.out.println(" " + account_type + ": current balance is "
+ currency_format.format(account.getBalance()));
}
}
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
Java简单的银行banking系统源码
共7个文件
java:7个
需积分: 16 8 下载量 201 浏览量
2017-12-08
21:43:55
上传
评论
收藏 4KB ZIP 举报
温馨提示
这是一个用java实现简单的银行存储系统项目代码,里面实现了一些基本功能,包括存储删除贷款等
资源推荐
资源详情
资源评论
收起资源包目录
最终项目源码.zip (7个子文件)
最终项目源码
TestBanking.java 1KB
banking
domain
Account.java 459B
SavingsAccount.java 230B
Bank.java 786B
CheckingAccount.java 699B
Customer.java 849B
reports
CustomerReport.java 1KB
共 7 条
- 1
资源评论
冰寒潇
- 粉丝: 4
- 资源: 5
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功