Background
With the sudden spike in campus crime, the University of Florida Police Department has decided
to make a mandatory requirement that each student wear a tracking device that is linked to their UFID. Unknown to the general student population, if a student’s UFID ends in 00 to 49, they are a person who is on the “safe list” and is not likely to commit a crime, however if the person has a UFID that ends in 50 to 99, this is a person with a past criminal history who is on the “unsafe list” and they are a bit more likely to have committed a crime. This tracking device also has GPS capabilities and heart-rate monitoring. Since this is a relatively new program, the timestamping system is a bit slow and does not always capture every moment of data, however it stores a student’s last known information. While thinking up this protocol, the University of Florida Police Department has also decided to create a piece of software that can take in the information about a crime and compare it to a student’s tracker data to determine how likely a specific student is to be a suspect in the crime in question. Unfortunately, the Police department does not know how to implement software that reads from the keyboard and is unable to make selections and use boolean logic. Fortunately, they have employed you to create this for them, using your recently learned skills from your COP 3502 class.
Your Assignment
Create a piece of code that takes in the information about the time and location of the crime, a
person’s tracking device data, and output their likelihood of being the suspect. The pieces of data
that will be supplied at the console are:
Crime Time: in military units (0000 to 2359)
Crime Location: supplied as grid locations (x, y) where x is the latitude and y is the longitude (see grid below)
Student UFID: 8 digits, none beginning with a zero Student Location: supplied as grid locations (x, y) where x is the latitude and y is the longitude
Last Student Timestamp: the last snapshot of the student's data, prior to the crime, on the same day as the crime. (0000 to 2359).
Heart Rate: In Beats per Minute (BPM). A BPM = 100 is considered to mean that a person is walking or otherwise moving around. A BPM <100 is considered to mean that the person was not moving at that point in time and is presumed to have been sedentary.
Levels of suspicion
The police have given you the following rules to use when deciding a person’s level of suspicion,
based on their tracking device reading at their last known location.
Highly Likely
Safe List: If within 30 minutes of the crime, the student was in the same block unit of the crime location (Euclidean straight line distance), and their BPM is such that they are determined to be moving around.
Unsafe List: If within 60 minutes of the crime, the student was within 1 block units of the crime location (Euclidean straight line distance)
Likely
Safe List: If within 60 minutes of the crime, the student was within 1 block unit of the crime location (Euclidean straight line distance), and their BPM is such that they are determined to be moving around.
Unsafe List: If within 90 minutes of the crime, the student was within 2 block units of the crime location (Euclidean straight line distance), and their BPM is such that they are determined to be moving around.
Unsure
Safe List: If within 90 minutes of the crime, the student was more than 3 block units of the crime location (Euclidean straight line distance), and their BPM is such that they are determined to be moving around.
Unsafe List: If within 120 minutes of the crime, the student was more than 2 block units of the crime location (Euclidean straight line distance).
Unlikely
Safe List: If within 120 minutes of the crime, the student was more than 4 block units of the crime location (Euclidean straight line distance) and they were sedentary.
Unsafe List: If within 150 minutes of the crime, the student was more than 3 block units of the crime location (Euclidean straight line distance) and they were sedentary.
Highly Unlikely
Anything else that could not be classified from above
Code Structure
1. Read in the information about the crime from the console
Crime Time and Location
2. Read in the information about the student from the console
Student UFID
Student Heart Rate
Student Timestamp and location
3. Determine the student’s state at the time of the crime
If the student was in the area in regards to the time of the crime
What type of student it was (“safe list” vs. “unsafe list”)
What type of activity the student is doing (moving vs. sedentary)
4. Output the student’s level of suspicion (highly likely, likely, unlikely, etc.)
Sample Run - valid input (user input is in red)
Hello and welcome to the UF suspect suspicion calculator. Please enter the time of the crime: 1310
Please enter the latitude of the crime: 5
Please enter the longitude of the crime: 5
Please enter the student’s UFID: 11119999
Please enter their last timestamp: 1300
Please enter the latitude of the student: 5
Please enter the longitude of the student: 6
Please enter their heart rate: 90
Student 11119999 who is on the unsafe list, and was 1.0 block units away, at location (5,6) at 1300 and determined to be sedentary is Highly Likely to be the Criminal.
Notes
You may assume that we will give reasonable inputs.
“Within” means “up to and including”. For example, if the requirement is within 2 block
units, this means d <= 2.
The straight line distance (d) is also known as the Euclidean distance and can be calculated using the formula below.
The distance must be formatted to include one digit after the decimal. This can be achieved using output formatting. The following example demonstrates output formatting to round to one decimal place:
double num = 1.34567;
String strDouble = String.format("%.1f", num); System.out.println(strDouble);
Please use 4 digits to represent the time in the input and output.
Submission Requirements
Name the project “Project1”
Name the class “SuspicionCalculator”
Zip the java file (right click the java file Send to Compressed (zipped) folder)
Name the zip file project1_ulfid.zip where uflID is the portion of your ufl email account that comes before the @ufl.edu part.
Submit using Canvas
If you submit the .java file without zipping, your project will not be graded.
If your file is not named project1_ulfid.zip, your project will not be graded.
If you do not name the Project and class exactly as specified, your project will not be graded.
To help you test the output of your program, there will be a sample executable uploaded to Canvas. It is highly recommended that you test your program piece by piece before assembling your final
code. You will have a much easier time if you build your program piece by piece rather than trying to write the entire program. Pay very close attention to the order that you give inputs to the sample program.
Your output should not differ in any way from the sample output. Using additional prompts, words,
abbreviations, etc may result in the grading program taking unnecessary points off.
Grading
80% of your program will be graded on its ability to generate proper output given reasonable inputs.
10% of your program will be graded on its ability to run without producing errors (warnings are ok).
10% of your program will be graded on its adherence to the coding style standards.