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

Create sara_nilsen.rb #32

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

Conversation

sarabrandao21
Copy link

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 nested more than I needed, I thought each driver needed an index, I then just had the driver id to be the key of a nested hash with the driver id key value being an array of hashes
What was your strategy for going through the data structure and gathering information? I used methods to loop and gather the information needed.
What was an example of something that was necessary to store in a variable? Why was it necessary, useful, or helpful? When I want to find the driver that earned most, I create a variable outside of the loop with a default value to compare it and assign with the highest number each time.
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 map to get the average rating, because i needed a new array to store the new information I was getting and later use the length to divide with the total rating.
Were some calculations easier than others? Why? getting the rating average and total money were more challenging to me

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

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 ✔️
Yellow (Approaches Standards) 2-3 in Code Review && 2+ in Functional Requirements
Red (Not at Standard) 0,1 in Code Review or 0,1 in Functional Reqs, or assignment is breaking/doesn’t run with less than 5 minutes of debugging

Code Style Bonus Awards

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

Quality Yes?
Perfect Indentation
Concise

@@ -0,0 +1,131 @@
uber_data =
{
"DR0001": [

Choose a reason for hiding this comment

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

Is there a good reason to use a string here rather than a symbol?

Comment on lines +102 to +120
puts "Driver amount of rides"
uber_data.each do |driver, info|
puts "Driver #{driver}: #{info.length} rides."
end
puts ""
most_money = 0
driver_most_money = ""
puts "Total amount earned by each driver"
uber_data.each do |driver, info|
total_money = get_total_money(info)
puts "Driver #{driver}: $#{total_money}"
if total_money > most_money
most_money = total_money
driver_most_money = driver
end
end
puts ""
most_average = 0
driver_most_average = ""

Choose a reason for hiding this comment

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

It would be nice if you broke different sections into chunks using new lines, that way I can read relevant code groupings as a chunk.

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