Question
Create program for a small property management company to steam line their apartment rental process and keep track of available and leased apartments. Your program
Create program for a small property management company to steam line their apartment rental process and keep track of available and leased apartments. Your program will allow the following operations: This will be a loop.
Rent/Lease Apartment
Search Available Apartments
Make Apartment Available
List Available Apartments
List Rented Apartments
Display Tenant Information
Add New Apartment
exit press 8 and the user will exit. Create a program that when the user enters 8 they will exit the program
Note: Program should exit when the user enters 8.
Each apartment will have the following details: Apartment number, number of bedrooms, number of baths, rent amount, status (rented( R)or (a) available). Include apartment status. Set that to A. The program will contain a database (list) of all apartments. At startup, the program will populate the apartments database with 10 apartments. Details for the 10 apartments will be loaded from a file (students will need to create the file).
Once the program begins, the menu options will be displayed and the user will be prompted to enter an option
Menu options:
Rent/Lease Apartment: The user will be prompted to enter a minimum number of bedrooms required, a minimum number of baths required, and maximum amount of rent the user is willing to pay. The program will search the apartments database and display apartments that meet the users requirements. The user will be prompted to enter a number that corresponds to the apartment they will like to lease or -1 to return to the main menu. If the user decides to continue with the lease, the program will prompt the user for the following information: first name and last name. Once the users entry is complete, the program will create a tenant and add the tenant to the Tenants database. The selected apartment status must be changed to rented (R). If no apartment meets the user requirements, display an appropriate message and return the user to the main menu
Search Available Apartments: The user will be prompted to enter a minimum number of bedrooms required, a minimum number of baths required, and maximum rent amount the user is willing to pay. The program will display a list of available apartments that meet the users requirements. If the search result is 0, display an appropriate message. Return to the main menu
Make Apartment Available: User will be prompted for the apartment number. The program will search for the corresponding apartment. If the apartment is currently under lease, the program should change the apartment status to available and delete the current tenant from the Tenants database. If the apartment is not currently under lease, the program should display a message informing the user that the apartment is already available. If no apartment is found with the apartment number entered, the program displays an appropriate message.
List Available Apartments: Search the apartments database and display all available apartments
List Rented/Leased Apartments: Search the apartments and tenants databases and display details about each rented apartment (apartment number, number of bedrooms, number of baths, rent amount, tenant id, and tenant name)
Display Tenant Information: Prompt for the apartment number. If the apartment is found and under lease, display details about the current tenant. If the apartment is not currently under rent, the program should display a message indicating that the apartment is available for rent. If the apartment was not found with that number, display an appropriate message
Add New Apartment: The program will prompt for the apartment details (apartment number, number of bed rooms, number of baths, rent amount) and add the apartment to the apartments database. The status of a new apartment should be A
Exit: Display a summary report (total number of apartments, total number of apartments under lease, total number of apartments available, total number of tenants) and exit the program
Multiple modules will need to be created to facilitate the required functionality of the program.
A client module will be created for the program main logic.
A tenant module will contain tenant details.
A tenant database module will be used to keep track of tenants
An apartment module will be used for apartment details.
An apartment database will be used to keep track of leased and available apartments
Client module (client.py)
This module will be the gateway into the program. The logic in this module will allow the user to interact with the program and perform all required operations. All menu options will be accessible in this module. Classes created in other modules will mainly be instantiated in this module. Selection of a menu option will initiate call(s) to various class methods
Tenant Module (tenant.py)
This module will contain a class, Tenant. This class will contain attributes and methods for a tenant: tenant id (tenant_id), tenant first name (tenant_fName), tenant last name (tenant_lName), and apartment number (tanant_aptNum). This class will only contain get methods for the attributes. The constructor for this class will allow the first and last names and the apartment number to be passed as arguments. The values passed to the constructor will be used to initialize the class attributes: tenant_fName, tenant_lName, and tenant_aptNum. Tenant id will be a 5-digit integer generated in the class when the class constructor is called.
Note: Tenant id MUST NOT be passed as argument to the class constructor
Tenants database module (tenant_database.py)
This module will contain a class, Tenant_db. This class will be used to store all tenants. This class will include a list (tenants) as the tenants database. Each item in the list will be a Tenant object. The constructor for this class will take no arguments. Once an instance of the class is created, tenants will be initialized as an instance variable containing an empty list. The following methods will be included in the class:
addTenant: This method takes one parameter. When this method is called it will be passed a Tenant object. This method will add a tenant to the Tenant database. This method does not return a value
getTenant: This method takes an apartment number as parameter and returns the tenant associated with the apartment. If no tenant is found, the method returns a blank string
countTenants: This method takes no parameters. It returns the number of tenants in the Tenants database
removeTenant: This method takes the apartment number as a parameter. It deletes the tenant associated with the apartment number and returns the tenant. If no tenant is found, the method returns an empty string
getAllTenants: This method takes no parameters. It returns all tenant in the Tenants database
Apartment module (apartment.py)
This module will contain the Apartment class, Apartment. The following attributes should be included in this class: apartment number (apt_num), number of bedrooms (apt_bedrm), number of baths (apt_baths), rent amount (apt_rent), and apartment status (apt_status). There should be a set and get method for each apartment attribute. This class will be used to create apartments. The apt_status can be set to A or R. The constructor of this class should be called with argument for each attribute. The arguments passed to the class constructor should be used to initialize the class attributes. The apartment class will be used in the client module and the apartment database module
Apartment database module (apartment_db.py)
This module will include a class, Apartment_db. This class will be used to store and retrieve apartments and also perform rental operations. This class will contain an instance variable, apartments (list), which will be used to store the apartments details. The constructor of this class will take no arguments. Once an instance of the class is created, the apartments variable will be created as an empty list. The following methods should be included in this class:
addApartment: This method takes an apartment object as argument and add the apartment to the apartments list. Once the apartment is added, the method with print a message indicating the apartment was successfully added. This method does not return a value
getApartment: This method takes an apartment number as parameter and returns the apartment associated with the apartment number
getAvailApartments: This method takes no parameters. It returns all apartments with A status
getRentedApartements: This method takes no parameters. It returns all apartments with status equal to R
changeApartmentStatus: This method takes an apartment number and status value (R or A) as parameters. If the apartment is found, this method changes the status of the corresponding apartment. Status should be set to R if the apartment needs to be status as rented or A if the apartment needs to be made available. If the current status of the apartment is the same as the value passed, display a message indicating that the apartment status was not changed. If the apartment was not found, display a message that the apartment number is not valid. This method does not return a value
getTotalApartments: This method takes no parameters. It returns a count of the apartments in the database
getTotalAvailable: This method takes no parameters. It returns a count of the available apartments
getTotalRented: This method takes no parameters. It returns a count of rented apartments
loadApartments: This method takes a file as parameter. It loads apartments into the apartments database from a file. Each apartment will have a status of A. This method does not return a value
I need help on the client py.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started