CPT206 Java Programming for Financial Mathematics:

Coursework 3 Task Specification

Thomas Selig

Due date: Sunday, 30 May, 2021, 10pm


        This is the specification task sheet for the Coursework 3 assessment component of your CPT206 module. This is worth 30% of your final grade for this module. The submission deadline for this assignment is Sunday, 30 May, 2021, at 10pm. Detailed submission instructions are provided in Section 3.


1 Task specification

You are the proud owner of a property portfolio, i.e. a group of properties (houses, apartments, etc.). You manage these properties in a variety of ways: renting them out to customers, selling some, acquiring others, and so on.

        The list of properties that you own is provided in a “properties.csv” data file. Each line of data in this file contains the information of one of your properties. In order, a line contains: an ID number for the property, the type of property, its location, its surface area (in square meters), the monthly rental price, the property’s current status (occupied or available), and its selling price. For instance, the following line of data:

138275, apartment, Suzhou, 102, 6000, occupied, 800000 represents the property with the following attributes:

ID number:     138275

Type:              apartment

Location:         Suzhou

Surface area:   102 m2

Monthly rent:   6,000 RMB

Status:            occupied

Selling price:    800,000 RMB

        Your task is to design and implement a Java application that will help you manage your portfolio. The application will be interactive via a text-based user interface.


1.1 Start-up menu (10 marks)

Your main program should do two things on launching.

1. Load the data in the “properties.csv” file into memory. The entire dataset should be loaded into appropriate data objects. (5 marks)

2. Open a command-line (text-based) user interface, offering the choice of two options:

• view property information;

• sell a property.

The interface should close and the program exit once the user has completed one of the two above requests. (5 marks)


1.2 Viewing property information (20 marks)

If the user chooses to view property information, they should be able to filter the properties they wish to view according to one or more of the following criteria.

• Filter by status: the user may wish to only view properties that are either occupied or available. (5 marks)

• Filter by monthly rent: the user may wish to only view properties whose monthly rental amount is within a certain range; this range should be chosen by the user. (5 marks)

• Filter by location: the user may wish to only view properties in a certain location; this location should be chosen by the user. (5 marks)

        The list or properties which match the filtering request(s) made by the user should then be displayed on the output console, in a neat and informative manner. The displayed list should be sorted in increasing order of monthly rental amount. (5 marks)


1.3 Selling a property (10 marks)

If the user chooses to sell a property, the program should prompt them to select which property they wish to sell. (5 marks)

        The program should then produce an offer to buy the selected property. For modelling purposes, this should be done by generating a random amount worth between 90% and 100% of the property’s selling price. For instance, for a selling price of 800,000 RMB, the offer should be between 720,000 and 800,000 RMB. This offer should be shown to the user, who may then choose to accept it, or reject it. If they accept, the property is sold, and removed from their portfolio. (5 marks)


1.4 Data records (10 marks)

When the user exits the program, their operations should be saved to an output text file. This file should record which operation the user chose (view property information or sell a property), and the details of that operation.


2 General quality

The remaining marks (50) will be awarded for the overall quality of your user interface, as well as for code quality and the use of an appropriate class structure.


2.1 User interface quality and input validation (15 marks)

• Your user interface should be user friendly and easy to navigate. It should give clear and detailed instructions and guidance for what is expected in terms of user input. Information that is displayed should be done so in a neat and clear manner.

• All user input must be validated. Bad input should not cause the program to crash. White spaces before and after input should be tolerated; input should not be case-sensitive.


2.2 Code quality and class structure (35 marks)

• Keep your code neat and tidy; make sure it is properly indented throughout.

• Choose suitable names for variables and methods.

• Comment your code as needed.

• Split your code into separate methods as appropriate; code in the main method should be kept to a minimum; methods overall should not be too long.

• You should also design your program carefully to ensure an appropriate class structure, with suitable data objects and utility classes.


3 Submission instructions

In the dedicated “Coursework 3 submission” Assignment activity on the Learning Mall Online, you will need to submit the following two (2) documents.

• A single ZIP archive of your entire Netbeans project. Include all the resources your project needs to run. Make sure this is a ZIP archive, not RAR. This file should be named “CPT206_CW3_Project_studentId.zip”.

• A plaintext .txt file, into which you have copied the source code of the class which you used to code the user interface. This file should be named “CPT206_CW3_UI_studentId.txt”.

The submission deadline is: Sunday, 30 May, 2021, 10pm.

        This assignment is individual work. Plagiarism (e.g. copying materials from other sources without proper acknowledgement) is a serious academic offence. Plagiarism and collusion will not be tolerated and will be dealt with in accordance with the University Code of Practice on Academic Integrity. Submitting work created by others, whether paid for or not, is a serious offence, and will be prosecuted vigorously. Individual students may be invited to explain parts of their code in person during a dedicated BBB session, and if they fail to demonstrate an understanding of the code, no credit will be given for that part of the code.

        Late submissions. The standard University policy on late submissions will apply: 5% of the total marks available for the component shall be deducted from the assessment mark for each working day after the submission date, up to a maximum of five working days, so long as this does not reduce the mark below the pass mark (40%); submissions more than five working days late will not be accepted.

        This is intended to be a challenging task, and quite a step up from what you have been doing so far, so think about things carefully. We can - and will - discuss some aspects in the Lab sessions, and of course, as usual, you can ask me anything by email, during Office Hours, or in the LMO Forums. Good luck!