-
Notifications
You must be signed in to change notification settings - Fork 48
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
Space - Charlotte #43
base: master
Are you sure you want to change the base?
Conversation
Ride ShareMajor Learning Goals/Code Review
Functional Requirements
Overall Feedback
Code Style Bonus AwardsWas the code particularly impressive in code style for any of these reasons (or more...?)
SummaryNicely done, you hit the learning goals here. I like how you organized things into methods. However there are a few things to look at here. |
each_money = sum_drivers_income(drivers) | ||
most_made = each_money.max_by { |driver, earnings| earnings }[0] | ||
puts "This driver: #{most_made} made the MOST money!" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation!
|
||
highest_rated = [highest_avg_rating(drivers)].to_h | ||
highest_rated.each do |driver, rating| | ||
puts "The highest average rating of: #{rating} belongs to this driver: #{driver}!" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation!
total_income_for_each_driver.each do |driver, income| | ||
puts "This driver: #{driver} made this much money: $#{income}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation!
Assignment Submission: Ride Share
Congratulations! You're submitting your assignment. Please reflect on the assignment with these questions.
Reflection
| What was your strategy for going through the data structure and gathering information? | Mostly .each and nested loops. Start with the most outer data structure - ask myself - is this what I need? If no, then I had to go a level deeper. |
| What was an example of something that was necessary to store in a variable? Why was it necessary, useful, or helpful? |
The result of the method sum_drivers_income was necessary to be store in a variable so I could eventually find the driver who made the most money. |
| 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 and then used .sum and .max_by. I know that .map returns an array and I was building hashes. | I need a lot more practice using with nested data structures and enumerables.
| Were some calculations easier than others? Why? |
Yes. Finding how many rides each driver did was easiest because it was only one level deep. Finding the highest average rating was more complicated as it was several layers deep - which for me - can be a bit abstract.