Lab6 ProgamacionII
Lab6 ProgamacionII
Código Fuente:
package com.mybank.domain;
package com.mybank.domain;
Código Fuente:
package com.mybank.domain;
@Override
public void withdraw(double amount) {
if (amount > 0) {
if (balance < amount) {
double overdraftNeeded = amount - balance;
if (overdraftAmount < overdraftNeeded) {
System.out.println("Insufficient funds, withdrawal not allowed.");
} else {
balance = 0.0;
overdraftAmount -= overdraftNeeded;
}
} else {
balance -= amount;
}
} else {
System.out.println("Invalid withdrawal amount.");
}
}
}
Código Fuente:
package com.mybank.domain;
// Constructor
public Customer(String firstName, String lastName) {
this.firstName = firstName;
this.lastName = lastName;
this.accounts = new Account[10]; // Initialize the accounts array with a size of 10
this.numberOfAccounts = 0; // Initialize the numberOfAccounts to 0
}
// Getter methods
public String getFirstName() {
return firstName;
}
package com.mybank.report;
import com.mybank.domain.*;
public CustomerReport() {
}
Código Fuente:
package com.mybank.domain;
Código Fuente:
package com.mybank.batch;
import com.mybank.domain.*;