Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

DATABASE: https://instructure-uploads.s3.amazonaws.com/account_55910000000000001/attachments/1199073/WaPo-fatal-police-shootings-data.csv?response-content-disposition=inline%3B%20filename%3D%22WaPo-fatal-police-shootings-data.csv%22%3B%20filename%2A%3DUTF-8%27%27WaPo%252Dfatal%252Dpolice%252Dshootings%252Ddata.csv&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJFNFXH2V2O7RPCAA%2F20180208%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20180208T203343Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&X-Amz-Signature=d3d01cb27f156722bb2d94c9066933f75728246793a0b2548d69878c18f8e489 Write a Java program to parse the data in that file. Your program should answer the following three questions about the shootings in

image text in transcribedDATABASE: https://instructure-uploads.s3.amazonaws.com/account_55910000000000001/attachments/1199073/WaPo-fatal-police-shootings-data.csv?response-content-disposition=inline%3B%20filename%3D%22WaPo-fatal-police-shootings-data.csv%22%3B%20filename%2A%3DUTF-8%27%27WaPo%252Dfatal%252Dpolice%252Dshootings%252Ddata.csv&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJFNFXH2V2O7RPCAA%2F20180208%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20180208T203343Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&X-Amz-Signature=d3d01cb27f156722bb2d94c9066933f75728246793a0b2548d69878c18f8e489

Write a Java program to parse the data in that file. Your program should answer the following three questions about the shootings in the database. 1. How many fatal police shootings have occurred in each state? 2. For all fatal shootings in the country, what are the totals by race? 3. For all fatal shootings in the country, what are the totals by sex? Regarding question 2, the races defined in the database are as follows W: White, non-Hispanic B: Black, non-Hispanic A: Asian N: Native American .H: Hispanic O: Other No entry: unknown Do not prompt me for the database filename. If your program encounters an error, display a sensible error message. If it is possible to recover from that error, continue processing, otherwise gracefully exit. n your project, create a class KilledPerson. Include member fields for all fields contained in the database. As you read each line from the database, create an instance of a KilledPerson as was done in the example in class. Add that instance to an ArrayList with a meaningful name. Create two HashMaps, one for accumulating killings by state and the other for accumulating killings by race. Walk the original killed person list and accumulate the killings in the respective HashMaps. You'll also need to accumulate killings by gender in separate int variables. Do not display any output other than the answers to the three questions above, and possibly an error message in the case of an unrecoverable error

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_step_2

Step: 3

blur-text-image_step3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions