Skip to content

Layla_Edges_Rideshare#41

Open
lbristol88 wants to merge 3 commits into
Ada-C10:masterfrom
lbristol88:master
Open

Layla_Edges_Rideshare#41
lbristol88 wants to merge 3 commits into
Ada-C10:masterfrom
lbristol88:master

Conversation

@lbristol88

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? First I created an array to store all the hashes for each ride entry. I then decided to create a hash to store hashes based on each driver and their individual results. Using the hashes unique to each driver made it easier to loop and gather information based on the questions.
What was your strategy for going through the data structure and gathering information? I used .each loops and created methods based on what I needed to answer.
What was an example of something that was necessary to store in a variable? What was the scope of each of that variables? Why? When iterating through the drivers hash, instead of creating a variable to store average_rating, i used a hash within the variable so I could keep the code as DRY as possible and easy to reference.
What kinds of iteration did you use? Did you use .map? I used .each for all of my iterations which made the most sense. When refactoring I could try .map.
Were some calculations easier than others? Why? Because I used a hash to store information for each driver. It was easy to retrieve information on how many rides each driver did, and determine who made the most.

@droberts-sea

Copy link
Copy Markdown

Good work overall! I like that the loop you used to find the numbers for the different drivers is separate from the loop you used to print the results. As our logic becomes more and more complex, separating display logic from business logic will be an important technique. You also did a good job of breaking your code out into methods, which is good for readability.

One nitpick: your calculation of the average rating uses integers, so you loose a little precision when you divide. However, in general I am quite happy with this submission. Keep up the hard work.

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