[SOLVED] CSC7081 Resit -Crime stats system Assignment brief

35.00 $

Category:
Click Category Button to View Your Next Assignment | Homework

You will receive the following solution file(s) instantly after successful payment:

zip file icon Assessment-Resit-oe8zug.zip (346.1 KB)
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
🔒 Securely Powered by:
Secure Checkout
5/5 - (2 votes)

Crime stats system Assignment brief:

You have been given some code that is currently being developed as part of a Crime Stats application specifically analysing recent Crime in USA cities. Not all the requirements have been implemented. It is your task to implement these and raise the coding standards of all the code.

Create a project solution (named <Your Name><Student Number>Resit e.g. JamesBrown3048614Resit). Create a package named resit. Add StartApp.java to the solution and the crimeUSA.csv. Ensure your name and student number are placed in the Javadoc comments of all the classes you create. The StartApp has been partially written with a menu.

The application will run (start) from the StartApp.java, initially reading in the data from the crimeUSA.csv file and then perform a number of menu driven operations.

Part 1 – Data mapping, storage and read from file – 50%

Using your knowledge of OOP you should add/update the code based on the following:

  1. Analyse the data in the crimeUSA.csv and create a class (CityCrime.java) to represent the data in the csv file, include the following …

    I. Each State name should be recoded as its abbreviation as detailed in the supplied StatesAbbreviations.csv file, e.g ALABAMA as AL etc.

    1. Include a method to return as an int the total number of violent crimes (calculated from total of murder, robbery, assault)
    2. Include a method to return as an int the total number of possession crimes (calculated from total of burglary, larceny and car theft
  2. Validation rules :

    No field should be empty and no numeric fields should be less than zero. Any records (city stats) that break these rules should not be included and stored in the arraylist in the system (see Part 1 – 4 below).

  3. Conduct a unit test for the CityCrimes class.
  4. In the StartApp.java class read and store the data in this arraylist :

    public static ArrayList<CityCrime> cityCrimes = new ArrayList<CityCrime>();

    [CONTINUED OVER]

1

City
State
Population
Murder
Robbery
Assault
Burglary
Larceny
Car theft
Violent crime
Possession crime

etc…

: Adamsville : AL
: 4889
:0

:13 :29 :38 : 228 :23 : 42 : 289

MSc Programming module 2020-2021 – re-sit project

Part 2 – Functions – 50%

Having read the data from the csv file complete the menu driven functions as outlined below. An example of the expected format is shown for each function (note: actual answers based on csv data provided are not necessarily the example output shown).

1. Display all City crime stats to screen. Example output…

City
State
Population
Murder
Robbery
Assault
Burglary
Larceny
Car theft
Violent crime
Possession crime ___________________________________________________

: Abbeville : AL
: 2990
:0

:0 :10 :23 :66 :3 :10 :92

2. Display all crime stats for a selected City. Example output…

Enter option ...

2

Enter city

Riverton

City
State
Population
Murder
Robbery
Assault
Burglary
Larceny
Car theft
Violent crime
Possession crime

: Riverton :NJ
: 2741
:0

:0 :0 :6 :31 :0 : 0 : 37

[CONTINUED OVER]

2

MSc Programming module 2020-2021 – re-sit project 3. Display the total murders in a selected state

   Enter state to view total murders

NY

Total murders 596 in NY
4. Calculateanddisplaythehighestoverallcrimestats

    Enter option ...

4

    City with highest crime stats 204451 is New York
    City
    State
    Population
    Murder
    Robbery
    Assault
    Burglary
    Larceny
    Car theft
    Violent crime
    Possession crime
    ___________________________________________________

5. Display each state (in alphabetical order) with the total number of car thefts. Example output…

       Enter option ...

5

       States and car theft
  1. AK  1898
  2. AL  9599

AR 5377 AZ 48322

6. File write – export/write to a new file (RobberyStats.csv) in the format Robbery, City. Descending order by robbery stat for each city. Format of the csv file shown below (include the header).

Robbery,City 23511,New York 15863,Chicago 14353,Los Angeles 11371,Houston 10971,Philadelphia etc…

: New York :NY
: 8165001 : 596

: 23511
: 26908
: 22137
: 115363
: 15936
: 51015
: 153436

[CONTINUED OVER]

3

MSc Programming module 2020-2021 – re-sit project
When complete compress (zip) the entire Eclipse solution and upload to Resit (Resit assessment) on

CANVAS. Remember to record and then upload a short commentary walk-through of your code with your solution (upload that too

Now : check the uploads to ensure you have submitted the correct files (in the correct area).

[END]

4

  • Assessment-Resit-oe8zug.zip