Question
How would you write a c# program analzyzing Crime data? (Constraints below) Description: Create a C#/.NET console application that analyzes crime data based on a
How would you write a c# program analzyzing Crime data? (Constraints below)
Description: Create a C#/.NET console application that analyzes crime data based on a comma-separated-value (CSV) file and generates a report that answers a set of provided questions that is saved in a text file. The path to the CSV file and the path to the report text file are provided to the program as command line arguments. If the user runs the program without supplying the arguments, they should be provided with the syntax for running the program.
Questions Constraints
The questions to be answered by the application that are to be used as the basis of a report that the application generates are the following.
What is the range of years included in the data?
How many years of data are included?
What years is the number of murders per year less than 15000?
What are the years and associated robberies per year for years where the number of robberies is greater than 500000?
What is the violent crime per capita rate for 2010? Per capita rate is the number of violent crimes in a year divided by the size of the population that year.
What is the average number of murders per year across all years?
What is the average number of murders per year for 1994 to 1997?
What is the average number of murders per year for 2010 to 2013?
What is the minimum number of thefts per year for 1999 to 2004?
What is the maximum number of thefts per year for 1999 to 2004?
What year had the highest number of motor vehicle thefts?
Example Output (Report)
Crime Analyzer Report
Period: 1994-2013 (20 years)
Years murders per year < 15000: 2010, 2011, 2012, 2013 Robberies per year > 500000: 1994 = 618949, 1995 = 580509, 1996 = 535594 Violent crime per capita rate (2010): 0.0040450234834638 Average murder per year (all years): 16864.25 Average murder per year (1994-1997): 20696.25 Average murder per year (2010-2014): 14608.75 Minimum thefts per year (1999-2004): 6937089 Maximum thefts per year (1999-2004): 7092267 Year of highest number of motor vehicle thefts: 1994
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started