0% found this document useful (0 votes)
3 views4 pages

Java Classes

The document outlines a Rental House Management System implemented in Java, consisting of 15 classes such as Person, Landlord, Tenant, House, and Lease. It includes functionalities for managing tenants, landlords, houses, leases, rent payments, and maintenance issues. The Main class demonstrates the creation of objects and interactions between them, showcasing the system's capabilities.

Uploaded by

sheillakiprop1
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views4 pages

Java Classes

The document outlines a Rental House Management System implemented in Java, consisting of 15 classes such as Person, Landlord, Tenant, House, and Lease. It includes functionalities for managing tenants, landlords, houses, leases, rent payments, and maintenance issues. The Main class demonstrates the creation of objects and interactions between them, showcasing the system's capabilities.

Uploaded by

sheillakiprop1
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

SOFTWARE ENGINEERING 2.

KIT/100/24: Charity Agosa Orindo.

Rental House Management System (15 Java Classes)


1. [Link]
public class Person {
protected String name;
protected String phone;

public Person(String name, String phone) {


[Link] = name;
[Link] = phone;
}

public void displayInfo() {


[Link]("Name: " + name + ", Phone: " + phone);
}
}

2. [Link]
public class Landlord extends Person {

public Landlord(String name, String phone) {


super(name, phone);
}
}

3. [Link]
public class Tenant extends Person {
private String tenantId;

public Tenant(String name, String phone, String tenantId) {


super(name, phone);
[Link] = tenantId;
}

public String getTenantId() {


return tenantId;
}
}
4. [Link]
public class House {
private String houseNumber;
private boolean occupied;

public House(String houseNumber) {


[Link] = houseNumber;
[Link] = false;
}

public boolean isOccupied() {


return occupied;
}

public void setOccupied(boolean status) {


[Link] = status;
}

public String getHouseNumber() {


return houseNumber;
}
}

5. [Link]
public class Apartment {
private String apartmentName;

public Apartment(String apartmentName) {


[Link] = apartmentName;
}
}

6. [Link]
public class Lease {
private Tenant tenant;
private House house;
private int durationMonths;

public Lease(Tenant tenant, House house, int durationMonths) {


[Link] = tenant;
[Link] = house;
[Link] = durationMonths;
[Link](true);
}
}
7. [Link]
public class Rent {
private double monthlyRent;

public Rent(double monthlyRent) {


[Link] = monthlyRent;
}

public double getMonthlyRent() {


return monthlyRent;
}
}

8. [Link]
public class Payment {
private double amount;
private String date;

public Payment(double amount, String date) {


[Link] = amount;
[Link] = date;
}
}

9. [Link]
public class Receipt {
public void printReceipt() {
[Link]("Payment received. Receipt generated.");
}
}

10. [Link]
public class Maintenance {
private String issue;

public Maintenance(String issue) {


[Link] = issue;
}
}
11. [Link]
public class Caretaker extends Person {

public Caretaker(String name, String phone) {


super(name, phone);
}
}

12. [Link]
public class Utility {
private String utilityType;

public Utility(String utilityType) {


[Link] = utilityType;
}
}

13. [Link]
public class Notice {
private String message;

public Notice(String message) {


[Link] = message;
}}
14. [Link]
public class Report {
public void generateReport() {
[Link]("Rental report generated.");
}}
15. [Link]
public class Main {
public static void main(String[] args) {

Landlord landlord = new Landlord("Mr. Otieno", "0712345678");


Tenant tenant = new Tenant("Kytes", "0798765432", "T001");
House house = new House("H12");

Lease lease = new Lease(tenant, house, 12);


Rent rent = new Rent(15000);

[Link]();
[Link]();

[Link]("House " + [Link]() +


" occupied: " + [Link]());
[Link]("Monthly Rent: KES " + [Link]());
}
}

You might also like