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

Water - Leah #39

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

Water - Leah #39

wants to merge 1 commit into from

Conversation

scottzec
Copy link

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 had various data structures, an array of hashes for each ride, or the hashes of drivers with an array of rides with a hash for each piece of ride info. I felt certain that organizing the data around each driver was best because most of the questions were about "which driver" so I decided to go for the second one.
What was your strategy for going through the data structure and gathering information? I found the idea of immediately writing code to specifically answer the prompts overwhelming. Therefore, I made up little questions and first just practiced accessing different parts of my data structure, i.e. what was the cost for driver DR0001's first trip (chronologically)? --> driver_data[:DR0001][0][:cost] . This helped me then think about accessing information in a more general sense that I could apply for iteration.
What was an example of something that was necessary to store in a variable? Why was it necessary, useful, or helpful? I frequently stored in a variable an array of information, either info on each of the rides of an individual driver or for each of the 4 drivers. This then let me use array methods to determine maximums, sums, averages, etc.. (ride_count, driver_earnings, driver_rating)
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 solely. Now I do realize I could have used .map, for instance to store in the array "ride_earnings". It wasn't a conscious choice to not use .map, but I think I was overwhelmed in keeping on top of the nested data structures and therefore I had a very tunnel view with sticking doggedly to .each.
Were some calculations easier than others? Why? The number of rides for each driver was easiest, or most simple, to calculate because I did not need to access the most deeply nested key-value pairs for each ride's hash.

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.

1 participant