Rental Log

The goal of this assignment is to create classes that have relationship(s) with other objects. In this assignment we will create classes that will help make a rental office track their tenants (Rental Log).

For this problem, a person will be specified by first name, middle initial, and last name, and an apartment is specified by a street, a street number, an apartment number, and a tenant.

  1. Define a Java class Person (Person.java) with
  2. Define a class Apartment (Apartment.java) with

Note: make sure that method name exactly correspond.

Here are some DrJava interactions with the classes

> Person a = new Person("Alice", 'Q', "Public");
> a.getLastName()
"Public"
> Person b = new Person("Bob", 'B', "Little");
> Apartment s = new Apartment("Spruce", 333, 2, a);
> s.tenant().getfirstName()
"Alice"
> s.changeTenant(b);
> s.tenant().getFirstName()
"Bob"