Skip to content

Branches - Angele#32

Open
geli-gel wants to merge 1 commit intoAda-C12:masterfrom
geli-gel:master
Open

Branches - Angele#32
geli-gel wants to merge 1 commit intoAda-C12:masterfrom
geli-gel:master

Conversation

@geli-gel
Copy link

ride share

Congratulations! You're submitting your assignment.

Comprehension Questions

Question Answer
What did your data structure look like at first? Did this structure evolve over time? Why? At first my data structure had too many layers, it was a hash stored in a variable called "ride_share_data" with the first and only key being "DRIVER_ID" - I ended up getting rid of both of those and making it a hash of driver IDs stored in a variable called "driver_data" which can be looked and and pretty easily (hopefully) determined that it's ride share data organized primarily by drivers. It was organized primarily by drivers since it seems like most interesting info and most questions were asking about the drivers, so I thought it would make sense to be able to access each driver with the key as the ID in case a specific one was needed to be looked at or named.
What was your strategy for going through the data structure and gathering information? My strategy was looking at the question, then looking at the data structure and figuring out what layer I would need to access, and then looking at the list of enumerable operators and thinking whether or not I could use one of those to access the answer. Then pseudocoding a solution that included the data structure of the variable that would hold the answer.
What was an example of something that was necessary to store in a variable? Why was it necessary, useful, or helpful? When determining which driver made the most money, it was helpful to store a hash of each driver (key) and their total earnings (value) so that I could more easily find the highest amount earned and corresponding driver(s) (keys)
What kinds of iteration did you use? Did you use .map? If so, when? If not, why, or when would be a good opportunity to use it? I used .each, .sum, .select, .uniq, and .map. .map was used after I used .uniq on each driver's array of rides to convert it from an array of rides with unique dates to an array of just dates.
Were some calculations easier than others? Why? Yes - for some, like the number of rides each driver has given, I just had to get the length of each driver (key)'s array of rides (value) because of the way the whole data was structured, with driver's rides being contained in an array, with the easy to use .length method.

@jmaddox19
Copy link

Ride Share

What We're Looking For

Feature Feedback
Answers the comprehension questions X
Readable code with consistent indentation and reasonable code style X
Outputs the correct number of rides each driver has given X
Outputs the total amount of money each driver has made X
Outputs the average rating for each driver X
Outputs which driver made the most money X
Outputs which driver has the highest average rating X

Love the way you organized the data! Your code looks great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants