Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leaves - Julia K #37

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Leaves - Julia K #37

wants to merge 1 commit into from

Conversation

Kalakalot
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 an extra hash level, but I switched to an array of hashes because trying to access data in my original layout was feeling like way more work than necessary.
What was your strategy for going through the data structure and gathering information? The each method is my friend, and I used it often. Once I figured out how each works with an iteration variable, the process of accessing data started making a lot more sense.
What was an example of something that was necessary to store in a variable? Why was it necessary, useful, or helpful? When I iterated over the original hash to find, say, the ride costs associated with each driver, I stored the results in a variable. This allowed me to a) check that my iteration produced the expected results, and b) easily access the results.
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 .map on my first pass through "average rating for each driver", but when I got to the last question (driver with the highest average rating) I refactored my code with the .each because the transformation it produced was more useful. In addition to many uses of .each, I also used .max_by on the "which driver made the most money" and "which driver has the highest average rating" questions.
Were some calculations easier than others? Why? Oh yes! The more transformations that were involved, the harder the calculation. For example, the first question (how many rides did each driver provide?) was pretty straightforward since all I needed to do was count the number of times each driver ID appeared in the top-level hash. The last question (which driver had the highest average rating?) was much harder because I first had to populate a new hash with driver ID and an array of their ratings, then I had to program what each driver's average rating was, then I had to output which driver's average rating was the highest.

@dHelmgren
Copy link

Ride Share

What We're Looking For

Feature Feedback
Answers the comprehension questions yes
Readable code with consistent indentation and reasonable code style yes
Outputs the correct number of rides each driver has given yes
Outputs the total amount of money each driver has made no, see comment
Outputs the average rating for each driver yes
Outputs which driver made the most money yes, based on how you transcribed the data!
Outputs which driver has the highest average rating yes

Good work overall! Check my comments! Your submission is good, but I've listed some things for you to think about in the future.

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