Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

Assignment 1 Assignment 1 Land Registry To be submitted online not later than Monday, June 22nd, 2020, 11:59 p.m. Description: The purpose of this project is to build a land registry, that is, an...

1 answer below »
Assignment 1
Assignment 1
Land Registry
To be submitted online not later than Monday, June 22nd, 2020, 11:59 p.m.
Description:
The purpose of this project is to build a land registry, that is, an application that allows
a user to register a piece of land of a requested size and location. This first assignment
focuses on a
ays of objects, chaining, overloading, and getters/setters. It will evolve
further as we add new features in Assignments 2, 3, and 4 as your understanding of Java
increases. In building this application, you will demonstrate your understanding of the
following course learning requirements (CLRs), as stated in the CST8284—Object
Oriented Programming (Java) course outline:
1. Install and use Eclipse IDE to debug your code (CLR 1)
2. Write java programming code to solve a problem, based on the problem
context, including UML diagrams, using object-oriented techniques (CLR II)
3. Use basic data structures (CLR III), including implementing a
ays of primitive
and reference types
4. Implement program Input/Output operations (CLR V)
5. Debug program problems using manual methods and computerized tools in an
appropriate manner. (CLR X)
6. Identify appropriate strategies for solving a problem (CLR XI)
Worth
7.5%
of your total
mark
Version Number:
1.13 (June 15, 2020)
 Assignment 1
 Page 1
Assignment 1
Land Registry
Program Description

This application allows the user to store and retrieve
property information loaded in a land registry. (A land
egistry allows a governments and organizations to
ecord and track land ownership.) It includes such
information as the dimensions and location of each
property, the ownership of the property (which
could be an individual or an organization), the stated
purpose of the property (which could be industrial,
agricultural, commercial, recreational …etc), and the
annual taxes to be paid.
In this early version of the program, our registry is
somewhat basic. However, it will grow in size and
functionality as we add new features to it in
Assignments 2, 3 and 4. To keep the coding simple, a
number of assumptions have been made:
1. Each property is rectangular in shape. That is,
it has a length and width. Additionally, each
property has a top and left position,
co
esponding to the coordinates of the top
left corner of the property;

2. A property cannot be registered (that is,
loaded into an a
ay of properties) unless it has
a registration number (or regNum for short).
Each registration number is tied to a Registrant
object, which is a registered person or
organization to whom a unique number is
assigned. Like the properties, each Registrant
object is stored in its own a
ay. (Both a
ay
sizes will be kept deliberately small, to help
with debugging.
3. For now, the size of these two a
ays is
limited—this helps with testing. We’ll increase
these sizes in a later assignment when we
eplace each a
ay with an A
ayList. For the
present, size your a
ays using the values
indicated in this document, as indicated below.

4. The total size of the space available for
property registration is 1000 m X 1000 m.
Since all measurements will be recorded in
metres, a valid property location and
dimension can be any value between 0 and
1000.

5. The minimum size of any allowed property has
dimensions 20 X 10, i.e. a length of 20 m and a
width of 10 m—big enough to fit a reasonably
large house. The coordinates of a new
property can be anywhere inside the 1000 m X
1000 m area available, provided it does not
overlap with an existing property already
egistered.
I. Create the Project, package and classes

a. In Eclipse, create a new project called
CST8284_20S_Assignment1. To this project
add a package called
cst8284.asgmt1.landRegistry. Then,
following the UML diagram below, add each of the
classes indicated to this package.

Note
The term ‘property’ has a number of different
meanings in English. In this document, a reference to
a property will usually mean an instance of the
Property class, that is, an abstract representation,
in code of a piece of land having such features as size,
location, and ownership. The term should not be
confused with the property of an object, which
means something totally different. For the most
part, the meaning of the term ‘property’ should be
clear from the context. To avoid confusion, we’ll
efer to an object’s properties when we’re talking
about the properties of an object in general; when
the word ‘property’ is used by itself, it means an
instance of the Property class, described below.
Note also, Java has its own Properties class (in the
java.utils.* package); be certain that Eclipse does not
attempt to import and use this class in place of your
Property class which you’ll create in the
cst8284.asgmt1.landRegistry package.
 Assignment 1
 Page 2
. Before you proceed to the details of each class in
Section II, note the following rules about this
assignment, which must be strictly adhered to:
1. Follow the UML diagram exactly as it is written,
according to the most up-to-date version of
this document. You cannot add members that
are not written in the UML diagram, nor can
you neglect any of them either—and this
applies to features that don’t appear to have
any use in your code (at present; on this note,
e sure to read item (2) below). If it’s written
in the UML, it’s not optional: write the code you’re
directed to write, or marks will be deducted.

And if you want to get creative with the
equirements, you may. But do so on you own
time, and do not submit your ‘improved’ version
and expect to get marks for it. In short: if you
hand in code that differs in any way from the
UML, you will lose marks. Of course, how
you choose to implement each specific
method in the program is up to you. But the
way in which those pieces connect is directed
y the UML.
2. Aside from a few setters, all methods
indicated in the UML are intended to be put
to use in your code. So if there’s a method
that’s required in the UML and you’re not
using it, you’re likely missing something, and
your code is not being used co
ectly—and
you will lose marks. Take the UML as an
indication not just of what needs to be coded, but
of how the code is to be connected in a well-
written, optimized application (given the rather
limited requirements of this assignment).
So if you can’t figure out how certain features
(such as the private static final
constants declared in the RegView class) will
e used in code, think first, then ask if you’re
stuck: these things exist for a reason.

3. Employ best practices at all times: reuse code,
don’t copy and paste; don’t declare variables
unnecessarily; keep your code to the
minimum needed to ensure the program
functions reliably; only setters and getters talk
directly to private fields, everything else talks
to the public setters and getters; and chain all
overloaded constructors and methods.
Additional information on submission requirements
are included in Section III, ‘Notes, Suggestions, Tips,
and Warnings.’
II. Write the code indicated for each class

As seen in the UML diagram below, five classes are
used in this application: RegLauncher, RegView,
RegControl, Registrant, and Property.

Regarding the five classes you’ll be coding for: there’s
a few general ideas to keep in mind as you proceed
(specific details on each class follow below). Most of
what you need to know should be obvious from the
UML diagram, but the following four items may not
e readily apparent, and may only be infe
ed by
careful examination:

First: We’ll assume, for now, that the user of our
application is well-behaved and will not deliberately
e entering any bad data—an assumption we’ll
overturn in a later assignment, after the subject of
Exceptions has been introduced. But at this point,
there’s no need to check the validity of the data
(with the exception of the check to ensure that
two properties do not overlap—see below).

Second: remember that an object’s private
properties are never accessed directly; everything
goes through getters and setters. For example, the
statement:

getRegistrants[getRegistrantIndex()]
.getRegNum()

eturns the registration number of the last
egistrant in the a
ay of registrants. Whether you
understand everything in this statement or not
doesn’t matter at the point; what matters is that
the code never accesses a private property
directly: everything is done through the getters and
setters.
Third: Simply because a method returns an object
or a boolean value does not mean that value needs
to be used in the application. Typically, if a method
eturns an object, that object’s toString()
 Assignment 1
 Page 3
`
cst8284.asgmt1.landRegistry

+main(args: String[]): void
RegLauncher
+RegView()

-getRegControl(): RegControl
See June 15th

note

+launch(): void
-displayMenu(): int
-executeMenuItem(choice: int): void

-getResponseTo(s: String): String
-requestRegNum(): int
-makeNewPropertyFromUserInput(): Property
-makeNewRegistrantFromUserInput(): Registrant

+viewAddNewRegistrant(): void
+viewFindRegistrant(): void
+viewListOfRegistants(): void
+viewAddNewProperty(): void
+viewChangePropertyRegistrant(): void
+viewListPropertyByRegNum(): void
+viewListAllProperties(): void
-scan: Scanner
-rc: RegControl
Answered Same Day Jun 20, 2021

Solution

Valupadasu answered on Jun 22 2021
167 Votes
CST8284_20S_Assignment1/.classpath

    
    
    
CST8284_20S_Assignment1/.project

     CST8284_20S_Assignment1
    
    
    
    
        
             org.eclipse.jdt.core.javabuilde
            
            
        
    
    
         org.eclipse.jdt.core.javanature
    
CST8284_20S_Assignment1/.settings/org.eclipse.jdt.core.prefs
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=e
o
org.eclipse.jdt.core.compiler.problem.enumIdentifier=e
o
org.eclipse.jdt.core.compiler.source=1.8
CST8284_20S_Assignment1
in/cst8284/asgmt1/landRegistry/Property.class
package cst8284.asgmt1.landRegistry;
public synchronized class Property {
private double TAX_RATE_PER_M2;
private static int DEFAULT_REGNUM;
private int xLeft;
private int yTop;
private int xLength;
private int yWidth;
private int regNum;
private int area;
private double taxes;
static void ();
public void Property();
public void Property(int, int, int, int);
public void Property(Property, int);
public void Property(int, int, int, int, int);
public int getXLeft();
public int getXRight();
public void setXLeft(int);
public int getYTop();
public int getYBottom();
public void setYTop(int);
public int getXLength();
public void setXLength(int);
public int getYWidth();
public void setYWidth(int);
public int getRegNum();
public void setRegNum(int);
public int getArea();
public double getTaxes();
public String toString();
public boolean equals(Property);
public boolean hasSameSides(Property);
public boolean overlaps(Property);
}
CST8284_20S_Assignment1
in/cst8284/asgmt1/landRegistry/RegControl.class
package cst8284.asgmt1.landRegistry;
public synchronized class RegControl {
private Registrant[] registrants;
private Property[] properties;
private int lastRegistrationIndex;
private int lastPropertyIndex;
public void RegControl();
public Registrant[] getRegistrants();
public Property[] getProperties();
public int getLastRegistrationIndex();
public int getLastPropertyIndex();
public Registrant addNewRegistrant(Registrant);
public Registrant findRegistrant(int);
public Registrant[] listOfRegistrants();
public Property addNewProperty(Property);
public Property changePropertyRegistrant(Property, int);
public Property[] listOfProperties(int);
public Property[] listOfAllProperties();
public Property propertyOverlaps(Property);
}
CST8284_20S_Assignment1
in/cst8284/asgmt1/landRegistry/Registrant.class
package cst8284.asgmt1.landRegistry;
public synchronized class Registrant {
private static int REGNUM_START;
private static int cu
entRegNum;
private int REGNUM;
private String firstName;
private String lastName;
static void ();
public void Registrant();
public void Registrant(String);
public int getRegNum();
public static void incrToNextRegNum();
public String getFirstName();
public void setFirstName(String);
public String getLastName();
public void setLastName(String);
public String toString();
public boolean equals(Object);
}
CST8284_20S_Assignment1
in/cst8284/asgmt1/landRegistry/RegLauncher.class
package cst8284.asgmt1.landRegistry;
public synchronized class RegLauncher {
public void RegLauncher();
public static void main(String[]);
}
CST8284_20S_Assignment1
in/cst8284/asgmt1/landRegistry/RegView.class
package cst8284.asgmt1.landRegistry;
public synchronized class RegView {
public final int ADD_NEW_REGISTRANT;
public final int FIND_REGISTRANT;
public final int LIST_REGISTRANTS;
public final int ADD_NEW_PROPERTY;
public final int CHANGE_PROPERTY_REGISTRANT;
public final int LIST_PROPERTY_BY_REGNUM;
public final int LIST_ALL_PROPERTIES;
public final int EXIT;
private static java.util.Scanner scan;
private RegControl rc;
public void RegView();
public void launch();
public RegControl getRegControl();
private static String getResponseTo(String);
private static int requestRegNum();
public Property makeNewPropertyFromUserInput();
public Registrant makeNewRegistrantFromUserInput();
public void viewAddNewRegistrant();
public void viewFindRegistrant();
public void viewListOfRegistants();
public void viewAddNewProperty();
public void viewChangePropertyRegistrant();
public void viewListPropertyByRegNum();
public void viewListAllProperties();
public int displayMenu();
public void executeMenuItem(int);
}
CST8284_20S_Assignment1/src/cst8284/asgmt1/landRegistry/Property.class
package cst8284.asgmt1.landRegistry;
public synchronized class Property {
private double TAX_RATE_PER_M2;
private static int DEFAULT_REGNUM;
private int xLeft;
private int yTop;
private int xLength;
private int yWidth;
private int regNum;
private int area;
private double taxes;
public void Property();
public void Property(int, int, int, int);
public void Property(Property, int);
public void Property(int, int, int, int, int);
public int getXLeft();
public int getXRight();
public void setXLeft(int);
public int getYTop();
public int getYBottom();
public void setYTop(int);
public int getXLength();
public void setXLength(int);
public int getYWidth();
public void setYWidth(int);
public int getRegNum();
public void setRegNum(int);
public int getArea();
public double getTaxes();
public String toString();
public boolean equals(Property);
public boolean hasSameSides(Property);
public boolean overlaps(Property);
static void...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here