Skip to content

Leaves - Dominique#41

Open
dtaylor73 wants to merge 1 commit intoAda-C12:masterfrom
dtaylor73:master
Open

Leaves - Dominique#41
dtaylor73 wants to merge 1 commit intoAda-C12:masterfrom
dtaylor73:master

Conversation

@dtaylor73
Copy link

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? Originally, the keys for the drivers_statistics hash were dates instead of driver ids, and the values of those keys began with driver_id. However, I found this to be repetitive and eventually just switched the keys to the driver ids.
What was your strategy for going through the data structure and gathering information? I determined that I would need to use an each loop on the overall hash to access the keys, but it was a little harder to extract the information from the hashes that are the driver id values. I knew I would need to create a loop within a loop.
What was an example of something that was necessary to store in a variable? Why was it necessary, useful, or helpful? For example, it was necessary to store the driver's ratings in an array and assign it to a variable. This was useful because I used the array later in the program to output the driver with the highest rating.
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 two each loops - one nested within the other. I did not use .map in this program, but I could use it to output the driver with the highest rating from the "total_driver_ratings" array.
Were some calculations easier than others? Why? "Number of rides given" and "total driver earnings" per driver were easier to create than "average rating" of each driver. The first two answers were made by using the .length and .sum methods, while the "average rating" solution required a division operator

@dHelmgren
Copy link

Ride Share

What We're Looking For

Feature Feedback
Answers the comprehension questions yes
Readable code with consistent indentation and reasonable code style yes
Outputs the correct number of rides each driver has given yes
Outputs the total amount of money each driver has made yes
Outputs the average rating for each driver yes
Outputs which driver made the most money yes
Outputs which driver has the highest average rating yes

Great work here! Your code solves the problem correctly. It looks to me like you might be using some sort of online IRB like, and I want to take a second to ask you to change your workflow. Very soon, we will be writing multi-file applications, and at that point online tools will fail to do what you need.

Again, keep up the hard work, nice job on this assignment.


"\nDriver #{driver_id}:"
"\nNumber of rides given - #{drivers_statistics[driver_id].length} rides"
"Total amount of money made - $#{(total_driver_earnings.sum)}"

Choose a reason for hiding this comment

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

it looks like you formatted strings, but didn't print or puts them. Was this copied in from a web based tool?

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