Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C++ code please 6.16 Custom Lab: Functions :Ridesharepickuptime Rideshare companies like Uber or Lyft track the x.y coordinates of drivers and customers on a map.
C++ code please
6.16 Custom Lab: Functions :Ridesharepickuptime Rideshare companies like Uber or Lyft track the x.y coordinates of drivers and customers on a map. If a customer requests a ride, the company's app estimates the minutes until the nearest driver can arrive. Write a function that, given the x and y coordinates of a customer and the three nearest drivers, returns the estimated pickup time. Assume drivers can only drive in the xor y directions (not diagonal), and each mile takes 2 minutes to drive. All values are integers. Hints: - Break the problem into three parts. In the first part, compute the three distances. - In the second part, determine the minimum distance. In the third part, compute and return the time. - Don't forget to use absolute value when computing the x distance, and again for the y distance, because direction doesn't matter. You may wish to just write a small absolute value function. Run your program as often as you'd like, before submitting for grading Below, type any needed input values in the first box, then click Run program and observe the program's output in the Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started