hi , i am looking for the same tutor from last assignment 1 and 2 to help me with my assignment 3 please, because all these 3 assignments have connection , thanks
Assignment 3 Version Number: 1.00 (July 14, 2020) Worth 4.0% of your total mark Assignment 3 Land Registry, Part 3 To be submitted online not later than Saturday, July 26, 2020, 11:59 p.m. Description: In this lab you’ll make changes to the Land Registry you built in Assignment 1 and augmented in Assignment II. Along the way, you’ll demonstrate your understanding of the following course learning requirements (CLRs), as stated in the CST8284—Object Oriented Programming (Java) course outline: 1. Write java code to implement exception handling (CLR VI) 2. Produce code that has been tested and executes reliably (CLR VIII) 3. Prepare program documentation using prescribed program specifiers, including JavaDoc (CLR IX) 4. Debug program problems using manual methods and computerized tools in an appropriate manner. (CLR X) 5. Identify appropriate strategies for solving a problem (CLR XI) Assignment 3 Page 1 Assignment 3 Land Registry, Part 3 Program Description In this assignment, you’ll document our code, explore exception handling, and tidy up the existing code in preparation for Assignment IV, when we’ll add a graphical front end to our application. For those students who failed to submit Assignment 2, you can use my starter copy, available on Brightspace, as the starting point for your Assignment 3 code. This code is provided ‘as is’; you are responsible for tidying up any bugs that may exist. But be certain to include in your Javadocs at the top of each class the line: @author: yourname, based on code supplied by Prof. Dave Houtman I. Load the Assignment2 project and copy your existing classes to the new Project a) In Eclipse, create a new project folder called CST8284_20S_Assignment3, copy the landRegistry package over from Assignment2 (including all its classes), and refactor the package name to reflect the change from the asgmt2 package to asgmt3. b) The UML diagram for this assignment is almost unchanged from the last assignment, except for the addition of some methods and classes noted below. As before, the principles of good code design still apply. So, at the marker’s discretion, you will lose marks for not implementing best practices such as, e.g. not using getters and setters (in particular, remember to use getRegControl() rather than rc), not chaining methods and constructors, not practicing code reuse, not employing the principle of least privilege in your code design, sloppy design that uses several lines of code where only a few are needed, etc. II. Add the following new features to your Land Registry Application a) Tighten up the existing code in preparation for the GUI interface in Assignment 4 You’ve added a few new features since Assignment 1, and refactored your code to use ArrayLists and File IO as well. Before you re- implement your Land Registry program as a GUI application, it’s crucial that you tidy up your program, which in many cases has grown to include some very messy code. This ‘house cleaning’ should be directed at the following areas: i) RegView methods handle console-based IO ONLY; RegControl methods NEVER request or output text. This has been stated before, but it needs to be reinforced, particularly with regards to the new RegControl File IO methods. If a RegControl method is successful, it returns true or an object, typically an ArrayList of Propertys or Registrants; if unsuccessful it return false or null. Under NO circumstance should your RegControl methods output text-based information to the console, much less print out the stack trace from an exception. For RegView, this means that whatever the operation of a ‘View’ method internally, it usually only has two things to decide: was the requested operation performed or not? If the former, the output message is something like: “method executed successfully”; if the latter, the message looks something like: “could not complete the request”. In a few rare cases, where the possible results of an operation can not be signaled by a simple binary response, we’ll throw an Exception, and let the handler deal with it. (For more on this subject, see section II.b). But for the most part, your code should be written in such a way that each of the eleven RegView ‘View’ methods uses an if…then… statement (or better still, a ternary ‘if’, when Assignment 3 Page 2 appropriate) to determine the String output from the method. Since a successful output often results in looping through an ArrayList to display its contents, add the private static method shown below to simplify data output. where the String output is just one long string built up using the toString() methods for each object in the ArrayList. (Note that ArrayList has a toString() method, inherited from its Collection class parent, which you can use to output the content of the displayList. However, the output is formatted in a peculiar way, and while you can use various String methods to excise the extra characters out of the output String, it’s generally to simpler to write a loop that uses each component object’s toString() to generate exactly the output you desire.) With the addition of this new method, along with the new RegControl methods listed below, you should be able to implement the logic code in each of the RegView methods in five concise lines of code or less (excluding the println() outputs that signal method completion, just mentioned above.) More than that, and your code is less efficient than it should be, and you need to rethink your approach to the logic. ii) In RegControl, add or revise the methods shown below to your existing code. The first two methods repackage the loadFromFile() method you wrote for Assignment 2, allowing you to offload much of the functionality (and clutter) that resulted in having to first delete and then reload the two ArrayLists from their files using just the public RegControl methods only. This should streamline your code considerably, not just in RegView, but in RegControl as well, since you can now deal with the two ArrayLists directly, using ArrayList’s native methods. Note however that code reuse is still expected; you should not be duplicating code that already exists elsewhere in RegControl. (And there are further restrictions imposed on your RegControl methods as well: see below.) The third method to add/revise is changePropertyRegistrant(). In this revised version, you read in an ArrayList of type Property, rather than a single Property. You then reset the regNum of each Property using the second parameter, and return the ArrayList of properties with the new regNum. The final alteration is to the listOfProperties() method, the one that lists all the properties with a particular regNum. In particular, your code should ensure that when a regNum of ‘0’ is passed to listOfProperties(), the method outputs an ArrayList of all the Properties. In short, it operates as before, but with the added feature that it calls listOfAllPropeties() whenever a regNum of ‘0’ is entered. We’ll put this new feature to use in Assignment 4. // add to existing methods -toString(ArrayList
displayList): String RegView // add the following two methods to RegControl +refreshProperties(): void +refreshRegistrants(): void // changed from the original +changePropertyRegistrant(ArrayList oldRegNumPropertyArrayList, int newRegNum): ArrayList // chain according to instructions +listOfProperties(regNum: int): ArrayList RegControl Assignment 3 Page 3 Just as there are limitations on the size of RegView’s methods, there are limitations on the eleven public RegControl methods used directly by RegView. They are: 1. Whenever you absolutely need to loop through an ArrayList (see below!), you must use the enhanced for loop (except for loadFromFile(), which can use while(true).); 2. You must (still) check for and remove null values returned by the listOfRegistrants() and the (revised) listOfProperties() methods; 3. You cannot use streams, or anything not already taught as part of the course. If you use any material obtained from a web site (e.g. the Oracle web site on ArrayList), you must provide an appropriate citation; 4. For the following five methods, you should only need to use a single loop to perform the method’s basic operations: loadFromFile saveToFile changePropertyRegistrant listOfProperties findRegistrant For the remaining six methods, you must not use a loop of any kind. In other words, you must only use existing methods, both those you have created yourself, and those that exist in the ArrayList class, to perform each operation—in short, code reuse. Marks will be deducted if these rules are not adhered to. b) Throw a BadLandRegistryException whenever there is bad data input Add a BadLandRegistryException class to your project, which should extend from RuntimeException. Add two constructors to your new class: a no-arg constructor and a two-String constructor, which passes both a header String along with a message String describing the exception and the action the user should take. Pass the message String to the superclass using super() (as you did in Lab 7) so that it will be returned when you call getMessage(). Store the header parameter in a private String field named header (which you’ll need to add to your new exception class, along with an appropriate getter and setter for it). Chain the no-arg BadLandRegistryException constructor to the 2-String constructor, passing the default message “Please try again” and the default header “Bad land registry data entered”. In your existing code, throw a BadLandRegistryException for each of