资源简介
北京交通大学
软件学院
java作业
陈旭东
代码片段和文件信息
/* This class creates the program to test the banking classes.
* It creates a new Bank sets the Customer (with an initial balance)
* and performs a series of transactions with the Account object.
*/
import banking.*;
public class TestBanking {
public static void main(String[] args) {
Bank bank = new Bank();
Customer customer;
Account account;
//
// Create bank customers and their accounts
//
System.out.println(“Creating the customer Jane Smith.“);
bank.addCustomer(“Jane“ “Simms“);
customer = bank.getCustomer(0);
System.out.println(“Creating her Savings Account with a 500.00 balance and 3% interest.“);
customer.setAccount(new SavingsAccount(500.00 0.03));
System.out.println(“Creating the customer Owen Bryant.“);
bank.addCustomer(“Owen“ “Bryant“);
customer = bank.getCustomer(1);
System.out.println(“Creating his Checking Account with a 500.00 balance and no overdraft protection.“);
customer.setAccount(new CheckingAccount(500.00));
System.out.println(“Creating the customer Tim Soley.“);
bank.addCustomer(“Tim“ “Soley“);
customer = bank.getCustomer(2);
System.out.println(“Creating his Checking Account with a 500.00 balance and 500.00 in overdraft protection.“);
customer.setAccount(new CheckingAccount(500.00 500.00));
System.out.println(“Creating the customer Maria Soley.“);
bank.addCustomer(“Maria“ “Soley“);
customer = bank.getCustomer(3);
System.out.println(“Maria shares her Checking Account with her husband Tim.“);
customer.setAccount(bank.getCustomer(2).getAccount());
System.out.println();
//
// Demonstrate behavior of various account types
//
// Test a standard Savings Account
System.out.println(“Retrieving the customer Jane Smith with her savings account.“);
customer = bank.getCustomer(0);
account = customer.getAccount();
// Perform some account transactions
System.out.println(“Withdraw 150.00: “ + account.withdraw(150.00));
System.out.println(“Deposit 22.50: “ + account.deposit(22.50));
System.out.println(“Withdraw 47.62: “ + account.withdraw(47.62));
System.out.println(“Withdraw 400.00: “ + account.withdraw(400.00));
// Print out the final account balance
System.out.println(“Customer [“ + customer.getLastName()
+ “ “ + customer.getFirstName()
+ “] has a balance of “ + account.getBalance());
System.out.println();
// Test a Checking Account w/o overdraft protection
System.out.println(“Retrieving the customer Owen Bryant with his checking account with no overdraft protection.“);
customer = bank.getCustomer(1);
account = customer.getAccount();
// Perform some account transactions
System.out.println(“Withdraw 150.00: “ + account.withdraw(150.00));
System.out.println(“Deposit 22.50: “ + account.deposit(22.50));
System.out.println(“With
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 301 2011-04-03 11:04 MyBanking(level1)\.classpath
文件 385 2011-04-03 11:04 MyBanking(level1)\.project
文件 3643 2011-04-03 11:44 MyBanking(level1)\bin\TestBanking.class
文件 726 2011-04-03 11:44 MyBanking(level1)\bin\banking\Account.class
文件 857 2011-04-03 11:44 MyBanking(level1)\bin\banking\Bank.class
文件 685 2011-04-03 11:48 MyBanking(level1)\bin\banking\CheckingAccount.class
文件 915 2011-04-03 11:44 MyBanking(level1)\bin\banking\Customer.class
文件 388 2011-04-03 11:44 MyBanking(level1)\bin\banking\SavingsAccount.class
文件 4825 2011-04-03 11:44 MyBanking(level1)\src\TestBanking.java
文件 472 2011-04-03 11:44 MyBanking(level1)\src\banking\Account.java
文件 478 2011-04-03 11:44 MyBanking(level1)\src\banking\Bank.java
文件 615 2011-04-03 11:48 MyBanking(level1)\src\banking\CheckingAccount.java
文件 441 2011-04-03 11:44 MyBanking(level1)\src\banking\Customer.java
文件 225 2011-04-03 11:44 MyBanking(level1)\src\banking\SavingsAccount.java
文件 102598 2011-04-03 11:51 MyBanking(level1)\无标题.png
文件 301 2011-04-03 11:04 MyBanking(level2)\.classpath
文件 385 2011-04-03 11:04 MyBanking(level2)\.project
文件 2446 2011-04-03 13:00 MyBanking(level2)\bin\TestBanking.class
文件 726 2011-04-03 11:44 MyBanking(level2)\bin\banking\Account.class
文件 857 2011-04-03 11:44 MyBanking(level2)\bin\banking\Bank.class
文件 685 2011-04-03 11:48 MyBanking(level2)\bin\banking\CheckingAccount.class
文件 1325 2011-04-03 13:00 MyBanking(level2)\bin\banking\Customer.class
文件 388 2011-04-03 11:44 MyBanking(level2)\bin\banking\SavingsAccount.class
文件 2601 2011-04-03 13:00 MyBanking(level2)\src\TestBanking.java
文件 472 2011-04-03 11:44 MyBanking(level2)\src\banking\Account.java
文件 478 2011-04-03 11:44 MyBanking(level2)\src\banking\Bank.java
文件 615 2011-04-03 11:48 MyBanking(level2)\src\banking\CheckingAccount.java
文件 756 2011-04-03 13:00 MyBanking(level2)\src\banking\Customer.java
文件 225 2011-04-03 11:44 MyBanking(level2)\src\banking\SavingsAccount.java
文件 107220 2011-04-03 13:02 MyBanking(level2)\无标题.png
............此处省略49个文件信息
- 上一篇:JSP图形验证码的界面
- 下一篇:JSP开发邮件系统(源代码)
相关资源
- java开发的CS标准考试系统
- javawebDAO模式登录验证
- 银行账户管理 JAVA
- java多线程导出excel千万级别优化
- java图形界面九九乘法表
- java voronoi
- SL275lab题目
- java加入购物车源码附数据库文件
- java 发邮件带excel附件,以流的形式发
- 基于JAVA开发的KTV前台管理系统
- Java实现逻辑回归算法(LogRegression)对
- JAVA数据结构复杂表达式求值
- JAVA+MySQL学生成绩管理系统
- java2word程序代码及jar包
- JAVAWeb外文文献翻译
- java音频开发.mp3文件解码jmp123.jar
- 某智Java图书管理系统,视频,代码
- java 使用jacob Word转PDF 完美格式
- 银行系统server数据库
- 带人工智能的五子棋java源程序
- java混淆jocky,不限jdk版本
-
gba
se-connector-java-8.3.81.53-build52.8-bi - java编写整合操作系统五个算法
- iso8583协议的java实现
- Java Socket编写的教学管理系统(简易版
- JAVA写的编译器编译原理课设
- \“java实现简单的单点登录\“源码包
- 学生选课管理系统JAVA+SQL
- Eclipse Java注释模板
- java高校就业管理系统源码
评论
共有 条评论