Ritik
unknown
plain_text
2 years ago
2.1 kB
10
Indexable
package Deloitte.Daythree.basics;
public class Main {
public static void main(String[] args) {
Customer customer = new Customer(101, "A", "a@gmail.com");
SavingsAccount savingsAccount = new SavingsAccount(1001, customer, 5000.0, 1000.0);
double withdrawAmount = 2000.0;
boolean isWithdrawSuccessful = savingsAccount.withdraw(withdrawAmount);
System.out.println("Account Details:");
System.out.println("Account Number: " + savingsAccount.getAccountNumber());
System.out.println("Customer ID: " + savingsAccount.getCustomerObj().getCustomerId());
System.out.println("Customer Name: " + savingsAccount.getCustomerObj().getCustomerName());
System.out.println("Balance: " + savingsAccount.getBalance());
if (isWithdrawSuccessful) {
System.out.println("Withdraw of " + withdrawAmount + " successful.");
} else {
System.out.println("Insufficient balance for withdraw of " + withdrawAmount + ".");
}
}
}
package Deloitte.Daythree.basics;
public class Main {
public static void main(String[] args) {
Customer customer = new Customer(101, "A", "a@gmail.com");
SavingsAccount savingsAccount = new SavingsAccount(1001, customer, 5000.0, 1000.0);
double withdrawAmount = 2000.0;
boolean isWithdrawSuccessful = savingsAccount.withdraw(withdrawAmount);
System.out.println("Account Details:");
System.out.println("Account Number: " + savingsAccount.getAccountNumber());
System.out.println("Customer ID: " + savingsAccount.getCustomerObj().getCustomerId());
System.out.println("Customer Name: " + savingsAccount.getCustomerObj().getCustomerName());
System.out.println("Balance: " + savingsAccount.getBalance());
if (isWithdrawSuccessful) {
System.out.println("Withdraw of " + withdrawAmount + " successful.");
} else {
System.out.println("Insufficient balance for withdraw of " + withdrawAmount + ".");
}
}
}Editor is loading...