Reference no: EM132245250
Programming Languages - Project: Divvy Ride Analysis
Assignment: F# program to perform Divvy ride analysis.
Divvy Bike Sharing -
You've probably seen the blue bikes that are part of Divvy bike sharing system here in Chicago. The Divvy system is a commuting service where users pay a yearly fee ($75?) to use the bikes for free as long as rides are < 30 minutes in duration. Longer rides incur a surcharge. It's a very popular system, with stations throughout the city and some suburbs.
Interestingly, the Divvy folks also make their ride data available as part of Chicago's open data portal.
The goal in this assignment is to input ride data for one day, and perform some analysis of the data: # of rides, the % of riders that identify as male and female, the average ride duration, etc. Here's a screenshot of the program analyzing the divvy1.csv data file:
- 243 riders
- 177 identified as male (72.84%)
- 45 identified as female (18.52%)
- Average rider's age: 38.99
- Histogram of ride durations
- Histogram of starting hour (screenshot on next page)
The program starts by inputting the filename, and then proceeds to input and analyze the data. A skeleton F# program is provided with the code to open the data file and input the data. Your job is to add the analysis.
When computing the average age, use (current year - birth year). To obtain the current year: System.DateTime.Now.Year. When computing the histogram of ride durations, the categories are the following:
0 < duration <= 30 minutes
30 < duration <= 60 minutes
60 < duration <= 120 minutes
120 < duration <= 24 hours
The "Ride Start Time" histogram categorizes the rides based on their start time (0 => midnight, 1 => 1am, ... and 23 => 11pm). The number of stars output = # of rides starting that hour / 10. For example, there were 37 rides starting in the 8am hour. So the histogram display for 8am is 3 stars followed by the count: ***37.
You can solve recursively, or using a higher-order approach (I'd recommend a mix of both). You cannot use loops, no mutable variables, and do not change the data structure.
Requirements - No imperative programming. In particular, this means no mutable variables, no loops, and no data structures other than F# lists. Use recursion and higher-order approaches only; you must also work with the input format as given, i.e. a list of lists.
Attachment:- Assignment Files.rar