📄 feestest.java
字号:
public class FeesTest
{
public static void main(String[] args) {
Calendar cale = new Calendar();
FeesCard wallet[] = new FeesCard[10];
wallet[0] = new FeesCard("5391 0375 9387 5309", "John Bowman",
"California Savings", 0.0, 2500, cale.getDate());
cale.tock(7);
wallet[1] = new FeesCard("3485 0399 3395 1954", "John Bowman",
"California Federal", 0.0, 3500, cale.getDate());
cale.tock(7);
wallet[2] = new FeesCard("6011 4902 3294 2994", "John Bowman",
"California Finance", 0.0, 5000, cale.getDate());
cale.tock(7);
for (int i=1; i<=16; i++) {
wallet[0].chargeIt((double) i,cale.getDate());cale.tock(7);
wallet[1].chargeIt(2.0 * i,cale.getDate());cale.tock(7); // implicit cast
wallet[2].chargeIt((double) 3 * i,cale.getDate());cale.tock(7); // explicit cast
}
System.out.println("Card payments:");
for (int i=0; i<3; i++) {
FeesCard.printCard(wallet[i]);
while (wallet[i].getBalance() > 100.0) {
wallet[i].makePayment(100.0,cale.getDate());
cale.tock(7);
System.out.println("New balance = " + wallet[i].getBalance());
}
FeesCard.printTransacrions(wallet[i]);
System.out.println("");
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -