Skip to content

Update worksheet.rb#38

Open
sarashahbaig wants to merge 1 commit intoAda-C12:masterfrom
sarashahbaig:master
Open

Update worksheet.rb#38
sarashahbaig wants to merge 1 commit intoAda-C12:masterfrom
sarashahbaig:master

Conversation

@sarashahbaig
Copy link

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? Initially, I used an array of drivers with each driver as a hash. In a driver's hash, I represented their rides, cost, ratings in arrays.
What was your strategy for going through the data structure and gathering information? I looked at the data to find what things could be as stand-alone entities that I could represent as a singl unit. The overall data was a list of drivers. So it was easy to represent that as an array. The next part was to represent each single ride for a driver. I thought their rides could be represented in a list that contains a hash of single rides. In a single ride hash, I represented who the driver was, what was the cost for that ride, what rating was given and when the ride was taken.
What was an example of something that was necessary to store in a variable? Why was it necessary, useful, or helpful? One example was the id for each driver. This was necessary to store in a variable because we can later use to figure out which driver made most money, etc.
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 nested .each loops to iterate over the list of drivers and then the list of rides for each driver. I did not use .map.
Were some calculations easier than others? Why? When I initially represented the cost and ratings as arrays, it was easier to just use the .sum method. However, when I converted them into hash of rides, it became hard to do the calculations.

@tildeee
Copy link

tildeee commented Aug 20, 2019

Ride Share

What We're Looking For

Feature Feedback
Answers the comprehension questions x
Readable code with consistent indentation and reasonable code style All of the lines besides the drivers_info array were all indented once more than they should have. Otherwise looks great!
Outputs the correct number of rides each driver has given In your data structure, you accidentally have an extra ride for Driver DR0003, which belongs to DR0004. Once that data is corrected, your code outputs the correct answer :)
Outputs the total amount of money each driver has made Just as above: In your data structure, you accidentally have an extra ride for Driver DR0003, which belongs to DR0004. Once that data is corrected, your code outputs the correct answer :)
Outputs the average rating for each driver same as above
Outputs which driver made the most money Yes :)
Outputs which driver has the highest average rating You have this! But also, in your data structure, you accidentally have an extra ride for Driver DR0003, which belongs to DR0004. Once that data is corrected, your code outputs the correct answer with the correct average rating :)

Good work on this project, Sara! Overall, your code is very clean, and your solution is very readable, logical, and clever. You did a great job of setting some initial values for different variables like max and highest_average_rating and re-assigning them based on certain logic.

It seems like when you made your data structure, some data mistakenly got put into the wrong place. In general, I don't think this is a huge mistake that I'm concerned over, but it's good to know that until that got fixed, you had some wrong answers.

Also, if you had more time, I would love to see some refactoring to include practicing making methods!

Again, overall, your project still looks great. 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