Skip to content

LJ submit rideshare#27

Open
elle-johnnie wants to merge 1 commit into
Ada-C10:masterfrom
elle-johnnie:master
Open

LJ submit rideshare#27
elle-johnnie wants to merge 1 commit into
Ada-C10:masterfrom
elle-johnnie:master

Conversation

@elle-johnnie

Copy link
Copy Markdown

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? Yes, my first data structure was an array of hashes for each driver, the individual ride data was stored in arrays (e.g. dates_arr contained all the dates, cost_arr contained all the costs. Although it worked and was relatively straight forward to iterate through, the ordered nature of arrays made it an impractical structure long term. I worked with a TA on coming up with a more robust structure to.
What was your strategy for going through the data structure and gathering information? I initially used .each to get through the data, once refactored I switched to enumerator methods.
What was an example of something that was necessary to store in a variable? What was the scope of each of that variables? Why? I created a variable to determine the ride that made the most money for each driver. The scope of this variable was local to the .each block so that it would get calculated for each driver. The variable would then be redefined for each driver stored in the hash.
What kinds of iteration did you use? Did you use .map? .map .reduce .select .max_by
Were some calculations easier than others? Why? Yes, I think I struggled the most with calculating the total earnings and total ratings for each driver. I had the most difficulty determining how to get into the appropriate layers to apply the .reduce method. Basically getting into a set of hash values within an array that is nested within a larger hash nested inside the outer array was very hard on my brain.

@CheezItMan

Copy link
Copy Markdown

Really nice work using Enumerables like map, select and max_by. The data is well structured as well.

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