Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
1.0 kB
1
Indexable
Never
// File: MyBank/Home.java
package MyBank;

public class Home extends Loan implements PrintDetails {
    private double propertyTax;

    public Home(double amount, double interestRate, int duration, double propertyTax) {
        super(amount, interestRate, duration);
        this.propertyTax = propertyTax;
    }

    public double getPropertyTax() {
        return propertyTax;
    }

    public void setPropertyTax(double propertyTax) {
        this.propertyTax = propertyTax;
    }

    @Override
    public double calculateLoan() {
        // Implement the calculation logic specific to Home loans
        // You can use the loan amount, interest rate, duration, and property tax to calculate the monthly cost
        // Replace the return statement with your actual calculation
        return 0.0;
    }

    @Override
    public void printDetails() {
        System.out.println("Home Loan Details:");
        super.printDetails();
        System.out.println("Property tax: " + propertyTax);
    }
}