Skip to content

Space - Shonda#25

Open
Shonda860 wants to merge 2 commits intoAda-C13:masterfrom
Shonda860:master
Open

Space - Shonda#25
Shonda860 wants to merge 2 commits intoAda-C13:masterfrom
Shonda860:master

Conversation

@Shonda860
Copy link

Ride-Share project Stage 1

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 I tried to set up the data in a hash of hashes. One hash of data and each trip info had its own hash
What was your strategy for going through the data structure and gathering information? I wanted to keep all the info together so it was matched easily. I wanted to able to just search the highest and lowest outside
What was an example of something that was necessary to store in a variable? Why was it necessary, useful, or helpful? sorting the empty data in an empty hash made it easier to sort the info
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 primarily used each, however, I did use the map method, however, I do not believe it was used correctly
Were some calculations easier than others? Why? the calculations own were easier once I figured out how to loop through the nested data

Ride-Share project Stage 1
@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 ✔️, mostly you have a bug accessing the most expensive trip date.
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 ✔️ You have the most profitable driver identified, but not how much they made.
... 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 ⚠, some indentation issues.
Elegant/Clever ✅, I like your organization, but you could have broken things into methods.
Descriptive/Readable ⚠ somewhat hard to read.
Logical/Organized ⚠ could be better by breaking each step into a method which you could then call.

Summary

Nice work, some things to look at, but it does what's required.

#this loop identifies each driver(s) id
driver_info.each do |driver|

#outputs drivers id

Choose a reason for hiding this comment

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

You need to do some indentation here!


#The number of rides each driver has given
puts "DRIVER #{driver[:driver_id]} DROVE #{drivers_cost_totals.count} rides."
puts "On #{driver[:date]} driver made $#{drivers_cost_totals.max}"

Choose a reason for hiding this comment

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

⚠️ There doesn't seem to be a :date key in driver. That's a field in the elements of the trips array.

Suggested change
puts "On #{driver[:date]} driver made $#{drivers_cost_totals.max}"
puts "On #{driver[:date][:trips][ SOME_INDEX_HERE ][:date] } driver made $#{drivers_cost_totals.max}"


# The average rating for each driver
puts "DRIVER #{driver[:driver_id]} DROVE #{(driver_total_ratings.sum/driver_total_ratings.length).round(2)}"
end

Choose a reason for hiding this comment

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

I would put a visual break between each driver's summary, just for readability on the output.

Suggested change
end
puts "=======\n"
end

moved driver_id's down one for readability

Co-Authored-By: Chris M <chris@adadevelopersacademy.org>
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