Skip to content

Conversation

@thenora
Copy link

@thenora thenora commented Feb 10, 2020

Submitting my ride share app

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 looked at the questions I was trying to solve, and decided sorting by the drivers was the best and then separating out the ride data. I didn't change my approach, but I did change the name of the array away from driver_id
What was your strategy for going through the data structure and gathering information? I nested each loops inside of each loops to access the information within hashes and arrays.
What was an example of something that was necessary to store in a variable? Why was it necessary, useful, or helpful? I created a separate array of hashes to save information to to make it easier to recall information and save all of the calculations in one place. This made it easy to call the info for printing and cut down on code.
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 mostly used each loops. I considered map, but it didn't look like it would save me lines of code in most of my uses. I could have used it for my print variables method or any number of other each loops.
Were some calculations easier than others? Why? The total amount of money was one of the more challenging ones for me because I had to work out calling the nested information out clearly. Once I figured that out, it was much easier to complete the others.

Submitting my ride share app
@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?
Descriptive/Readable
Logical/Organized

Comment on lines +130 to +139
driver_calcs = []
driver_data.each do |driver, rides|
money_earned = 0
total_rating = 0.0
rides.each do |ride|
money_earned += ride[:cost]
total_rating += ride[:rating]
end
driver_calcs << { driver_data: driver, num_rides: rides.size, driver_money: money_earned, driver_rating: (total_rating / rides.size) }
end

Choose a reason for hiding this comment

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

Is there anything you could do to break this sort of loop down using a method?

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