Skip to content

Create Goeun - Rideshare - Edges.rb#33

Open
goeunpark wants to merge 1 commit into
Ada-C10:masterfrom
goeunpark:master
Open

Create Goeun - Rideshare - Edges.rb#33
goeunpark wants to merge 1 commit into
Ada-C10:masterfrom
goeunpark:master

Conversation

@goeunpark

Copy link
Copy Markdown

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? I followed the google maps json structure example so my data always looked like this. Date info is in array but should probably be in hash because I need to stop being scared of hashes (methods using index = love it! methods using key/value = um?)
What was your strategy for going through the data structure and gathering information? The data is structured as a hash (key: driver, value: trips) - array (index: trip) - hash (keys: date, rider ID, rating, cost). To access specific trip info such as rating and cost, I used nested iterations within the methods.
What was an example of something that was necessary to store in a variable? What was the scope of each of that variables? Why? In most_money() and best_rating(), I use variables greatest and index to compare the sum cost / average rating and its location within the arrays I created specifically for these methods. The scope of these variables are limited to within the method because these variables help me find the richest_driver and best_ranked_driver which is the information I ultimately want and I don't need them outside of the method.
What kinds of iteration did you use? Did you use .map? I used each_index, each_pair, and each. I didn't use .map D: I'm working on it!
Were some calculations easier than others? Why? The first three methods were easier than the final two because the final two needed calculations made from the preceding two methods to identify the driver ID.

@droberts-sea

Copy link
Copy Markdown

Great work overall! Your data structure feels like a very natural choice for this problem. I also appreciate the way you broke your code out into separate methods - this makes the flow of the program much easier to follow. Keep up the hard 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