-
Notifications
You must be signed in to change notification settings - Fork 54
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 Ada-C14-Taylor #52
base: master
Are you sure you want to change the base?
Conversation
Hopefully I'm re-submitting this right? If the dates are still in this format: "2016,2,3" please let me know because I changed some things after submitting the first time and I want to make sure the right code is being saved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a big deal, but I think you missed the part of the instructions about putting your code in worksheet.rb
(there were helpful comments there to make your life easier, but you got it done anyway, so good job!).
One thing I would like you to focus on going forward is getting a better handle on using enumerable methods. Specifically using each
instead of doing an array.length.times
and using more specialized methods like sum
where appropriate. (See the comment I left as an example.)
You managed to get the job done but in the future I think you will find you can get things done more quickly and easily if you read up on some more of what Ruby has to offer. 😃
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 | For many of the calculations you didn't iterate over the inner arrays, you just used repeated addition. |
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 | |
Elegant/Clever | |
Descriptive/Readable | |
Concise | |
Logical/Organized | ✅ |
i = 0 | ||
array.length.times do | ||
puts "Driver DR000#{i + 1} gave #{array[i].length} rides" | ||
i += 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Funky indentation:
i += 1 | |
i += 1 |
if array[i].length == 3 | ||
puts "Driver DR000#{i +1} made $#{array[i][0][:cost] + array[i][1][:cost] + array[i][2][:cost]}" | ||
else | ||
puts "Driver DR000#{i + 1} made $#{array[i][0][:cost] + array[i][1][:cost]}" | ||
end | ||
i += 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can clean this up using sum
on the inner array:
if array[i].length == 3 | |
puts "Driver DR000#{i +1} made $#{array[i][0][:cost] + array[i][1][:cost] + array[i][2][:cost]}" | |
else | |
puts "Driver DR000#{i + 1} made $#{array[i][0][:cost] + array[i][1][:cost]}" | |
end | |
i += 1 | |
puts "Driver DR000#{i +1} made $#{array[i].sum {|ride| ride[:cost] }}" | |
i += 1 |
Hopefully I'm re-submitting this right? If the dates are still in this format: "2016,2,3" please let me know because I changed some things after submitting the first time and I want to make sure the right code is being saved.
Assignment Submission: Ride Share
Congratulations! You're submitting your assignment. Please reflect on the assignment with these questions.
Reflection
.map
? If so, when? If not, why, or when would be a good opportunity to use it?