Create the java code for the project based on the requirements below. Leave me instructions as to what I need to change/do in order to make sure the code runs. I attached the project, rubric and checklist for what the instructor wants. If you need additional information, don't hesitate to reach out.
Programming Project 4
Assignment Requirements
:
Two documents are expected:
(1) One Java program containing all the code for the assignment. I do not accept multiple Java files in a single assignment folder and (2) a Test Plan document containing a table and screen captures
.
[Please review the information in the Project 4 Deliverables thread. All the attached files are there to aid in your skill development and enhanced knowledge.]
Caution
:
I often send feedback to you after reviewing your assignment. I always send it to your email account that UMGC has on record. It seems to happen often that the feedback email goes to SPAM. Please check your SPAM folder regularly to ensure you are not missing my communications. I expect a response to those emails that deal with feedback
The
fourth programming project
involves
writing one program
to manage a real estate database. This program should be comprised of an enumerated type, an interface, and two parts. The enumerated type should be named Status and should contain three enumeration literals, FOR_SALE, UNDER_CONTRACT and SOLD.
The interface should be a generic interface named
StatusChangeable
and it should have a bounded generic type parameter whose type must be an enumerated type. It should contain one abstract method
changeStatus
that has a parameter whose type is the generic type parameter.
The first part of the program is a class named
Property
. Among the processes are the implemented is the
StatusChangeable
interface. The elements for the property should contain variables:
The parcel id as integer
The property address stored as a string
The number of bedrooms stored as integer
The square footage stored as integer
The property price stored as integer
The status of the property whose type should be the enumerated type Status with the equivalent integers of 0, 1, and 2.
In addition, it should have the following three methods:
A
constructor
that accepts six parameters for the purpose of initializing the characteristics of the property, specifically
Parcel id
Property address
Number of bedrooms
Square footage
Property price
Status
The status of the property should be set to FOR_SALE (0).
A method named
changeStatus
that allows the status of the property to be changed.
An overridden
toString
method that returns a string containing the parcel id, property address, number of bedrooms, square footage, property price, and current status appropriately labeled.
The second part of the program is a Program Core and contains
the
main ()
method. In addition, it should contain a class variable for the Property class that defines the database of property records, which is implemented as a
HashMap, with the parcel id field (Integer) as the key and a Property object as the value. For consistency and feedback, there is a
PRJ4Property.txt
data file to use with this project that contains all the data necessary to begin the program. Directly read the data file (PRJ4Property.txt) into the program and assign the values to the HashMap. [In the program the name of the data file is entered with the relative path name, not the absolute path. See Note at end of this document for clarification.] For documentation, a Transaction array is declared to hold the processing implemented during the running of the program. Insert, delete, find, and change status are the transaction during the processing of the program. These are tags for each transaction followed by the appropriate information about the transaction. So, the fields in the Transaction array begin with the processing transaction, then the parcel id and the remaining values in the HashMap.
The data file is read into the program and assigned into a
HashMap. As each record is assigned, the program also displays the records of the data file using the toString() method in the IDE Output Window.
The program should generate the GUI shown below:
The default process is Find. The default Change Status is FOR_SALE. Clicking the
Process
button should cause the selected choice of the three actions in the combo box to its right [Find, Insert, Delete] to be executed. When using the insert process to add a new property, the program should check for any non-integer values that may have been entered in any of the fields that require integers.
The following error messages should display in a JOptionPane window:
After entering a number in the
Parcel ID
TextField if the number is not in the database a message stating that fact is displayed. The message should also display if the user clicks on the
Process
button before any value is entered in the
Parcel ID
.
When the
Process
button is clicked, the program checks that there is an integer for the
Parcel ID
in the database. When the Insert process is implemented, there is a check for integers in
Bedrooms
,
Square
Footage
, and
Property Price
TextFields. Each message references to a specific TextField.
If the user attempts to insert a Parcel ID, a key, that is already in the database.
If the user attempts to delete or find a record that is not in the database. [Related to #1.]
After each successful operation is completed a JOptionPane window displays confirming the success. In the case of a successful
Find
request, a window should pop up containing all the information in the associated Property object using the toString() method.
Clicking the
Change Status
button should cause status of the property associated with the designated
Parcel ID
to be changed to status selected in the combo box to its right. The
Change Status
should be implemented any time there is a parcel in the window. A JOptionPane window displays a confirmation of the change.
Include a
Clear
and an
Exit
button on the GUI Interface.
Each activity that the user performs is recorded in a Transaction array. The fields in the array include the transaction process, parcel id, property address, number of bedrooms, square footage, property price, and process/change of status activity.
When the program ends, there are two displays of information displayed in the IDE Output Window. The first set of data are the records in the Transaction array are displayed using the toString() method in the IDE Output Window following the
Transactions Completed
tag. [For each process action performed by the user, there is a transaction record.] After the transactions, the second set of data display the newly modified HashMap of the original set of data in the IDE Output Window tagged as
Modified Database
displayed using the toString() method on the Property objects. [See Output—edited below.]
Be sure to follow good programming style, which means making all instance variables private, naming all constants, and avoiding the duplication of code. Furthermore, you must select enough different kinds of shapes to completely test the program.
Note on difference between absolute and relative paths.
This is the absolute path
"C:\Users\Jones\Documents\CollegesUniversities\A UMUC\CMIS242\Assignments\Project 4\SPR 2020\PRJ4Property.txt"
This is the relative path:
"PRJ4Property.txt"
Output – Edited
Data file records
[Display the data read into the program in the IE Output Window. This is the display when the program begins executing.]
run:
Parcel ID: 7623
Property address: 563 Main St
Number of bedrooms: 4
Square footage: 2234
Property Price: 243212
Current status: UNDER_CONTRACT
Parcel ID: 8729
[Five lines removed for space considerations.]
Parcel ID: 7321
[Five lines removed for space considerations.]
Parcel ID: 3242
[Five lines removed for space considerations.]
Parcel ID: 9823
[Five lines removed for space considerations.]
Parcel ID: 2341
[Five lines removed for space considerations.]
Parcel ID: 8321
[Five lines removed for space considerations.]
Transactions Completed
[These are the various transactions processed while the program ran.]
[To check that the property does not yet exist, this check is processed.]
Find
Parcel ID: 8521
[Error message that ID not in database.]
[Adding a property to the database after checking that the Parcel ID does not yet exist in the database with the Find process, then using Insert process to add to the database.]
Find
Parcel ID: 9999
[Error message that ID not in database.]
Insert
Parcel ID: 9999
Property address: 14 Main Ave
Number of bedrooms: 5
Square footage: 3452
Property Price: 354500
Current status: FOR_SALE
[To check to confirm that the property was added, there is a check to display data.]
Find
Parcel ID: 9999
[Five lines removed for space considerations.]
[To change the status of a Parcel ID, use the Find process to enter the values of the Parcel ID that is being changed.]
Find
Parcel ID: 7623
Property address: 563 Main St
Number of bedrooms: 4
Square footage: 2234
Property Price: 243212
Current status: UNDER_CONTRACT
[To change the status of the property, have the parcel values in the window. Change the combo box status from UNDER_CONTRACT to SOLD. Click the
Change Status
button. Click the
Process
button – it is assumed that Find is still in the combo box.]
Find
Parcel ID: 7623
Property address: 563 Main St
Number of bedrooms: 4
Square footage: 2234
Property Price: 243212
Current status: SOLD
[To check that the property exits and can be deleted, there is a check to display the data using the Find process. Then selecting the Delete process, click on the
Process
button.]
Find
Parcel ID: 2341
[Five lines removed for space considerations.]
Delete
Parcel ID: 2341
Property address: 45871 Alpine Way
Number of bedrooms: 5
Square footage: 2850
Property Price: 385750
Current status: UNDER_CONTRACT
[A message confirms the removal. To check that the property was deleted, there is a check to display the data.]
Find
Parcel ID: 2341
[Message displayed that the Parcel ID does not exist.]
Modified Database
[The data in the file when the program ends.]
Parcel ID: 8321
Property address: 44 North Beach Cir
Number of bedrooms: 3
Square footage: 1750
Property Price: 215250
Current status: FOR_SALE
Parcel ID: 7623
[SOLD in Current status: line.]
[Five lines removed for space considerations.]
Parcel ID: 8729
[Five lines removed for space considerations.]
Parcel ID: 7321
[Five lines removed for space considerations.]
Parcel ID: 3242
[Five lines removed for space considerations.]
Parcel ID: 9823
[Five lines removed for space considerations.]
Parcel ID: 9999
[Added to file.]
[Five lines removed for space considerations.]
[Note Parcel No 2341 is not in above display – it was a deleted with a Delete process.]
BUILD SUCCESSFUL (total time: 2 minutes 12 seconds)