CPT206 Computer Programming for Financial Mathematics: Coursework 3 Task Specification Thomas Selig Set: Wednesday, 3 May, 2023 Due date: Sunday, 21 May, 2023, 23:59 This is the specification task sheet for the Coursework 3 assessment component of your CPT206 module. The task covers all Learning Outcomes, and has a weighting of 70% towards the final grade for this module. This assignment has two parts: a coding part described in Section 1, and a report described in Section 2. The submission deadline for this assignment is Sunday, 21 May, 2023, at 23:59 . Detailed submission instructions are provided in Section 3. 1 Program description (65 marks) The aim of this coursework is to build a program to build a property portfolio management system. All the work should be coded into a single Java NetBeans project, with the class structure and different functionalities of the program described as follows. All classes should be properly encapsulated, as seen in the Lectures and Labs throughout the semester. Your project should also contain a Controller class for testing. You may leave some or all of your test code in the Controller class if you wish when submitting, but no marks are allocated for this class’s contents in your submission. Instead you will be asked to describe your testing in the report (see Section 2.2), and marked on that. 1.1 Property class (10 marks) The basic building block of the program will be a simple Property data class. A Property comprises of the following information. •A unique identifier. •A type or category: studio, appartment, or house. •A surface area or size, measured in square meters. For legal reasons, different types of properties have different allowable sizes (bounds included each time). Studios should measure between 10 and 20 m2, appartments between 15 and 150 m2, and houses should measure at least 50 m2. 1.2 MarketProperty class (16 marks) AMarketProperty is a Property that is currently on the market. As such, in addition to the property’s information from Section 1.1 above, a MarketProperty should store two prices, one indicating the initial pricing of the property (e.g. the value at which is was bought), and the 1 other indicating its current valuation. When a new MarketProperty object is created, its current valuation is set to its initial pricing. MarketProperty object should be compared according to their current valuation. The valuation of a MarketProperty can be updated according to the current market conditions, according to the following formula: Valnew= Val old/parenleftBig 1 +N(i,σ2)/parenrightBig , where: •Valnewis the new current valuation of the property (after update); •Valoldis its old valuation (before update); •iis the current market inflation rate; •σ2is a (positive) coefficient describing the volatility of the current market conditions; •N/parenleftbigi,σ2/parenrightbigis a Gaussian random variable with mean iand variance σ2. This process should be accomplished through an updateValuation() method, whose parameters are the inflation rate and volatility coefficient described above. Finally, there should be methods to calculate the total and relative profits that would be made if aMarketProperty were sold at its current valuation. The total profit is the difference between the current valuation and the property’s initial pricing, while the relative profit is the total profit divided by the initial pricing. 1.3 PropertyManagementCompany class (24 marks) Finally, your project should have a PropertyManagementCompany class, responsible for managing a property portfolio. A property portfolio is a collection of MarketProperty objects, maintained in order of their current valuations. A portfolio can only contain a given property (at most) once. You should choose a suitable data structure in the Java collection framework for storing the portfolio of a PropertyManagementCompany . Leave a comment in your code justifying your choice of data structure. A PropertyManagementCompany should also have a name, and an attribute measuring the company’s liquidity , i.e. amount of money currently held. It should be possible to create a PropertyManagementCompany with an empty portfolio initially, or to directly specify its portfolio. A property management company’s primary responsibility is to buy and sell (market) properties. •The company buys a property for a specified price. This property is then turned into a market property (with the initial pricing set to the previously specified price), and added to the company’s portfolio. The price paid is removed from the company’s liquidity. The sale can only take place if sufficient liquidity remains. •The company sells a market property at its current valuation. The proceeds from the sale are added to the company’s liquidity. •Before selling a property, the company may wish to check if it would be making sufficient profit from the sale. As such, there should be a getPotentialProfit() method that calculates how much profit1would be made from selling a given (market) property that is currently in the company’s portfolio. 1Here, we consider the total profit, as in Section 1.2. 2 •There should be methods to count the total number of properties in the portfolio and the number of properties in the portfolio whose current valuation is within a certain range (specified by lower and upper bounds). •Finally, there should be an updateAllValuations() method to simultaneously update the valuations of all properties in the company’s portfolio. 1.4 Code quality (15 marks) The remaining marks (15) will be awarded for the quality of your code, as covered throughout the semester in the Lectures and Labs. •Keep your code neat and tidy; make sure it is properly indented throughout. •Choose suitable names for variables and methods, respecting standard Java naming conventions. •Comment your code as needed. •Split your code into separate methods as appropriate; methods should not be too long. 2 Report (35 marks) For this part of the assignment, you will write a report detailing how you designed, implemented, and tested the program described in Section 1. The report should be typed into e.g. a Word document, and submitted as a PDF (see Section 3 for more details). 2.1 OOP features (12 marks) Over the course of the semester, you have learned a number of OOP features (e.g. encapsulation) and principles (e.g. single responsibility principle). In your report, you will explain where you have incorporated these in your design and how you have done so; include a brief definition of the features/principles in question. Be as precise as possible, illustrating with small portions of code if necessary. Note that not all the features and principles we saw in the lectures need to be incorporated into your design; your report should only discuss those that are. This section should be one-and-a-half to two pages in length. Good example: The Single Responsibility Principle states that every class in the program should have responsibility over a single functionality of the program; a class should do one thing. This principle is incorporated into our class design: all the classes have their own, separate, purpose. For instance, the Property class2... Bad example: Encapsulation and inheritance are two core features of OOP; they are used in many parts in my program. 2.2 Testing description (15 marks) As covered throughout the Lectures and Lab sessions in this module, testing is an essential part of writing computer programs. In your report, you will include a description of how you tested the various parts of the program described in Section 1. You will state clearly what functionalities you tested, and describe how you tested them, thinking carefully about possible corner cases. You may 2Give a brief description of the purpose of the Property class here. 3 include some sample code if you wish. You should test in the Controller class of your project, using only tools and techniques that we covered in the Lectures and Labs throughout the semesters. You must NOT use any new or more advanced tools such as JUnit that weren’t taught. This section should be one-and-a-half to two pages in length (screenshots excluded). 2.3 Improvements (8 marks) Finally, this program is, by necessity, a simplified model. In your critical evaluation document, you will list two (2) possible improvements to the system. These could be for instance additional features to be implemented, changes to existing features so that the system is a more accurate reflection of a real-world system, etc. Give a brief justification for why these would improve the system. This part should be no longer than one page in length. 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. This file will be named “CPT206 CW3 Project studentId.zip” . •Your report from Section 2, typed into e.g. a Word document, and converted into a PDF file. This file will be named “CPT206 CW3 Report studentId.pdf” . The submission deadline is: Sunday, 21 May, 2023, at 23:59 . 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 others3, 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 interview 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! 3The word “others” here includes generative AI tools such as ChatGPT. 4