Untitled

 avatar
unknown
plain_text
2 years ago
1.0 kB
4
Indexable
// 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);
    }
}
Editor is loading...