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

Sockets - Rosalyn #26

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

Sockets - Rosalyn #26

wants to merge 1 commit into from

Conversation

ranuseh
Copy link

@ranuseh ranuseh commented Feb 19, 2019

ride_share initial commit.

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? Each driver is represented in a hash and the rides for each driver is an array of nested hashes.
What was your strategy for going through the data structure and gathering information? My strategy involved iterating through the outer hash of driver and then digging deeper and iterating through the inner hash of rides to retrieve and calculate information.
What was an example of something that was necessary to store in a variable? Why was it necessary, useful, or helpful? It was necessary when calculating the average rating for each driver to store the output in a variable. This variable was then used to determine the highest rating by comparing each drivers rating to the next driver.
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 originally used .each but changed to .map as it removed some lines and allowed me to condense my code.
Were some calculations easier than others? Why? Calculating the income, the number of rides or the average rating for each driver was easier than the others as there were fewer steps involved. The harder calculations which required you to determine the rating and most money amongst all the drivers was a little harder as it involved additional code to compare the 4 drivers numbers

ride_share initial commit.
@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

puts "The average rating for Driver ID: #{driver_id} is #{format('%.2f', rating.sum.to_f / rides.length)}"
end

# Which driver made the most money?

Choose a reason for hiding this comment

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

These comments are useful for helping me understand, good 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