1. In this quiz, you are going to “fill in the blanks” for codes that you think are appropriate.
Need help with this assignment?Get an original answer from a qualified tutor — from $10/page.
Get it written →1. In this quiz, you are going to “fill in the blanks” for codes that you think are appropriate.
2. The following codes are written to automatically match Uber/Lyft drivers to riders requesting a ride.
3. Setting: You are an Uber driver. There are currently 100 riders requesting a ride. You want to pick up riders that meet the following two conditions:
Condition 1: Ride time that each rider requests spans 5-50 mins (the ride time is random)
Condition 2: I prefer riders with the rider time between 5 and 15 mins.
Condition 3: after all the matches, print a statement counting the total number of matched rides.
5. After filling out the blanks, the output statement should look as follows:
[O] No. 1 rider (ride time: 8 mins)
[ ] No. 2 rider (ride time: 16 mins)
[ ] No. 3 rider (ride time: 38 mins)
…
[ ] No. 99 rider (ride time: 21 mins)
[O] No. 100 rider (ride time: 10 mins)
Total riders matched: 2
6. Once you complete codes, save and name the file as “Lastname_Firstname
Suggestions
1. First, you will create 100 riders.
2. Second, you will create the rider time (5-50 mins) for each rider (random function).
3. Third, if the rider time matches my conditions, print statement and increase the count. Otherwise (“else”) print another statement indicating not matched.
4. Make sure that you write codes in detail so that anyone without Python background can run your codes by copying and pasting onto Visual Studio Codes. For example, if a package is required to run your code, you are to include the codes that import necessary packages. If directions/instructions are required when running your codes, include the directions/instructions hashed out.
Get a plagiarism-free answer to this question
Send us your instructions and we’ll match you with the best writer in your subject.
- 100% human-written, zero AI
- Turnitin report included
- Confidential — we never share your data
- Free revisions & refunds