Task 1 (60 marks) (plotting some POIs on a graph/map)
- Part 1: Several types of point of interests (POI) such as - (1) Petrol station, (2) Taxi Stand, (3) ATM, (4) Hospital and (5) Shopping centre are located in a city. Their locations (longitude and latitude) are provided in a text file (a file will be provided in the resource section of the subject site, or you can create your own dummy text file according to the format you prefer). You must work with at least two type/kind of POI and at least 20 samples for each type (e.g. your text file should contain the location of 20 petrol stations in a city). You have to write a JAVA program that would get the locations of all the POIs from the file and plot them on a map (graph). Optional: Save the map/graph in a file if the user wants to.
- Part 2: incorporate a mechanism to zoom in/out the map either by having buttons or with the help of the scroll button.
Task 2 (40 marks) (a square inherits a rectangle)
Assume a rectangle as depicted in the diagram bellow. Notice its specifications.
The diagram shows a class Rectangle. An object of this class represents a shape which has two sides (base and height). These two sides should be kept in private to avoid misuse and set to zero when a rectangle object is first created. There should be a function to set the value of these two sides. Another function should calculate the area (base * height) of the rectangle.
Part 1 (rectangle):
- Write a JAVA source code, to declare the Rectangle class considering above mentioned specifications.
- Write, in JAVA, the complete definition of the Rectangle class based on your declaration
- Write a fragment of client code which creates a Rectangle object, sets its base and height value to 8 and 6 respectively and
- displays its area.
Part 2 (square):
Assume a Square class which would inherit the Rectangle defined in Part 1. An object of Square class will have both sides equal (i.e. base=height) which are set to zero at the time of the creation of the object. The same functions (area and setValues) of the Rectangle class should be used in Square class too.
- Write a JAVA source code declaration of the Square class inheriting the Rectangle class to behave according to the specification given above.
- Write a fragment of client code which creates a Square object, sets its side to 8 and displays its area.
Rationale
This assignment is designed to asses following learning outcomes:
- be able to design and construct Java Graphical User Interfaces (GUI) that interact with problem domain objects;
Marking criteria
The marking criteria are represented via the following marking guide.
Task1
Items
|
Full Marks
|
PS
|
CR (PS+)
|
DI (CR+)
|
HD (DI+)
|
Presentation
|
10
|
Very basic presentation (no source code or screen shots were included)
|
Only report (with screen shots) is present but no source code was submitted
|
Report, screen shots and source code both are submitted as required
|
The presentation includes all requirements and is easy to read and understand
|
Program execution
|
10
|
Program is not running but the source code indicates the correctness
|
Program is running but not working properly
|
Program is running perfectly but cannot handle unexpected inputs/events
|
Program is running perfectly and not crashing because of unexpected inputs/events
|
Loading (POI detail) from file
|
15
|
Program is unable to load from the file. Rather user needs to give POIs as inputs.
|
Loading from file but there are some errors while displaying the POIs
|
Loading from files without any error
|
Loading from files without any error and the user can choose a filename to be loaded
|
Plotting graphically
|
15
|
There are several errors in plotting
|
Only few errors in plotting
|
No errors in plotting
|
No errors in plotting and easily understandable by the user
|
Zooming
|
10
|
There are many errors in zooming
|
Only few errors in zooming
|
No errors in zooming
|
No errors in zooming and easy to operate
|
|
|
|
|
|
|
|
Task 2
Items
|
Full Marks
|
PS
|
CR (PS+)
|
DI (CR+)
|
HD (DI+)
|
Presentation
|
5
|
Very basic presentation (no source code or screen shots were included)
|
Only report (with screen shots) is present but no source code was submitted
|
Report, screen shots and source code both are submitted as required
|
The presentation includes all requirements and is easy to read and understand
|
Program execution
|
5
|
Program is not running but the source code indicates the correctness
|
Program is running but not working properly
|
Program is running perfectly but cannot handle unexpected inputs/events
|
Program is running perfectly and not crashing because of unexpected inputs/events
|
Part 1 (Rectangle)
|
15
|
A rectangle class is created but does not meet the asked specifications
|
Rectangle class is created with all specifications but no instance (object) is created
|
Instance (object) of the rectangle is created and initialised accordingly
|
Client code utilises the rectangle object to calculate the area
|
Part 2 (Square)
|
15
|
Simply created the square class that inherits the rectangle class
|
The square class inherits the rectangle class perfectly and sets its side accordingly
|
The client code crates the square object and utilises to calculate the area of the square
|
|
|
|
|
|
|
|
WHAT NEED TO SUBMIT:
1. REPORT
Quoting from the subject outline, here's the report requirements:
"The report (in .doc or .pdf format) should explain how to run your program (1 or 2 page long) and any settings
needed to run your program. Enough number of screenshots should be shown in the document. In case if the assignment marker fails
to run your program, because of any inconvenience, these screenshots would show how the program worked on your machine/environment.
"
In other word, you must provide clear instructions to me on how to run your programs. Include screenshots
showing your programs in action, with descriptions with each screenshot. These images will be my fallback in case I am unable to get
your programs to run on my computer.
2. Code Archive
You need to submit your code to me in a format that I can use to easily run your programs.
Since our lab is equiped with NetBeans, we will use this as the minimum standard for code submittion. Please follow these steps:
a. Find the folder that contains your assignment 2 Netbeans project.
b. Compress it using ZIP
c. Rename it to something like this: "111222333-ITC521-Assignment2.zip" (obviously, change 111222333 to
your actual student ID, and ITC521 to ITC313 if that's your class - Got to say this because I have been blinded in the past).
d. Upload the archive to Interact. Go to ITC521 or ITC313, then Resources --> Assignment project archives -->
Assignment 2 NETBEANS archives, and upload your ZIP file.