Skip to content

Leaves_Ga-Young#42

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

Leaves_Ga-Young#42
gyjin wants to merge 1 commit intoAda-C12:masterfrom
gyjin:master

Conversation

@gyjin
Copy link

@gyjin gyjin commented Aug 12, 2019

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? My data structure actually didn't change too much over time. I think this was because I made a preemptive effort to look at what the program was supposed to do and decided to store my data accordingly.
What was your strategy for going through the data structure and gathering information? I tried to see which part of the data seemed more fitting for a hash (like having multiple information related to one item) or an array, where I could just list a series of items that were similar. In this case, all the drivers had drives, so it seemed fitting to put them in an array. Each driver had multiple drives, so that could be an array, but each drive had information about rider, cost, rating, etc, so it was more fitting to store that in a hash.
What was an example of something that was necessary to store in a variable? Why was it necessary, useful, or helpful? To calculate the total amount of money each driver made, that value had to be stored in a variable. Because the value was changing with each iteration (adding the price of the next drive), storing in a variable seemed the most effective method to hold the previous value, add to it, and eventually print it.
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 only ".each" iterations in this code. I spent some time trying to use the ".map" iteration, but I was having difficulty getting the program to store and print the data properly. I think it's better to use the ".map" iteration when you are storing a different value in the same array or hash size, and need to print out those values. In this program, I feel every portion could have found the ".map" iteration helpful, especially in finding the highest or lowest value.
Were some calculations easier than others? Why? I found the calculations that asked to output the driver who made the most money and the driver with the highest average rating were the hardest. For these portions, not only did I have to calculate the values to compare among the drivers, I had to compare the values and store the "winning" driver in a separate variable.

rideshare_data = [
[
{ driver: "DR0001",
date: "3rd Feb 2016",

Choose a reason for hiding this comment

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

You have these arrays grouped by driver, but chose to leave the data inside these hashes, even though it's redundant. When I see groupings like this, it makes me think the outermost layer should probably be a hash!

@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

Good work on this! Your code is readable and well laid out!

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