Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Assignment Submission: Ride Share
Congratulations! You're submitting your assignment. Please reflect on the assignment with these questions.
Reflection
I have noticed that I get stuck in figuring out the code instead of trying to tackle each question at a time, so I have transition in writing the sudo code first. During this ride share, once I wrote the sudo code, I went back and forth in using Hashes and Arrays. Over time I realized that the 4 drivers were uniq and I can make that a uniq key and inside of that have nested Array of the data that correspond to that driver. So yes it evolve over time.
2.) What was your strategy for going through the data structure and gathering information?
Like I mentioned on question 1, first writing a sudo code, then really using paper and doing the math then gradually using those two things in writing code.
3.) What was an example of something that was necessary to store in a variable? Why was it necessary, useful, or helpful?
I stored cost per driver in a variable, and it was important to do that since that variable was going to be used through out question 2 and the questions following that. Once I have that in a variable, I can get the total cost, and also use it to compare which driver made the most money later on on question 4.
4.) 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 ended up using .each do iteration. And as I answer these questions I realized that I could have used .map iteration for the Arrays and would have had variety iteration method. It was good to use it on cost per driver and storying that in different Array of total cost. I used .each method because it just was known method that came natural to me, that being said I know I only get better by applying different methods.
5.) Were some calculations easier than others? Why?
Too calculate the highest average rating was harder for me, the other were relatively easier. Even thought I have calculated the average rating prior, the method was harder to correct.