Best writers. Best papers. Let professionals take care of your academic papers

Order a similar paper and get 15% discount on your first order with us
Use the following coupon "FIRST15"
ORDER NOW

Write a 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.

Write a 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 of 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:

1.   The parcel id as integer
2.   The property address stored as a string
3.   The number of bedrooms stored as integer
4.   The square footage stored as integer
5.   The property price stored as integer
6.   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:

1.   A constructor that accepts six parameters for the purpose of initializing the characteristics of the property, specifically

a.   Parcel id
b.  Property address
c.   Number of bedrooms
d.  Square footage
e.  Property price
f.   Status

The status of the property should be set to FOR_SALE (0).

2.   A method named changeStatus that allows the status of the property to be changed.
3.   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 the 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.] For documentation, a Transaction array is declared to hold the processing implemented during the running of the program: insert, delete, find, and change status. 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 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:

1.   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.
2.   When the Process button is clicked, the program checks that there is an integer for the Parcel ID. When the Insert process is implemented, there is a check for integers in Bedrooms, Square Footage, and Property Price TextFields.
3.   If the user attempts to insert a Parcel ID, a key, that is already in the database.
4.   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 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.

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)

 
Looking for a Similar Assignment? Order now and Get 10% Discount! Use Coupon Code "Newclient"