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 - Yieni #28

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

Space - Yieni #28

wants to merge 1 commit into from

Conversation

yieknee
Copy link

@yieknee yieknee 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? My first data structure had an array of hashes. The keys in the outer has were the dates and the values to the dates was an array of hashes. When I looked at the questions and attempted to iterate over my code, the code was clunky and took twice as long to get the answer. I realized that I could optimize the data structure by swapping the date with the driver.
What was your strategy for going through the data structure and gathering information? My strategy for going through my data structure was seeing how easily I could access certain data. I used a lot of puts statements to confirm if what I had mentally mapped out was correct. If it wasn't, I went back and amended.
What was an example of something that was necessary to store in a variable? Why was it necessary, useful, or helpful? It was necessary to store my hashes, arrays, and final outputs to my iterations in variables so it would be easier to use them in another line of code without having to write out the long hand.
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 the .each iteration. I did not use the enumerable .map because I did not need to transform any of my arrays or hashes.
Were some calculations easier than others? Why? Yes, some calculations were easier than others. For instance to calculate the driver who made the most money, and the diver with the highest rating, I called on the methods I created for finding how much each driver made and the average rating for each driver.

@CheezItMan
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 ✔️, good methods, just see my note on organization.

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 ✔️

Code Style Bonus Awards

Was the code particularly impressive in code style for any of these reasons (or more...?)

Quality Yes?
Perfect Indentation ⚠ use 2-space indents in the future.
Elegant/Clever
Descriptive/Readable
Concise
Logical/Organized ✅, I like the methods, just move the method definitions to the top and main driver code at the bottom.

Summary

Overall well done. See my notes, but it's mostly cosmetic changes to your code. You hit all the learning goals here.

puts "How many trips did each driver make?"
puts "\n"

def driver_trips(ride_share_rides)

Choose a reason for hiding this comment

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

I like the methods here, but I suggest putting the method bodies/definitions at the top of the file and the main program code below, so the method bodies don't break up the flow of the program. Let me know if this is unclear.

@@ -0,0 +1,253 @@
ride_share_trips = [

Choose a reason for hiding this comment

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

I strongly suggest setting your default indentation to 2 spaces.

@@ -0,0 +1,253 @@
ride_share_trips = [
{
'DR001' => [

Choose a reason for hiding this comment

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

You could also use symbols as keys

Suggested change
'DR001' => [
DR001: [

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