Assignment 2
Semester 2, 2014
Assignment Overview:
This assignment requires you to complete various tasks involving classes that are provided to you as a basic structure for building upon. You may also use classes that you find in the SDK. You will write your own class(es) that will create a GUI using the swing library. The focus of Assignment 2, is your development of a GUI using java swing packages, which is why you are being provided with some classes already written.
You will be required to develop your application using Java in the Eclipse environment. You will need to zip the whole project up when you are finished and submit it on Moodle by the due date. You will also need to submit a report (both electronically in Moodle and as a hard copy (consult your tutor to see if hardcopy is required)). The report will require some written and diagrammatic information describing your system as well as addressing documentation, design and testing requirements which will be outlined in the various tasks. Please write clearly and IN YOUR OWN WORDS (plagiarism is NOT acceptable – refer to Course Description). It is expected that no submissions will be identical, so ensure that your GUI has some unique elements to it. Be creative!
It is expected that each student will creatively design and author a unique system based on individual choices that fit with the requirements listed in each task. Before you begin, read over the entire assignment and understand all the tasks. You are to make use of the provided code files, but must additionally write your own classes. Acknowledge all code that you do not write yourself (but include in the classes you add), with in-code comments.
All code must conform to stylistic standards including proper commenting, appropriate choice of identifier names, proper indenting and other readability issues. Otherwise, marks will be deducted. Consult http://www.oracle.com/technetwork/java/codeconventions-150003.pdf
Your tutor may require you to demonstrate your GUI during a lab class in week 11.
Contextual/Background Information:
For this assignment, you will create a Graphical User Interface that provides the user with access to the functionality of a Real Estate Management System. Such a system would typically be used by a Real Estate Agency to help manage the details of its clients, which include both landlords and tenants. This section of the Assignment explains the roles of these clients, and the behaviour that the system should allow.
When a property owner has a house/property that they wish to make available to other people to possibly live in, they will typically go to a Real Estate Agency to enlist their services. The services include helping to find a suitable person/family to be tenants who will pay rent for the privilege of living in the house. Other services of the agency include collecting the rent, and managing other legal obligations regarding the property.
The agency will first advertise the availability of properties to the general public. Interested people can request to look at the property, and then if they like a property, they can submit an application to rent the property. Once approved by the landlord, the interested person signs a lease, which is a formal contract to commit to paying the weekly rate of rent to the agency, for use of the property. The tenant must pay for whole weeks at a time, but can make payments in advance.
Sometimes during a lease period, there may be some need for maintenance/repairs to be done on properties, in which case, the Agency will arrange the maintenance to be done but then deduct the cost from the next monthly payment to the landlord. For example, maybe the children were not playing carefully and smashed a window – requiring it to be replaced. Or maybe the hot-water service stops working and needs to be replaced.
(You can assume that the total cost of all repairs is always below the total rent collected).
Provided Files:
You are being provided with a few code files which contain the basic essence of the data management aspects of the system, but need to write classes to provide a graphical user interface. The following is a description of the provided classes:
If you feel you need to add additional methods to any of the provided classes, you may, but need to include in your documentation an explanation of the reason for adding the new methods.
Required behaviours in the final system
The following are the behaviours (functionality) which the user should be able to accomplish by using the completed program:
The user needs to be able to enter the details about a new landlord. This means that the program will present a screen asking for the following information about the landlord, to then store in memory:
Provided that all the above information is correctly given by the user, the program should proceed to create a new Landlord that is stored in the system.
Initially, a landlord will not be associated with any properties or leases until the user adds the details.
The user needs to be able to enter the details (i.e. the street address) about a new Property and choose an existing Landlord as the recorded owner of the property. You must design an appropriate mechanism by which the user can enter this information, such that the property is initially considered as available for leasing.
The user needs to be able to create new leases in the system. They should be presented with a list of all the available properties (i.e. ones that do not have a current lease), so the user can select which one to make the lease for. The program should then be able to enter all remaining details about the lease such as the tenant name, the weekly rent amount, whether it is a 6 or 12 month lease. The new lease should be recorded in the system, so that it could be used in the ‘pay rent’ behaviour. As lots of information is needed for this, and sometimes there are specific values that are valid, think carefully about which components are best to reduce the chance of erroneous input and explain your decisions in the supplementary documentation that you submit.
From time to time, the tenants will come to pay their rent. It is assumed that when they make payments, they will pay for whole weeks only. The program should allow the user to easily select which property the payment is for (possibly including specifying the landlord who owns the property). It should also ask how many weeks is being paid for. If the user enters a number that is greater than the number of weeks remaining on the lease, this should generate an error message rather than do any calculations. But if a sensible value is entered, this payment should be recorded, and the program should generate a message saying how many weeks still remain to be paid on the lease, if any.
Sometimes there will be a need for repairs or other works to be done to the property to keep it liveable for the tenants, for example, maybe the water heating device breaks and needs to be replaced. The program needs to allow the user to select a property (that has an active lease), and to specify the cost and description of a maintenance task. It is possible there could be multiple maintenance tasks during the period of a single lease.
The program should allow the user to select a landlord to produce a report (in a text-based component) about their net income for each of their properties, and to list the properties that are not currently leased. By net income is meant the amount left over after deducting the maintenance costs from the amount of rental income received during the particular lease.
This report should show the following information about each of the landlord’s properties:
For the list of maintenance, include both the cost as well as the description of the maintenance that was performed.
The following is an example of what may be displayed for the landlord named “Fred Flintstone” who has 2 properties leased to tenants, and another property that currently does not have a tenant.
Report for Landlord: Fred Flintstone
Property: 53 Spring St, Northland
Weekly Rental Rate: $240
Tenant: Donald Duck
6 Month Lease (20 remaining payments)
Maintenance History:
$800 new Hot Water Service
$140 Glass Window Repairs
Total Earnings: $500
Property: 107 Bedrock Avenue, Bedrock
Not currently leased
Property: 72 Long St, Westfield
Weekly Rental Rate: $685
Tenant: Clive Palmer
12 Month Lease (49 remaining payments)
Maintenance History:
None so far
Total Earnings: $2055
End of report for Fred Flintstone
Tasks to complete in your submission
Task 1 Designing and Documenting your system
GUI Design
Draw a schematic picture of your GUI design. On your diagram, highlight where you intend each panel to be and the contents of each panel (e.g. buttons, lists, radio buttons, labels). Where you have content to be displayed based on an object in your code, note this on your diagram. Also, indicate the events you expect your GUI to respond to and what happens following each event. For example, “when the button <XXX> is pressed, this event will trigger a call to method <YYY> which will perform a calculation using the values selected in the list and display the result in the text field in the center panel.”
Testing
As you develop your GUI classes and methods, you will write testing scenarios to verify that your code is working correctly. In this section, you will describe your chosen test data and explain how that data helps you test your code. Make sure that you choose a variety of test cases to ensure you can be satisfied that your code is working. Include screen shots of your testing results in this section.
Task 2 Creating your GUI
Using Eclipse, study the provided files, and add classes of your own, to make a functioning GUI-based program that achieves the behaviours outlined earlier in this document. In particular:
class MySystemGui
You should aim to write code following high quality coding practices, including comments, trapped exceptions and exhibiting good design where code is separated into separate methods
Warning. In this task you are not allowed to use designer (drag and drop) tools provided by Eclipse or other IDEs. The whole program must be written manually. Failing to do so will result in no marks for the whole assignment.
Task 3 (ITECH 6100 students only)
Using examples from your own code, write half a page (at least 250 words) explaining the JFrame class in simple terms and each of the methods that you have used. Describe what an interface means and how you have in your assignment implemented an interface.
Allocated Marks: See Course Description
Due Date: See Course Description
Please refer to the Course Description for information relating to late assignments and special consideration.
Plagiarism:
Please refer to the Course Description for information regarding Plagiarism.
Assignment Submission:
Assignments must be submitted by the due date and your assignment should be completed according to the General Guidelines for Presentation of Academic Work (http://www.ballarat.edu.au/aasp/student/learning_support/generalguide/) and programming standards (http://www.oracle.com/technetwork/java/codeconventions-150003.pdf).
The following criteria will be used when marking of your assignment:
You are required to provide the following documentation:
In addition to submitting a printed copy of your written report into your tutor’s assignment box (consult with your tutor if hardcopy is required), you should also submit the following using Moodle:
Student ID:________________ Student Name:_____________
Task 1 | 10 |
GUI Design and description | 5 |
Testing Description and results | 5 |
Task 2 | 30 |
Behaviors:
|
|
Implementation requirements:
|
|
Task 3 (ITECH6100 students only) | 10 |
Appropriate referencing of other documents, websites, or written sources | 2 |
Use of appropriate examples from code authored by student in this assignment | 3 |
Clear and well expressed explanation | 5 |