-
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
time_lola #46
base: master
Are you sure you want to change the base?
time_lola #46
Conversation
Ride ShareMajor Learning Goals/Code Review
Functional Requirements
Overall Feedback
Additional FeedbackGood job! This is a small program but in the future it would be helpful to organize your code using methods. Also, you may want to read up on how to use Code Style Bonus AwardsWas the code particularly impressive in code style for any of these reasons (or more...?)
|
|
||
# 3. The average rating for each driver | ||
drivers_data.each do |driver_id, trips| | ||
ratings = 0 |
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.
Ratings need to use floating point math since we're planning to get an average and want things like 4.67 as an answer.
Because of the way Ruby converts things if you have one floating point value everything winds up floating point so if you start with 0.0
you should get the correct math. (Though note that with floating point math you will want to round
before you display things.)
ratings = 0 | |
ratings = 0.0 |
highest_avg_rating = 0; | ||
driver_info = 0; | ||
drivers_data.each do |driver_id, trips| | ||
ratings = 0; |
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.
You should also use floating point math here. See above.
Assignment Submission: Ride Share
Congratulations! You're submitting your assignment. Please reflect on the assignment with these questions.
Reflection
.map
? If so, when? If not, why, or when would be a good opportunity to use it?