Criminal Investigation Tutorial

Style File 1


Create a new file using Notepad++ and paste this information into the editor.

Save file your calling it Style1.css.


Style File 2


Create a new file using Notepad++ and paste this information into the editor.

Save file your calling it Style2.css.



Style File 34


Create a new file using Notepad++ and paste this information into the editor.

Save file your calling it Style34.css.


Style File 5


Create a new file using Notepad++ and paste this information into the editor.

Save file your calling it Style5.css.


Style 6



Create a new file using Notepad++ and paste this information into the editor.

Save file your calling it Style6.css.


Day 5: Creating new profiles

Now we are going to create some new profiles for our application.

Remember we currently have three profiles. Remember profiles are a combination of characteristics.

The way each profile or any characteristic is accessed is through the decideFunction().

Based on the radio buttons clicked on by the user, profile functions can be called.

After the profile function is called, the program compares user input with each record in the file.

If it finds an exact match, the name or names of suspects will be displayed in the third column.

For our profile 4, here are the buttons that would be selected and their array index number.

ButtonCharacteristicIndex No.
Genderfemale1
Crimeauto theft6
AgeMillennial1
RaceCaucasian0
Height68 inches3
Weight1354
Eye Colorbrown1
Facial Hairnone3
Tatoosno1
Buildmedium1

Here is the code that needs to be added to our crookFinder program, decideFunction().

if (gender[1].checked == true && crime[6].checked == true

&& race[0].checked == true && age[1].checked == true

&& height[3].checked == true && weight[4].checked == true

&& eyeColor[1].checked == true && facialHair[3].checked == true

&& build[1].selected == true)

{

profile4();

}

Key this block of code right after profile 3 in the decideFunction()

The way it works, is that the value of each radio button pushed is recorded and then the function calls the individual profile function.

The code referred to is at the beginning of the script tag. These are global variables.

Here is the information for the fourth profile.

  1. Sex: female
  2. Crime: auto theft
  3. Age : Millenial
  4. Race: Caucasian
  5. Height: 68 inches
  6. Weight: 135 lbs.
  7. Eye Color: brown
  8. Facial Hair : none
  9. Tatoos: no
  10. Build: medium

Open your crookFinder.html program in Notepad++ and paste this information into the editor.

Save your file.

add this line at 2653

Day 6: Expanding Searches

Since the algorithum looks only for exact matches, you might get no suspects.

It has been well-known, that witness identification is less than perfect.

Suppose, our witness wasn't quit sure about eye color. Maybe the eye color green instead of brown.

Here is the line of code, we are gong to modify. I commented out the original line and added the new one just after it.

if (gender[1].checked == true && crime[6].checked == true && race[0].checked == true && eyes[1].checked == true || eyes[2].checked == true && facialHair[3].checked == true && tatoos[1].checked == true && build[1].checked == true && age[1].checked == true && height[3].checked == true && weight[4].checked == true)

The || means OR. The program should execute the call for profile4 with either brown or green eyes selected.

Now we need to modify the line affected in profile4 code.

if (arrests[index].sex == "female" && arrests[index].race =="Caucasian" && arrests[index].age >=23 && arrests[index].age <=38 && arrests[index].arrestedFor =="auto theft" && arrests[index].height == 68 && arrests[index].weight == 135 && arrests[index].eyeColor == "brown" || arrests[index].eyeColor == "green" && arrests[index].facialHair =="none" && arrests[index].tatoos == "no" && arrests[index].build =="medium")

If you run the program now you will get three suspects. The first two are very close in terms of characteristics, the third one only matches on seven traits out of ten.