Question: Write a Python program that implements the algorithm given below. This program takes xy coordinates and the capacity of two tanks. Finds whether both tanks

 Write a Python program that implements the algorithm given below. This

Write a Python program that implements the algorithm given below. This program takes xy coordinates and the capacity of two tanks. Finds whether both tanks are within 1km range. If so, it finds the total capacity and prints it. Main program: 1) Start 2) Input location of first tank (x1,y1) and capacity of first tank c1 (You can take input separately as x1, y1 or like a tuple.) 3) Input location of second tank (x2,y2) and capacity of second tank c2 4) Check whether the tanks are closer than 1km: call function: isCloser(x1.y1.x2,y2) 5) If Yes, find total capacity: call function: totcap=sum(c1.c2) 6) print totcap 7)end Function isCloser(x1,y1,x2,42) 1) 2) 3) 4) Start dist={(x1-x2)^2+(y1-y2)^2)^(0.5) if dist

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!