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

Space - Olivia Mulholland Salazar #34

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

Conversation

mulhoo
Copy link

@mulhoo mulhoo commented Feb 10, 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 stuck to the original data structure I had planned, but spent some time figuring out which parts needed to be arrays vs hashes. Specifically where the trip hashes needed to be enclosed inside an array to be the value for my driver_ID keys. I sat stumped for a good hour before realizing they needed to all be inside an array to be the value
What was your strategy for going through the data structure and gathering information? I knew from the get-go that I wanted to organize each trip under their respective driver, with driver_ID being the key for each collection of trips, but this meant I had several different layers of alternating hashes and arrays, so it came down to making sure I was using the correct number of enumerable layers to get to the level I wanted to work with.
What was an example of something that was necessary to store in a variable? Why was it necessary, useful, or helpful? Storing each driver's total earnings and average ratings in specific arrays for those values was really helpful when it came to finding who earned the most and had the highest rating. Rather than have to look at the massive all_drivers_all_trips array for the answer, I could just take the max value of that array and see which driver had it to get my answer.
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 both .map and .each. Typically used .each when going through the outermost array, and then .map to go over the innermost ones. .map allowed me to do the calculations for average rating and total earnings based on the associated key values. I used .each(es) for both levels at the end when I was printing out the totals.
Were some calculations easier than others? Why? Yes, the calculations for total trips and total earnings were the easiest because it was simple addition. When it came to average rating there was a need to divide that sum by the number of trips the driver did.

@dHelmgren
Copy link

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

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?
Concise

Comment on lines +85 to +91
},
{
date_of_trip: "5 Feb 2016",
cost: 50,
rider_id: "RD0003",
rating: 2
}]

Choose a reason for hiding this comment

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

I like how this is indented more than I like how it's indented above.

Comment on lines +94 to +95
{DR0004:
[{

Choose a reason for hiding this comment

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

Give these things more newlines. { DR0004 [ and { can all live on their own lines, as it helps with clarity between data structure vs data.


def overview(array, key, overall)
array.each do |driver|
driver.map do |k, v|

Choose a reason for hiding this comment

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

Does this need to be a map?

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