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

Space - Charlotte #43

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

Conversation

FreeMonkey19
Copy link

@FreeMonkey19 FreeMonkey19 commented Feb 10, 2020

Assignment Submission: Ride Share

Congratulations! You're submitting your assignment. Please reflect on the assignment with these questions.

Reflection

Question Answer
What did your data structure look like at first? Did this structure evolve over time? Why? At first, my data structure was one array of many hashes. As time went on, I realized it was better to use the driver-id as a key.
|

| 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.

|

@FreeMonkey19 FreeMonkey19 changed the title Create Ride Share Program Space - Charlotte - Ride Share Program Feb 10, 2020
@FreeMonkey19 FreeMonkey19 changed the title Space - Charlotte - Ride Share Program Space - Charlotte Feb 10, 2020
@CheezItMan
Copy link

Ride Share

Major Learning Goals/Code Review

Criteria yes/no, and optionally any details/lines of code to reference
Correctly creates, reads, and modifies variables ✔️
Correctly creates and accesses arrays ✔️
Correctly creates and accesses hashes ✔️
Reasonably organizes large amounts of related data into nested arrays and hashes ✔️
Correctly iterates through a nested data structure using loops and/or Enumerable methods ✔️
Reasonably organizes small pieces of code into methods, and calls/invokes those methods ✔️

Functional Requirements

Functional Requirement yes/no
To the terminal, the program outputs the correct number of rides each driver has given ✔️
... outputs the total amount of money each driver has made ✔️
... outputs the average rating for each driver ⚠, only outputs the driver with the highest rating
... outputs which driver made the most money ✔️
... outputs which driver has the highest average rating ✔️

Overall Feedback

Overall Feedback Criteria yes/no
Green (Meets/Exceeds Standards) 4+ in Code Review && 3+ in Functional Requirements ✔️

Code Style Bonus Awards

Was the code particularly impressive in code style for any of these reasons (or more...?)

Quality Yes?
Perfect Indentation ⚠, some weird indentation here.
Concise
Logical/Organized

Summary

Nicely 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.

Comment on lines +129 to +131
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!"

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}!"

Choose a reason for hiding this comment

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

Indentation!

Comment on lines +120 to +121
total_income_for_each_driver.each do |driver, income|
puts "This driver: #{driver} made this much money: $#{income}"

Choose a reason for hiding this comment

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

Indentation!

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