Description
CMSC203 Fall 2026 Assignment #4 focuses on developing a Property Management Application in Java using object-oriented programming principles. The assignment covers aggregation, arrays of objects, copy constructors, encapsulation, and JUnit testing. Students implement Property, ManagementCompany, and PropertyDriver classes to manage rental properties, calculate total rent, and support console-based and JavaFX interfaces.
Assignment Description
Design and implement a Property Management application in Java that manages multiple properties owned or managed by a company. The application will maintain an array of Property objects inside a ManagementCompany object (aggregation), support adding and listing properties, calculate total rent, include copy constructors, and provide both a console-based driver and a JavaFX GUI.
This assignment covers Chapters 1–7 and beyond the basics of classes: arrays of objects, aggregation, copy constructors, and simple unit testing with JUnit.
- A driver and utilities classes
- Aggregation
- Arrays
- Copy Constructors
- JUnit
|
Implement at least the following classes:
- Classes and Aggregation
- Property class: represents a single rental property.
- ManagementCompany class: contains an array of Property objects (aggregation) and related methods.
- PropertyDriver class (console driver with main).
- Property Class
- ManagementCompany Class
- Private fields:
- String name
- String taxId
- Property[] properties (fixed-size array, e.g., max 5).
- int propertyCount
- Constructors:
- Methods:
- int addProperty(Property p) – adds a property to the array (copy into the array) and returns index or error code if full.
- double totalRent() – returns sum of all property rents.
- int getPropertyCount() – returns current count.
- String toString() – summarizes company and its properties.
- Private fields:
- Driver Class (PropertyDriver)
- JUnit Tests
- Test Property constructors and copy constructor- Name: PropertyJUnitTestStudent.java
- Test ManagementCompany-Name: ManagementCompanyJUnitTestStudent.java
- adding properties,
- total rent.
- PropertyDrive-Name: PropertyDriverJUnitTestStudent.java
Use at least 4–5 test methods to validate behavior.
Screenshots for CMSC203 Pr4
Add Property:
====================================
Assignment 4: Property Manager
====================================
1 – Add Property
2 – Display All Properties
3 – Show Total Rent
4 – Exit
Enter choice (1-4): 1
Enter property name: Property-1
Enter city: Rockville
Enter monthly rent: 3500
Enter owner name: Joe
Property added at index 0.
Add another property:
====================================
Assignment 4: Property Manager
====================================
1 – Add Property
2 – Display All Properties
3 – Show Total Rent
4 – Exit
Enter choice (1-4): 1
Enter property name: Property-2
Enter city: Gaithersburg
Enter monthly rent: 2500
Enter owner name: Mary
Property added at index 1.
Display All Properties:
====================================
Assignment 4: Property Manager
====================================
1 – Add Property
2 – Display All Properties
3 – Show Total Rent
4 – Exit
Enter choice (1-4): 2
Management Company: Campus Realty (Tax ID: 123-45-6789)
Properties:
0: Property-1, Rockville, Rent: $3500.00, Owner: Joe
1: Property-2, Gaithersburg, Rent: $2500.00, Owner: Mary
Total Rent: $6000.00
Show Total Rent:
====================================
Assignment 4: Property Manager
====================================
1 – Add Property
2 – Display All Properties
3 – Show Total Rent
4 – Exit
Enter choice (1-4): 3
Total rent: $6000.00
Display menu again:
====================================
Assignment 4: Property Manager
====================================
1 – Add Property
2 – Display All Properties
3 – Show Total Rent
4 – Exit
Enter choice (1-4):
Test your program with at least 3 test cases. Make sure your tests cover all the possible scenarios. Refer to the Test Plan Guideline on how to write a Test Plan.
| Test Case # | Input | Expected Output
|
Actual Output
|
Did the test pass?
|
|
| 1 |
|
||||
| 2 | |||||
| 3 | |||||
|
|
Create a UML diagram for Assignment 4 based on the Assignment 4 Description given to you for each class. Be sure to show the relationship between classes
Deliverables / Submissions and Deliverable format:
- The Java application must compile and run correctly, otherwise project grade will be zero.
- The detailed grading rubric is provided in the assignment rubric excel file.
- Your source code should contain proper indentation and documentation.
- Documentation within the source code should include:
-
- additional Comments to clarify the code, if needed
- “Paragraph” comments at beginning of each method.
- class description comments at the top of each program containing the course name, the project number, your name, the date, and platform/compiler that you used to develop the project, for example:
/*
* Class: CMSC203
* Instructor:
* Description: (Give a brief description for each Class)
* Due: MM/DD/YYYY
* Platform/compiler:
* I pledge that I have completed the programming
* assignment independently. I have not copied the code
* from a student or any source. I have not given my code
* to any student.
Print your Name here: __________
*/
The deliverables will be packaged as follows. Two compressed files in the following formats:
- zip, a compressed file in the zip format, with the following:
- src folder:
- includes only .java files that you have modified or created.
- Word document that includes (use provided template):
- Screenshots:
- One screenshot of the application running from the command prompt.
- One screenshot of the application running in your IDE.
- Screenshot of Java file (Assignment4.java) in your GitHub
- Screenshots:
- src folder:
- Test Plan
- UML diagram
- Lessons Learned: Provide answers to the questions listed below:
- Write about your Learning Experience, highlighting your lessons learned and learning experience from working on this project.
- What have you learned?
- What did you struggle with?
- What parts of this assignment were you successful with, and what parts (if any) were you not successful with?
- Provide any additional resources/links/videos you used while working on this assignment/project.
- FirstInitialLastNamezip, a compressed file containing one or more Java files (This folder SHOULD NOT contain any folders and it should contain Java source files only):
.java files that you have modified or created.
Solution Overview
The solution addresses Java class implementation, property aggregation, deep copy constructors, fixed-size array management, property registration, rental income calculations, and property listing functionality. It also covers console-based menu operations, JavaFX GUI requirements, JUnit testing, UML class relationships, and test planning.


