最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Java實(shí)現(xiàn)銀行賬戶管理子系統(tǒng)

 更新時(shí)間:2022年05月27日 16:27:05   作者:JKS4vage  
這篇文章主要為大家詳細(xì)介紹了Java實(shí)現(xiàn)銀行賬戶管理子系統(tǒng),文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下

本文實(shí)例為大家分享了Java實(shí)現(xiàn)銀行賬戶管理子系統(tǒng)的具體代碼,供大家參考,具體內(nèi)容如下

所用到的知識(shí)點(diǎn):面向?qū)ο蠡A(chǔ)語(yǔ)法,封裝,方法覆蓋(重寫(xiě))、繼承、多態(tài)

話不多說(shuō),直接上代碼

Account.java

package com.task1;

import java.util.Scanner;

public class Account {
?? ?//規(guī)定賬戶類型:
?? ?//0 – 儲(chǔ)蓄賬戶 ?1 – 信用賬戶 2 – 可貸款儲(chǔ)蓄賬戶 3– 可貸款信用賬戶
?? ?private Long id ;//賬戶號(hào)碼
?? ?private String password;//賬戶密碼
?? ?private String name;//真實(shí)姓名
?? ?private String personId;//身份證號(hào)碼
?? ?private String email;//客戶的電子郵箱
?? ?private double balance;//賬戶余額
?? ?private int type;//賬戶類型
?? ?
?? ?//無(wú)參的構(gòu)造方法
?? ?public Account(){
?? ??? ?
?? ?}
?? ?
?? ?//有參的構(gòu)造方法
?? ?public Account(long id, String password, String name, String personId, String email, double balance, int type) {
?? ??? ??? ?super();
?? ??? ??? ?this.id = id;
?? ??? ??? ?this.password = password;
?? ??? ??? ?this.name = name;
?? ??? ??? ?this.personId = personId;
?? ??? ??? ?this.email = email;
?? ??? ??? ?this.balance = balance;
?? ??? ??? ?this.type = type;
?? ??? ?}
?? ?
?? ?//get、set方法
?? ?public Long getId() {
?? ??? ?return id;
?? ?}

?? ?public void setId(long id) {
?? ??? ?this.id = id;
?? ?}

?? ?public String getPassword() {
?? ??? ?return password;
?? ?}

?? ?public void setPassword(String password) {
?? ??? ?this.password = password;
?? ?}

?? ?public String getName() {
?? ??? ?return name;
?? ?}

?? ?public void setName(String name) {
?? ??? ?this.name = name;
?? ?}

?? ?public String getPersonId() {
?? ??? ?return personId;
?? ?}

?? ?public void setPersonId(String personId) {
?? ??? ?this.personId = personId;
?? ?}

?? ?public String getEmail() {
?? ??? ?return email;
?? ?}

?? ?public void setEmail(String email) {
?? ??? ?this.email = email;
?? ?}

?? ?public double getBalance() {
?? ??? ?return balance;
?? ?}

?? ?public void setBalance(double balance) {
?? ??? ?this.balance = balance;
?? ?}

?? ?public int getType() {
?? ??? ?return type;
?? ?}

?? ?public void setType(int type) {
?? ??? ?this.type = type;
?? ?}

?? ?//存款
?? ?public Account deposit(double money ) {
?? ??? ?this.balance+= money; ? //余額增加
?? ??? ?return this;
?? ?}
?? ?
?? ?//取款
?? ?public Account withdraw(double money) {
?? ??? ?if(balance - money >= 0) { //判斷余額是否足夠
?? ??? ??? ?balance -= money; ?//余額減少
//?? ??? ??? ?System.out.println("存款成功");
?? ??? ?}
?? ??? ?else {
?? ??? ??? ?System.out.println("您的余額不足!");
?? ??? ?}
?? ??? ?return this;
?? ?}

?? ?//重寫(xiě)toString方法
?? ?@Override
?? ?public String toString() {
?? ??? ?return "Account [id=" + id + ", password=" + password + ", name=" + name + ", personId=" + personId + ", email="
?? ??? ??? ??? ?+ email + ", balance=" + balance + ", type=" + type + "]";
?? ?}? ?
?? ?
}

SavingAccount.java

package com.task1;

public class SavingAccount extends Account {

?? ?public SavingAccount() {
?? ??? ?super();
?? ??? ?// TODO Auto-generated constructor stub
?? ?}

?? ?public SavingAccount(long id, String password, String name, String personId, String email, double balance,
?? ??? ??? ?int type) {
?? ??? ?super(id, password, name, personId, email, balance, type);
?? ??? ?// TODO Auto-generated constructor stub
?? ?}

?? ?@Override
?? ?public String toString() {
?? ??? ?return "SavingAccount [getId()=" + getId() + ", getPassword()=" + getPassword() + ", getName()=" + getName()
?? ??? ??? ??? ?+ ", getPersonId()=" + getPersonId() + ", getEmail()=" + getEmail() + ", getBalance()=" + getBalance()
?? ??? ??? ??? ?+ ", getType()=" + getType() + "]";
?? ?}


}

CreditAccpunt.java

package com.task1;

public class CreditAccount extends Account{
?? ?private double ceiling;


?? ?public CreditAccount() {
?? ??? ?super();
?? ?}

?? ?public CreditAccount(long id, String password, String name, String personId, String email, double balance,
?? ??? ??? ?int type,double ceiling) {
?? ??? ?super(id, password, name, personId, email, balance, type);
?? ??? ?this.ceiling = ceiling;

?? ?}

?? ?public double getCeiling() {
?? ??? ?return ceiling;
?? ?}

?? ?public void setCeiling(double ceiling) {
?? ??? ?this.ceiling = ceiling;
?? ?}

?? ?@Override
?? ?public String toString() {
?? ??? ?return "CreditAccount [getCeiling()=" + getCeiling() + ", getId()=" + getId() + ", getPassword()="
?? ??? ??? ??? ?+ getPassword() + ", getName()=" + getName() + ", getPersonId()=" + getPersonId() + ", getEmail()="
?? ??? ??? ??? ?+ getEmail() + ", getBalance()=" + getBalance() + ", getType()=" + getType() + "]";
?? ?}

?? ?@Override
?? ?public Account withdraw(double money) {
?? ??? ?if(getBalance() >= money) {
?? ??? ??? ?setBalance(getBalance() - money);
?? ??? ?}else if(getBalance() + getCeiling() >= money) {
?? ??? ??? ?setCeiling(getCeiling()-(money-getBalance()));
?? ??? ??? ?setBalance(0);
?? ??? ?}else {
?? ??? ??? ?System.out.println("對(duì)不起,您的余額不足");
?? ??? ?}
?? ??? ?return this;
?? ?}??

?? ?
}

Bank.java

package com.task1;

import java.util.Scanner;

public class Bank {
?? ?int index = 0; //當(dāng)前用戶數(shù)量
?? ?Account [] accounts = new Account [100];//數(shù)據(jù)庫(kù)
?? ?Account account = null;
?? ?/*
?? ? * 用戶開(kāi)戶(register)
? ? ? 參數(shù)列表: Long 賬號(hào), String密碼, String確認(rèn)密碼,String 姓名,String身份證號(hào)碼,String郵箱,int 賬戶類型;

(Long id, String password, String repassword, String name, String personID, String email, int type)

? ? ? 返回類型:Account

? ? ? 規(guī)定賬戶類型:0 – 儲(chǔ)蓄賬戶 ?1 – 信用賬戶 2 – 可貸款儲(chǔ)蓄賬戶 3– 可貸款信用賬戶
?? ? */
?? ?//用戶開(kāi)戶
?? ?public Account register(Long id, String password, String repassword, String name, String personId, String email, int type) {

?? ??? ?if(password.equals(repassword)) { ?// 判斷兩次輸入密碼是否一致
?? ??? ??? ?switch (type) { ? ? ? ? ?//根據(jù)用戶類型創(chuàng)建不同賬戶
?? ??? ??? ?case 0:?
?? ??? ??? ??? ?account = new SavingAccount(id, repassword, name, personId, email, 0, type); ? //創(chuàng)建儲(chǔ)蓄賬戶
?? ??? ??? ??? ?
?? ??? ??? ??? ?break;
?? ??? ??? ?case 1:
?? ??? ??? ??? ?account = new CreditAccount(id, repassword, name, personId, email, 0, type,1000); ? //創(chuàng)建信用賬戶
?? ??? ??? ?}
?? ??? ??? ?accounts[index++] = account; ? ?//賬戶信息存到數(shù)據(jù)庫(kù),用戶數(shù)量+1
?? ??? ?}
//?? ??? ?else {
//?? ??? ??? ?System.out.println("兩次輸入的密碼不一致");
//?? ??? ?}
?? ??? ?return account;
?? ?}
?? ?
?? ?//用戶登錄
?? ?public Account login(Long id, String password) {
?? ??? ?int find = searchIdPassword(index, id, password); //當(dāng)前用戶數(shù)組下標(biāo)
?? ??? ?if(find >= 0) {?? ??? ??? ??? ??? ??? ?//判斷賬戶密碼是否正確
//?? ??? ??? ?System.out.println("登錄成功");
?? ??? ??? ?return accounts[find]; ? ? ? ? //返回當(dāng)前對(duì)象
?? ??? ?}
//?? ??? ?else {
//?? ??? ??? ?System.out.println("用戶名密碼錯(cuò)誤");
//?? ??? ?}
?? ??? ?
?? ??? ?return null;???//如果賬戶密碼錯(cuò)誤返回空
?? ?}
?? ?
?? ?//用戶存款
?? ?public Account deposit(Long id, double money) {
?? ??? ?int find = searchId(index, id);當(dāng)前用戶數(shù)組下標(biāo)
?? ??? ?if(find >= 0) {?? ??? ??? ??? ??? ??? ??? ?//判斷賬戶是否存在
?? ??? ??? ?accounts[find].deposit(money); ? ? ?//調(diào)用Account類的存款方法
//?? ??? ??? ?System.out.println("存款成功");
?? ??? ??? ?return accounts[find]; ? ? ? ? ? ? //返回當(dāng)前對(duì)象
//?? ??? ??? ?accounts[find].setBalance(accounts[find].getBalance()+money);
?? ??? ?}
//?? ??? ?else {
//?? ??? ??? ?System.out.println("用戶不存在");
//?? ??? ?}
?? ??? ?

?? ??? ?return null;???//如果賬戶不存在返回空
?? ?}
?? ?
?? ?//用戶取款
?? ?public Account withdraw(Long id, String password, double money) {
?? ??? ?int find = searchIdPassword(index, id, password);//當(dāng)前用戶數(shù)組下標(biāo)
?? ??? ?if(find >= 0) {?? ??? ??//判斷賬戶密碼是否正確
?? ??? ??? ?
?? ??? ??? ?accounts[find].withdraw(money);?? ??//調(diào)用當(dāng)前對(duì)象的取款方法?? ?
//?? ??? ??? ?System.out.println("取款成功");
?? ??? ??? ?return accounts[find];?? ?//返回當(dāng)前對(duì)象

?? ??? ?}
?? ??? ?return null;
?? ?}
?? ?//設(shè)置透支額度
?? ?public Account updateCeiling(Long id, String password, double money) {
?? ??? ?int find = searchIdPassword(index, id, password);//獲取當(dāng)前用戶數(shù)組下標(biāo)
?? ??? ?if((find >= 0) && (accounts[find].getType()) == 1){ ?//判斷賬戶號(hào)碼和密碼是否正確,賬戶類型是否為信用賬戶
?? ??? ??? ?((CreditAccount)accounts[find]).setCeiling(((CreditAccount)accounts[find]).getCeiling() + money); //調(diào)用set方法設(shè)置透支額度
?? ??? ??? ?return accounts[find];
?? ??? ?}
?? ??? ?return null;
?? ?}
?? ?
?? ?
?? ?// ?轉(zhuǎn)賬功能
?? ?// ?參數(shù):from轉(zhuǎn)出賬戶,passwordFrom 轉(zhuǎn)出賬號(hào)的密碼,to轉(zhuǎn)入賬戶,money轉(zhuǎn)賬的金額
?? ?public boolean transfer(Long from, String passwordFrom, Long to, double money) {
?? ??? ?int find = searchIdPassword(index, from, passwordFrom); //轉(zhuǎn)賬賬戶數(shù)組下標(biāo)
?? ??? ?int find2 = searchId(index, to); ? ? ? ? ? ? ?//收款賬戶數(shù)組下標(biāo)
?? ??? ?if(find >= 0 && find2 >= 0 && accounts[find].getBalance() >= money) { ?//判斷轉(zhuǎn)賬賬戶密碼、收款賬戶是否匹配,判斷轉(zhuǎn)賬用戶余額是否足夠
?? ??? ??? ??? ?accounts[find].withdraw(money);//轉(zhuǎn)賬用戶轉(zhuǎn)賬操作==取款
?? ??? ??? ??? ?accounts[find2].deposit(money);//收款用戶 == 存款
?? ??? ??? ??? ?return true;

?? ??? ?}?

?? ??? ?return false;
?? ?}
?? ?
?? ?//統(tǒng)計(jì)銀行所有賬戶余額總數(shù)
?? ?public double balanceSum() {
?? ??? ?double sum = 0; ? ? //初始化所有賬戶余額
?? ??? ?for(int i = 0; i < index; i++) { ?//遍歷數(shù)組
?? ??? ??? ?sum += accounts[i].getBalance();//求和(賬戶余額)
?? ??? ?}
?? ??? ?return sum;
?? ?}
?? ?
?? ?//統(tǒng)計(jì)所有信用賬戶透支額度總數(shù)
?? ?public double ceilingSum() {
?? ??? ?double sum = 0; ?//初始化所有透支額度和
?? ??? ?for(int i = 0; i < index; i++) { ?//遍歷
?? ??? ??? ?if(accounts[i].getType() == 1) { ?//判斷賬戶類型是否為信用賬戶
?? ??? ??? ??? ?sum += ((CreditAccount)accounts[i]).getCeiling(); //求和
?? ??? ??? ?}
?? ??? ?}
?? ??? ?return sum;
?? ?}
?? ?//搜索Id與密碼返回?cái)?shù)組下標(biāo)位置
?? ?public int searchIdPassword(int index, Long id, String password) {
?? ??? ?for(int i = 0; i < index; i++) {
?? ??? ??? ?if(id.equals(accounts[i].getId()) && password.equals(accounts[i].getPassword())){ ?//比較賬戶和密碼是否匹配
?? ??? ??? ??? ?return i ;?? //匹配則返回賬戶數(shù)組下標(biāo)
?? ??? ??? ?}
?? ??? ??? ?
?? ??? ?}
?? ??? ?return -1;?? ??//不匹配則返回-1
?? ?}
?? ?//搜索Id
?? ?public int searchId(int index, Long id) {
?? ??? ?for(int i = 0; i < index; i++) {
?? ??? ??? ?if(id.equals(accounts[i].getId())){ ? //比較賬戶是否匹配
?? ??? ??? ??? ?return i ;?? ??? ??? ??? ??? ??? ?//匹配則返回賬戶數(shù)組下標(biāo)
?? ??? ??? ?}
?? ??? ??? ?
?? ??? ?}
?? ??? ?return -1;?? ?//不匹配則返回-1
?? ?}
}

TestAccount.java

package com.task1;

public class TestAccount {

?? ?public static void main(String[] args) {

?? ??? ?Account a =new Account(123456L, "123456","張三", "421356", "tt@tt.com", 100.0, 0);
?? ??? ?System.out.println(a);?? ??? ?
?? ?}

}

TestBank.java

package com.task1;

import java.util.Scanner;

public class TestBank {

?? ?public static void main(String[] args) {
?? ??? ?Scanner sc = new Scanner(System.in);
?? ??? ?Bank bank = new Bank();
?? ??? ?String action =null;
?? ??? ?do {
?? ??? ??? ?System.out.println("菜單:");
?? ??? ??? ?System.out.println("---[1.開(kāi)戶]---");
?? ??? ??? ?System.out.println("---[2.登錄](méi)---");
?? ??? ??? ?System.out.println("---[3.存款]---");
?? ??? ??? ?System.out.println("---[4.取款]---");
?? ??? ??? ?System.out.println("---[5.設(shè)置透支額度]---");
?? ??? ??? ?System.out.println("---[6.轉(zhuǎn)賬]---");
?? ??? ??? ?System.out.println("請(qǐng)選擇服務(wù)");
?? ??? ??? ?int choice =sc.nextInt();
?? ??? ??? ?
?? ??? ??? ?switch(choice) {
?? ??? ??? ?
?? ??? ??? ??? ?case 1:?? ??? ??? ?//開(kāi)戶

?? ??? ??? ??? ??? ?System.out.println("請(qǐng)輸入賬戶號(hào)碼:");
?? ??? ??? ??? ??? ?Long id = sc.nextLong();
?? ??? ??? ??? ??? ?System.out.println("請(qǐng)輸入賬戶密碼:");
?? ??? ??? ??? ??? ?String password = sc.next();
?? ??? ??? ??? ??? ?System.out.println("請(qǐng)確認(rèn)賬戶密碼:");
?? ??? ??? ??? ??? ?String repassword = sc.next();
?? ??? ??? ??? ??? ?System.out.println("請(qǐng)輸入真實(shí)姓名:");
?? ??? ??? ??? ??? ?String name = sc.next();
?? ??? ??? ??? ??? ?System.out.println("請(qǐng)輸入身份證號(hào):");
?? ??? ??? ??? ??? ?String personId = sc.next();
?? ??? ??? ??? ??? ?System.out.println("請(qǐng)輸入電子郵箱:");
?? ??? ??? ??? ??? ?String email = sc.next();
?? ??? ??? ??? ??? ?System.out.println("請(qǐng)輸入賬戶類型:0 – 儲(chǔ)蓄賬戶 ?1 – 信用賬戶 2 – 可貸款儲(chǔ)蓄賬戶 3– 可貸款信用賬戶");
?? ??? ??? ??? ??? ?int type = sc.nextInt();
?? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ?Account a1 = bank.register(id, password, repassword, name, personId, email, type);
?? ??? ??? ??? ??? ?if(a1 != null) {
?? ??? ??? ??? ??? ??? ?System.out.println(a1);
?? ??? ??? ??? ??? ??? ?System.out.println("開(kāi)戶成功");
?? ??? ??? ??? ??? ?}else {
?? ??? ??? ??? ??? ??? ?System.out.println("兩次輸入密碼不一致");
?? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ?break;
?? ??? ??? ??? ?case 2:?? ??? ??? ?//登錄
?? ??? ??? ??? ??? ?System.out.println("請(qǐng)輸入賬戶號(hào)碼:");
?? ??? ??? ??? ??? ?id = sc.nextLong();
?? ??? ??? ??? ??? ?System.out.println("請(qǐng)輸入賬戶密碼:");
?? ??? ??? ??? ??? ?password = sc.next();
?? ??? ??? ??? ??? ?Account a2 = bank.login(id, password);
?? ??? ??? ??? ??? ?if(a2 != null) {
?? ??? ??? ??? ??? ??? ?System.out.println(a2);
?? ??? ??? ??? ??? ??? ?System.out.println("登錄成功");
?? ??? ??? ??? ??? ?}else {
?? ??? ??? ??? ??? ??? ?System.out.println("賬戶號(hào)碼密碼錯(cuò)誤");
?? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ?break;
?? ??? ??? ??? ??? ?
?? ??? ??? ??? ?case 3:?? ??? ??? ?//存款
?? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ?System.out.println("請(qǐng)輸入賬戶號(hào)碼:");
?? ??? ??? ??? ??? ?id = sc.nextLong();
?? ??? ??? ??? ??? ?System.out.println("請(qǐng)輸入存款金額:");
?? ??? ??? ??? ??? ?double money = sc.nextDouble();
?? ??? ??? ??? ??? ?Account a3 = bank.deposit(id, money);
?? ??? ??? ??? ??? ?if(a3 != null) {
?? ??? ??? ??? ??? ??? ?System.out.println(a3);
?? ??? ??? ??? ??? ??? ??? ?System.out.println("存款成功");
?? ??? ??? ??? ??? ?}else {
?? ??? ??? ??? ??? ??? ?System.out.println("賬戶不存在");
?? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ?break;
?? ??? ??? ??? ??? ?
?? ??? ??? ??? ?case 4:?? ??? ??? ?//取款
?? ??? ??? ??? ??? ?System.out.println("請(qǐng)輸入賬戶號(hào)碼:");
?? ??? ??? ??? ??? ?id = sc.nextLong();
?? ??? ??? ??? ??? ?System.out.println("請(qǐng)輸入賬戶密碼:");
?? ??? ??? ??? ??? ?password = sc.next();
?? ??? ??? ??? ??? ?System.out.println("請(qǐng)輸入取款金額:");
?? ??? ??? ??? ??? ?money = sc.nextDouble();
?? ??? ??? ??? ??? ?Account a4 = bank.withdraw(id, password, money);
?? ??? ??? ??? ??? ?if(a4 != null ) {
?? ??? ??? ??? ??? ??? ?System.out.println(a4);
?? ??? ??? ??? ??? ??? ?System.out.println("取款成功");
?? ??? ??? ??? ??? ?}else {
?? ??? ??? ??? ??? ??? ?System.out.println("賬戶號(hào)碼密碼錯(cuò)誤");
?? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ?break;
?? ??? ??? ??? ??? ?
?? ??? ??? ??? ?case 5://設(shè)置透支額度
?? ??? ??? ??? ??? ?System.out.println("請(qǐng)輸入賬戶號(hào)碼:");
?? ??? ??? ??? ??? ?id = sc.nextLong();
?? ??? ??? ??? ??? ?System.out.println("請(qǐng)輸入賬戶密碼:");
?? ??? ??? ??? ??? ?password = sc.next();
?? ??? ??? ??? ??? ?System.out.println("請(qǐng)輸入透支金額:");
?? ??? ??? ??? ??? ?money = sc.nextDouble();
?? ??? ??? ??? ??? ?Account a5 = bank.updateCeiling(id, password, money);
?? ??? ??? ??? ??? ?if(a5 != null ) {
?? ??? ??? ??? ??? ??? ?System.out.println(a5);
?? ??? ??? ??? ??? ??? ?System.out.println("設(shè)置透支額度成功");
?? ??? ??? ??? ??? ?}else {
?? ??? ??? ??? ??? ??? ?System.out.println("賬戶號(hào)碼密碼錯(cuò)誤或賬戶類型錯(cuò)誤");
?? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ?break;
?? ??? ??? ??? ??? ?
?? ??? ??? ??? ?case 6:// ?轉(zhuǎn)賬功能
?? ??? ??? ??? ??? ?System.out.println("請(qǐng)輸入轉(zhuǎn)賬賬戶號(hào)碼:");
?? ??? ??? ??? ??? ?Long from = sc.nextLong();
?? ??? ??? ??? ??? ?System.out.println("請(qǐng)輸入轉(zhuǎn)賬賬戶密碼:");
?? ??? ??? ??? ??? ?String passwordFrom = sc.next();
?? ??? ??? ??? ??? ?System.out.println("請(qǐng)輸入收款賬戶號(hào)碼:");
?? ??? ??? ??? ??? ?Long to = sc.nextLong();
?? ??? ??? ??? ??? ?System.out.println("請(qǐng)輸入轉(zhuǎn)賬金額:");
?? ??? ??? ??? ??? ?money = sc.nextDouble();
?? ??? ??? ??? ??? ?boolean flag = bank.transfer(from, passwordFrom, to, money);
?? ??? ??? ??? ??? ?if(flag) {
?? ??? ??? ??? ??? ??? ?System.out.println("轉(zhuǎn)賬成功");
?? ??? ??? ??? ??? ?}else {
?? ??? ??? ??? ??? ??? ?System.out.println("轉(zhuǎn)賬失敗");
?? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ?break;
?? ??? ??? ??? ?default:
?? ??? ??? ??? ??? ?System.out.println("服務(wù)選擇錯(cuò)誤");
?? ??? ??? ?}
?? ??? ??? ?System.out.println("是否繼續(xù)(y/n)?");
?? ??? ??? ?action = sc.next();
?? ??? ?
?? ??? ?}while("y".equals(action));
?? ??? ?
?? ??? ?double balanceSum = bank.balanceSum();
?? ??? ?double ceilingSum = bank.ceilingSum();
?? ??? ?System.out.println("銀行所有賬戶余額總數(shù):"+balanceSum);
?? ??? ?System.out.println("所有信用賬戶透支額度總數(shù)"+ceilingSum);
?? ?}

}

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

  • java實(shí)現(xiàn)根據(jù)ip地址獲取地理位置的代碼分享

    java實(shí)現(xiàn)根據(jù)ip地址獲取地理位置的代碼分享

    這篇文章主要介紹了java實(shí)現(xiàn)根據(jù)ip地址獲取地理位置的代碼分享,本文中使用的是QQ在線接口,也可以使用新浪、淘寶等提供的在線接口,需要的朋友可以參考下
    2014-08-08
  • ElasticSearch學(xué)習(xí)之文檔API相關(guān)操作

    ElasticSearch學(xué)習(xí)之文檔API相關(guān)操作

    這篇文章主要為大家介紹了ElasticSearch學(xué)習(xí)之文檔API相關(guān)操作,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2023-01-01
  • 一文帶你了解Java中的函數(shù)式編程

    一文帶你了解Java中的函數(shù)式編程

    函數(shù)式編程的理論基礎(chǔ)是阿隆佐·丘奇(Alonzo Church)于 1930 年代提出的 λ 演算(Lambda Calculus)。這篇文章主要為大家介紹了函數(shù)式編程的相關(guān)知識(shí),希望對(duì)大家有所幫助
    2023-04-04
  • Java生成隨機(jī)時(shí)間的簡(jiǎn)單隨機(jī)算法

    Java生成隨機(jī)時(shí)間的簡(jiǎn)單隨機(jī)算法

    今天小編就為大家分享一篇關(guān)于Java生成隨機(jī)時(shí)間的簡(jiǎn)單隨機(jī)算法,小編覺(jué)得內(nèi)容挺不錯(cuò)的,現(xiàn)在分享給大家,具有很好的參考價(jià)值,需要的朋友一起跟隨小編來(lái)看看吧
    2019-01-01
  • Springboot 如何指定獲取出 yml文件里面的配置值

    Springboot 如何指定獲取出 yml文件里面的配置值

    這篇文章主要介紹了Springboot 如何指定獲取出 yml文件里面的配置值操作,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2021-07-07
  • Java實(shí)現(xiàn)四連環(huán)棋游戲

    Java實(shí)現(xiàn)四連環(huán)棋游戲

    這篇文章主要為大家詳細(xì)介紹了Java實(shí)現(xiàn)四連環(huán)棋游戲,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2020-10-10
  • Mybatis Properties 配置優(yōu)先級(jí)詳解

    Mybatis Properties 配置優(yōu)先級(jí)詳解

    這篇文章主要介紹了Mybatis Properties 配置優(yōu)先級(jí),具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2021-07-07
  • Java四種線程池的使用詳解

    Java四種線程池的使用詳解

    本篇文章主要介紹了Java四種線程池的使用詳解,小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧
    2017-08-08
  • Java中Sentinel框架詳解

    Java中Sentinel框架詳解

    Sentinel是一個(gè)高可用、高擴(kuò)展、高穩(wěn)定性的開(kāi)源流量控制和熔斷降級(jí)框架,可以在分布式系統(tǒng)中實(shí)現(xiàn)實(shí)時(shí)的流量控制,防止系統(tǒng)因流量過(guò)大導(dǎo)致系統(tǒng)崩潰和服務(wù)降級(jí),Sentinel面向所有的Java應(yīng)用,本文就給大家詳細(xì)介紹一下Java中Sentinel框架,需要的朋友可以參考下
    2023-06-06
  • java springboot郵箱找回密碼功能的實(shí)現(xiàn)講解

    java springboot郵箱找回密碼功能的實(shí)現(xiàn)講解

    這篇文章主要介紹了java springboot郵箱找回密碼功能的實(shí)現(xiàn)講解,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2022-01-01

最新評(píng)論

临泽县| 鹤峰县| 广德县| 河南省| 蛟河市| 博客| 若尔盖县| 沅江市| 巫溪县| 南安市| 长沙县| 萝北县| 彭阳县| 理塘县| 尼玛县| 大渡口区| 泽库县| 五寨县| 天全县| 宜都市| 封开县| 云浮市| 西峡县| 永宁县| 元江| 和平县| 吐鲁番市| 河源市| 津南区| 陆河县| 武定县| 芷江| 安顺市| 广东省| 中牟县| 繁昌县| 普兰县| 芦溪县| 武鸣县| 南华县| 新密市|