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

Ride-Share Project #53

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Ride-Share Project #53

wants to merge 2 commits into from

Conversation

anakp07
Copy link

@anakp07 anakp07 commented Sep 15, 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 I mirrored my data structure to follow the guidelines of the google map example.
What was your strategy for going through the data structure and gathering information? I began by looking at the data csv file and then looked at the questions that I needed to answer at the end and structure my data accordingly.
What was an example of something that was necessary to store in a variable? Why was it necessary, useful, or helpful? The highest earner/highest rating were stored in variables. It was important and useful because I could do calculations and then just call them later when I tried to answer the questions.
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 do iterations for my code. I saw other folks used the .map but I was unsure how to best approach it.
Were some calculations easier than others? Why? Finding the highest earner/ratings took me the longest. I think because i had to think how many iterations were needed in order to access the specific information that I wanted.

Copy link

@beccaelenzil beccaelenzil left a comment

Choose a reason for hiding this comment

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

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 ✔️
... outputs which driver made the most money ✔️
... outputs which driver has the highest average rating ✔️

Overall Feedback

Great job overall! You're code is clear, readable, and functionality is well encapsulated by methods. While I've left a few inline comments below, it is clear that the learning goals around working with complex data structures were met. Keep up the hard work!

Overall Feedback Criteria yes/no
Green (Meets/Exceeds Standards) 4+ in Code Review && 3+ in Functional Requirements ✔️
Yellow (Approaches Standards) 2-3 in Code Review && 2+ in Functional Requirements
Red (Not at Standard) 0,1 in Code Review or 0,1 in Functional Reqs, or assignment is breaking/doesn’t run with less than 5 minutes of debugging

Code Style Bonus Awards

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

Quality Yes?
Perfect Indentation
Descriptive/Readable
Logical/Organized

drivers_array = {

Choose a reason for hiding this comment

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

Great work formatting this data structure for readability.

Choose a reason for hiding this comment

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

Minor note: the data structure is a hash, but you name it with _array.

Comment on lines +140 to +149
total_driver_ratings = 0

rides_array.each do |ride_hash|
total_driver_ratings += ride_hash[:rating]
end
average= total_driver_ratings.to_f/rides_array.length
puts "Driver with ID: #{driver}, has a rating average of #{average.round(1)}"
end
puts ""

Choose a reason for hiding this comment

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

Consider encapsulating this functionality into a method to be consistent with the work for questions 1 and 2.

Also, you might consider combining the work for question 1-3 into a single method since they all require the same driving each loop. It is a tricky balance between dividing up functionality so make each method truly only do one thing, and reducing repeated code.

puts ""

# QUESTION FOUR: 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.

Just as with questions 1-3, you could consider combining the work for questions 4 and 5.

Comment on lines +174 to +176
total += ride[:rating]
end

Choose a reason for hiding this comment

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

Here as a place your could use the .sum enumerable method.

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