Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 112 additions & 0 deletions rideshare.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
# So, I couldn't find my original file where I commented out the beginning explaing some issues
# I was having and explained that most of my code was broken and
# commented out as well, this is just my data structure and some notes
# I must have saved it somewhere weird, but either way, my code
# to turn in was broken

driver_id = {
dr001: [
{
date: "3rd Feb 2016",
cost: 10.00,
rider_id: "RD0003",
rating: 3,
},
{
date: "3rd Feb 2016",
cost: 30.00,
rider_id: "RD0015",
rating: 4,
},
{
date: "5th Feb 2016",
cost: 45.00,
rider_id: "RD0003",
rating: 2,
}
],
dr002: [
{
date: "3rd Feb 2016",
cost: 25.00,
rider_id: "RD0073",
rating: 5,
},
{
date: "4th Feb 2016",
cost: 15.00,
rider_id: "RD0013",
rating: 1 ,
},
{
date: "5th Feb 2016",
cost: 35.00,
rider_id: "RD0066",
rating: 3,
}
],
dr003: [
{
date: "4th Feb 2016",
cost: 5.00,
rider_id: "RD0066",
rating: 5,
},
{
date: "5th Feb 2016",
cost: 50.00,
rider_id: "RD0003",
rating: 2,
}
],
dr004: [
{
date: "3rd Feb 2016",
cost: 5.00,
rider_id: "RD0022",
rating: 5,
},
{
date: "4th Feb 2016",
cost: 10.00,
rider_id: "RD0022",
rating: 4,
},
{
date: "5th Feb 2016",
cost: 20.00,
rider_id: "RD0073",
rating: 5,
}
]
}


# number of rides each driver has given



# driver_id.each do |rides|

# end



# total amount of money each driver has made
# total_money = []

# driver_id[dr001][1][:cost]


# average rating for each driver
# average_rating = []



# which driver made the most money
# total money



# which driver has the highest average rating
highest_average_rating