Question
A robot needs to retrieve an item that is located in rocky terrain next to a road. The robot can travel at a faster speed
A robot needs to retrieve an item that is located in rocky terrain next to a road. The robot can travel at a faster speed on the road than on the rocky terrain, so it will want to do so for a certain distance before moving in a straight line to the item. Calculate by hand how much time it takes to reach the item.
Your task is to compute the total time taken by the robot to reach its goal, given the following Inputs (Figure 1):
-The distance between the robot and the item in the x- and y-direction (dx and dy)
-The speed of the robot on the road and the rocky terrain (s1 and s2)
-The length l1 of the first segment (on the road)
To test your Python program, lets make the problem more concrete. For the test case, lets assume the following dimensions (see figure 2 below with assumed values). The total time is the time for traversing both segments.
Develop the Python program that prompts user for input(s). Write your algorithm as comments in the Python program. Note that use variable names that are longer and more descriptive than dx or s1. Submit your Python program with your test running results.
Output results must show:
- x-distance to target:
- y-distance to target:
- Length of first segment:
- Speed along first segment:
- Speed along second segment:
- Total travel time:
Please submit the following 2 deliveries:
(1) Submit your Python program with the developed algorithm as comments.
(2) Submit the test case running results
Item dy Speed = $2 12 4 Speed = 1 Robot dx Figure 1 Item 3 km Speed = 2 km/h 6 km Speed = 5 km/h Robot 10 km Figure 2: Test case with assumed dimensions
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