import java.util.*;
public class Kadai1104 {
public static void main
(String[] args
) { BankBase[] bbs = new BankBase[5];
Scanner sc
= new Scanner
(System.
in); System.
out.
println("入金日(年)の入力"); int startYear = sc.nextInt();
for(int i=0; i<bbs.length; i++) {
System.
out.
print("預金タイプ(普通=1 / 定期=2): "); int num = sc.nextInt();
int money = sc.nextInt();
if(num == 1) {
bbs[i] = new FBank(money);
}
else if(num == 2) {
System.
out.
print("満期年数(1 / 3 / 5): "); int due = sc.nextInt();
bbs[i] = new TBank(money, due);
}
bbs[i].setStartYear(startYear);
}
FBank.setRate(3.0);
System.
out.
println("普通利息を" + FBank.
getRate() + "%にセット"); TBank.setRate(5.0);
System.
out.
println("定期利息を" + TBank.
getRate() + "%にセット");
System.
out.
println("現在の普通利率は" + FBank.
getRate() + "%です"); System.
out.
println("現在の定期利率は" + TBank.
getRate() + "%です");
System.
out.
println("本日の日付(年)の入力"); int Year = sc.nextInt();
BankBase.setCurrentYear(Year);
for(int i=0; i<bbs.length; i++) {
System.
out.
print("口座番号: " + bbs
[i
].
getAccountNum() + " 預金額: "); bbs[i].addInterest();
}
}
}
aW1wb3J0IGphdmEudXRpbC4qOwoKcHVibGljIGNsYXNzIEthZGFpMTEwNCB7CiAgICBwdWJsaWMgc3RhdGljIHZvaWQgbWFpbihTdHJpbmdbXSBhcmdzKSB7CiAgICAgICAgQmFua0Jhc2VbXSBiYnMgPSBuZXcgQmFua0Jhc2VbNV07CiAgICAgICAgU2Nhbm5lciBzYyA9IG5ldyBTY2FubmVyKFN5c3RlbS5pbik7CiAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKCLlhaXph5Hml6Uo5bm0KeOBruWFpeWKmyIpOwogICAgICAgIFN5c3RlbS5vdXQucHJpbnQoIuW5tDogIik7CiAgICAgICAgaW50IHN0YXJ0WWVhciA9IHNjLm5leHRJbnQoKTsKICAgICAgICBmb3IoaW50IGk9MDsgaTxiYnMubGVuZ3RoOyBpKyspIHsKICAgICAgICAgICAgU3lzdGVtLm91dC5wcmludCgi6aCQ6YeR44K/44Kk44OXKOaZrumAmj0xIC8g5a6a5pyfPTIpOiAiKTsKICAgICAgICAgICAgaW50IG51bSA9IHNjLm5leHRJbnQoKTsKICAgICAgICAgICAgU3lzdGVtLm91dC5wcmludCgi5YWl6YeR6aGNOiAiKTsKICAgICAgICAgICAgaW50IG1vbmV5ID0gc2MubmV4dEludCgpOwogICAgICAgICAgICBpZihudW0gPT0gMSkgewogICAgICAgICAgICAgICAgYmJzW2ldID0gbmV3IEZCYW5rKG1vbmV5KTsKICAgICAgICAgICAgfQogICAgICAgICAgICBlbHNlIGlmKG51bSA9PSAyKSB7CiAgICAgICAgICAgICAgICBTeXN0ZW0ub3V0LnByaW50KCLmuoDmnJ/lubTmlbAoMSAvIDMgLyA1KTogIik7CiAgICAgICAgICAgICAgICBpbnQgZHVlID0gc2MubmV4dEludCgpOwogICAgICAgICAgICAgICAgYmJzW2ldID0gbmV3IFRCYW5rKG1vbmV5LCBkdWUpOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGJic1tpXS5zZXRTdGFydFllYXIoc3RhcnRZZWFyKTsKICAgICAgICB9CiAgICAgICAgRkJhbmsuc2V0UmF0ZSgzLjApOwogICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbigi5pmu6YCa5Yip5oGv44KSIiArIEZCYW5rLmdldFJhdGUoKSArICIl44Gr44K744OD44OIIik7CiAgICAgICAgVEJhbmsuc2V0UmF0ZSg1LjApOwogICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbigi5a6a5pyf5Yip5oGv44KSIiArIFRCYW5rLmdldFJhdGUoKSArICIl44Gr44K744OD44OIIik7CgogICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbigi54++5Zyo44Gu5pmu6YCa5Yip546H44GvIiArIEZCYW5rLmdldFJhdGUoKSArICIl44Gn44GZIik7CiAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKCLnj77lnKjjga7lrprmnJ/liKnnjofjga8iICsgVEJhbmsuZ2V0UmF0ZSgpICsgIiXjgafjgZkiKTsKCiAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKCLmnKzml6Xjga7ml6Xku5go5bm0KeOBruWFpeWKmyIpOwogICAgICAgIFN5c3RlbS5vdXQucHJpbnQoIuW5tDogIik7CiAgICAgICAgaW50IFllYXIgPSBzYy5uZXh0SW50KCk7CiAgICAgICAgQmFua0Jhc2Uuc2V0Q3VycmVudFllYXIoWWVhcik7CiAgICAgICAgCiAgICAgICAgZm9yKGludCBpPTA7IGk8YmJzLmxlbmd0aDsgaSsrKSB7CiAgICAgICAgICAgIFN5c3RlbS5vdXQucHJpbnQoIuWPo+W6p+eVquWPtzogIiArIGJic1tpXS5nZXRBY2NvdW50TnVtKCkgKyAiIOmgkOmHkemhjTogIik7CiAgICAgICAgICAgIGJic1tpXS5hZGRJbnRlcmVzdCgpOwogICAgICAgIH0KICAgIH0KfQ==