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

Update worksheet.rb #40

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

Update worksheet.rb #40

wants to merge 1 commit into from

Conversation

indiakato
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? At first my data structure was a combination of arrays and hashes. It ended up with a combination of arrays and hashes, but with a slightly different structure. I started with a hash for trips but ended up making it an array of hashes instead. This changed because it made the data better to parse and easier to work with.
What was your strategy for going through the data structure and gathering information? My strategy was going through the data and seeing which data points should be grouped together then going from there. I started with the large "grouping" then kept going smaller from there, which allowed me to think through my nesting structure as I went along.
What was an example of something that was necessary to store in a variable? Why was it necessary, useful, or helpful? Something that was necessary to store in a variable was the driver id associated with the data. This was necessary because many of the questions required that the code outputted the rider with some sort of data. By having the driver id stored in a variable, it made it easier to output/associate data with eachother.
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 and .map. I used .map when i wanted to print out all the data on separate lines while iterating through the initial hash of driver id.
Were some calculations easier than others? Why? The first two calculations were easier than the last two. The ones where it was asking for which driver had the highest pay out or the highest average rating was harder because you had to compare data as opposed to just printing out the data in the first two questions.

@jmaddox19
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

Great work!

A couple things to note:
The rating math is being done with integer-math rather than decimal-math, causing it to be less precise than it could be. For example Driver 4 is given an average rating of 4, which seems to be rounding down from 4.67.
The later methods like highest_rated could benefit make use of earlier methods (average_rating, in this case) to limit the amount of repeated code.

But again, great work! Your data structure and methods are all readable :)

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

@jmaddox19
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

Great work!

A couple things to note:
It appears the rating math is being done with integer-math rather than decimal-math. For example Driver 4 is given an average rating of 4.0, which seems to be rounding down from 4.67.
The later methods like highest_rated could benefit make use of earlier methods (average_rating, in this case) to limit the amount of repeated code.

But again, great work! Your methods are all very readable as is the console output. :) Your total_earnings and average_rating methods are especially concise due to the clever use of sum!

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