Skip to content

Sammi-Jo's ride share! (nodes)#34

Open
sjlee3157 wants to merge 6 commits into
Ada-C10:masterfrom
sjlee3157:patch-1
Open

Sammi-Jo's ride share! (nodes)#34
sjlee3157 wants to merge 6 commits into
Ada-C10:masterfrom
sjlee3157:patch-1

Conversation

@sjlee3157

@sjlee3157 sjlee3157 commented Aug 13, 2018

Copy link
Copy Markdown

ride share

Congratulations! You're submitting your assignment.

Comprehension Questions

Question Answer
What did your data structure look like at first? Did this structure evolve over time? Why? At first, I didn't write it in code--see below. No, I ended up working with what I began with.
What was your strategy for going through the data structure and gathering information? A very useful strategy was to know what kind of data structure I wanted to gather my information IN. From there it was useful to visualize things in pseudocode, and to remember that an array is just simply a list!
What was an example of something that was necessary to store in a variable? What was the scope of each of that variables? Why? top_driver is a hash that was created outside of any other method because I wanted methods to create/return objects to fill it with. top_driver is not natively accessible to methods, so it has to be passed in as an argument. The objects that other methods fill it with had to be returned, because they have no scope outside of the method.
What kinds of iteration did you use? Did you use .map? I used .reduce a lot! I had to use .each to do a multi-part task (line 122), but .reduce did a lot of work for me elsewhere. I used .map once to identify the top scorer(s) by driver id.
Were some calculations easier than others? Why? "best day" and top drivers were more complex because there were potentially multiple results. My solution was to store results in an array.
MASTER HASH
DRIVERS:
        DRIVER_ID:     RIDES:
                            DATE:   COST:   RIDER_ID:   RATING:
                            DATE:   COST:   RIDER_ID:   RATING:
                            DATE:   COST:   RIDER_ID:   RATING:
                            DATE:   COST:   RIDER_ID:   RATING:
        DRIVER_ID:     RIDES:
                            DATE:   COST:   RIDER_ID:   RATING:
                            DATE:   COST:   RIDER_ID:   RATING:
                            DATE:   COST:   RIDER_ID:   RATING:
                            DATE:   COST:   RIDER_ID:   RATING:
        DRIVER_ID:     RIDES:
                            DATE:   COST:   RIDER_ID:   RATING:
                            DATE:   COST:   RIDER_ID:   RATING:
                            DATE:   COST:   RIDER_ID:   RATING:
                            DATE:   COST:   RIDER_ID:   RATING:
        DRIVER_ID:     RIDES:
                            DATE:   COST:   RIDER_ID:   RATING:
                            DATE:   COST:   RIDER_ID:   RATING:
                            DATE:   COST:   RIDER_ID:   RATING:
                            DATE:   COST:   RIDER_ID:   RATING

@sjlee3157 sjlee3157 changed the title Sammi-Jo's ride share! Sammi-Jo's ride share! (nodes) Aug 13, 2018
@CheezItMan

CheezItMan commented Aug 17, 2018

Copy link
Copy Markdown

Wow, nice work with the table and sorting of data, really nice work! You hit all the learning goals for the project! Sorry for missing the top earners and top-rated messages earlier.

Comment thread ride-share.rb

master = {
drivers: [
{ driver_id: "DR0002" ,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Do watch your alignments here.

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