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 - Georgina #35

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

Leaves - Georgina #35

wants to merge 1 commit into from

Conversation

geomsb
Copy link

@geomsb geomsb commented Aug 12, 2019

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 I organized my data by dates but when I realized that the questions were related to the drivers I changed the structure to be organized by driver id.
What was your strategy for going through the data structure and gathering information? I iterated using .each, .map, and .max_by
What was an example of something that was necessary to store in a variable? Why was it necessary, useful, or helpful? I created the variable array_rides_by_driver_id. It was very helpful because I stored all the rides by driver id and this variable helped me to answer the first question.
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 in the following cases: 1. To answer the first question, I created a variable named array_rides_by_driver_id and I used .map with my general hash (first layer) to create an array of hashes which contains the driver_id as a key and the total of rides by driver as a value . 2. To answer the second question, I created a variable named array_salary_by_driver_id and I used .map with my general hash (first layer) to create an array of hashes which contains the driver_id as a key and the total of salaries by driver as a value . 3. To answer the third question, I created a variable named array_rating_by_driver_id and I used .map with my general hash (first layer) to create an array of hashes which contains the driver_id as a key and an array of rates as a value .
Were some calculations easier than others? Why? Yes, because to answer some questions I only needed to use .map and in other questions I needed to use .map and .each

@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 yes
Outputs the average rating for each driver yes
Outputs which driver made the most money yes
Outputs which driver has the highest average rating yes


# Which driver made the most money?

richest_driver = array_salary_by_driver_id.max_by do |salary_by_driver_id|

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I appreciate the high level comments walking the reader through your process!

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