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

time_lola #46

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

time_lola #46

wants to merge 2 commits into from

Conversation

ubeninja77
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? My data structure started off as an array within an array that was sorted by date. It eventually became a hash sorted by driver ids.
What was your strategy for going through the data structure and gathering information? I went though the data and tried to organize the structure to be easily accessible when pulling the data (i made 5 versions).
What was an example of something that was necessary to store in a variable? Why was it necessary, useful, or helpful? I stored the variables for highest rated driver and the drivers with most earning . It was useful and necessary because I need the data to compare with the next one and decide to replace it or not to get the driver that has highest average rating or the driver that earned the most .
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 did not use .map. Looking at the the code, i would have used it for the comparison of the driver most earning and the highest rated.
Were some calculations easier than others? Why? Yes, I used an each loop to answer the each question. I recycled that each loop to answer the questions. Looking back, I could have made a method to answer the questions.

@ubeninja77 ubeninja77 changed the title lola_time time_lola Feb 10, 2020
@kaidamasaki
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 Did not define 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 Mostly.
... 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

Additional Feedback

Good job! This is a small program but in the future it would be helpful to organize your code using methods. Also, you may want to read up on how to use Floats in Ruby.

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


# 3. The average rating for each driver
drivers_data.each do |driver_id, trips|
ratings = 0

Choose a reason for hiding this comment

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

Ratings need to use floating point math since we're planning to get an average and want things like 4.67 as an answer.

Because of the way Ruby converts things if you have one floating point value everything winds up floating point so if you start with 0.0 you should get the correct math. (Though note that with floating point math you will want to round before you display things.)

Suggested change
ratings = 0
ratings = 0.0

highest_avg_rating = 0;
driver_info = 0;
drivers_data.each do |driver_id, trips|
ratings = 0;

Choose a reason for hiding this comment

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

You should also use floating point math here. See above.

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