Practical 9
Practical 9
import java.util.Scanner;
class Customer {
this.customerName = customerName;
return customerName;
this.customerAge = customerAge;
return customerAge;
this.balance = balance;
double getBalance() {
return balance;
this.accountId = accountId;
int getAccountId() {
return accountId;
this.accountType = accountType;
String getAccountType() {
return accountType;
this.custobj = custobj;
Customer getCustomerObject() {
return custobj;
}
this.minimumBalance = minimumBalance;
return minimumBalance;
balance -= amount;
return true;
} else
return false;
class Bank {
c.setCustomerName(customername);
do {
customerage = sc.nextInt();
c.setCustomerAge(customerage);
a.setCustomerObject(c);
a.setAccountId(accountid);
a.setAccountType(accounttype);
a.setBalance(balance);
a.setMinimumBalance(minbalance);
return a;
}
void getWithdrawAmount() {
} else {
if (a.withdraw(amount) == true) {
} else
a.setBalance(bal);
SavingsAccount a;
do {
System.out.println("");
switch (choice) {
case 1:
a = bm.createAccount();
System.out.println("=================================================");
break;
case 2:
bm.displayAccountInformation();
System.out.println("=================================================");
break;
case 3:
bm.checkBalance();
System.out.println("=================================================");
break;
case 4:
bm.depositAmount(amount);
System.out.println("=================================================");
break;
case 5:
bm.getWithdrawAmount();
System.out.println("=================================================");
break;
case 6:
System.out.println("=================================================");
return;
default:
System.out.println("=================================================");
break;
} while (true);
}
Output:-