Question

In: Computer Science

Yasha swam in a pool the size of the NxM meters and was tired. At this...

Yasha swam in a pool the size of the NxM meters and was tired. At this point, he discovered that he was at an X-meter distance from one of the long sides (not necessarily from the nearest one) and the Y meters from one of the short sides. What is the minimum distance Yasha must travel to get out of the pool to the side?
Input format
The program receives the entry of the number N, M, X, Y.

python

Solutions

Expert Solution

N=float(input("Enter Value of N: "))       #taking input for N
M=float(input("Enter Value of M: "))       #taking input for M
X=float(input("Enter Value of X: "))       #taking input for X
Y=float(input("Enter Value of Y: "))       #taking input for Y

if N>M:
    length=N
    breadth=M

else:
    length=M
    breadth=N

print(f"minimum distance is: {min(X,Y,breadth-X,length-Y)}")       #min function will return the min of all the numbers

you can copy paste the following code::

N=float(input("Enter Value of N: "))       #taking input for N

M=float(input("Enter Value of M: "))       #taking input for M

X=float(input("Enter Value of X: "))       #taking input for X

Y=float(input("Enter Value of Y: "))       #taking input for Y

if N>M:

    length=N

    breadth=M

else:

    length=M

    breadth=N

print(f"minimum distance is: {min(X,Y,breadth-X,length-Y)}")       #min function will return the min of all the numbers


Related Solutions

A coordinate system (in meters) is constructed on the surface of a pool table, and three...
A coordinate system (in meters) is constructed on the surface of a pool table, and three objects are placed on the table as follows: a 2.0-kg object at the origin of the coordinate system, a 6.0-kg object at (0, 2.0), and a 11.0-kg object at (4.0, 0). Find the resultant gravitational force exerted by the other two objects on the object at the origin.
Exercise 1: Consider a financial institution with a mortgage pool with a total size of 200000...
Exercise 1: Consider a financial institution with a mortgage pool with a total size of 200000 USD. The loan to value ratio is 80 and 90 percent. The capital requirement is 8% The deposit insurance premium equals 0.45%. The reserve requirement ratio is 10%. a) Calculate the capital requirements. b) Calculate the reserve requirements. c) Calculate the deposit insurance premium.
Exercise 1: Consider a financial institution with a mortgage pool with a total size of 200000...
Exercise 1: Consider a financial institution with a mortgage pool with a total size of 200000 USD. The loan to value ratio is 80 and 90 percent. The capital requirement is 8% The deposit insurance premium equals 0.45%. The reserve requirement ratio is 10%. a) Calculate the capital requirements. b) Calculate the reserve requirements. c) Calculate the deposit insurance premium.
There is a common pool resource of size 1000. Two firms use the resource in two...
There is a common pool resource of size 1000. Two firms use the resource in two periods. In the first period, the firms simultaneously and independently decide how much of the resource to use. Let x1 and x2 denote the corresponding amounts of the resource the firms use in the first period. In the second period, the remaining resource is shared equally between the firms, i.e., each of them gets [1000-(x1+x2)]/2. Each firm receives utility √ from using x units...
2. There is a common pool resource of size 1000. Two firms use the resource in...
2. There is a common pool resource of size 1000. Two firms use the resource in two periods. In the first period, the firms simultaneously and independently decide how much of the resource to use. Let x1 and x2 denote the corresponding amounts of the resource the firms use in the first period. In the second period, the remaining resource is shared equally between the firms, i.e., each of them gets [1000-(x1+x2)]/2. Each firm receives utility √ from using x...
You are asked to design a piping system to fill an Olympic size swimming pool. The...
You are asked to design a piping system to fill an Olympic size swimming pool. The nominal dimensions of the pool are 164 ft long, 82 ft wide and 6 ft deep, and the filling is to take place in 6 hours. The 60 F water supply is contained in a reservoir 75 ft below the nominal elevation of the pool and contains 500 feet of 6-inch diameter cast iron pipe with 4 standard 90° elbows and 1 (fully open)...
Consider a pool of 500 mortgages with the average size being $500 thousands, which is expected...
Consider a pool of 500 mortgages with the average size being $500 thousands, which is expected to be paid off in 30 years with fortnightly frequency (26 payments per year). The annual mortgage interest is 5%. Estimate the value of fortnightly mortgage payments from the pool . Suppose that the servicing fee is 0.6%, fill in the following table . Fortnight Begnning mortgage pool Mortgage pool payment Servicing fee Net interest Scheduled principal repayment End of month balance 1 2...
Consider a pool of 800 mortgages with the average size being $500 thousands, which is expected...
Consider a pool of 800 mortgages with the average size being $500 thousands, which is expected to be paid off in 20 years with fortnightly frequency (26 payments per year). The annual mortgage interest is 4.5%. Estimate the value of fortnightly mortgage payments from the pool . Suppose that the servicing fee is 0.7%, fill in the following table . Fortnight Begnning mortgage pool Mortgage pool payment Servicing fee Net interest Scheduled principal repayment End of month balance 1 2...
A rectangular room is 12 meters long, 6 meters wide, and 3 meters high. 1] Calculate...
A rectangular room is 12 meters long, 6 meters wide, and 3 meters high. 1] Calculate the first three axial modes for the length of the room.   2] Find the wavelength, then convert to frequencies, assuming that the speed of sound in the room is 343 m/s. 3] Calculate the first 3 axial modes [Wavelenghts and frequencies] for the width of the room. 4] Calculate the first axial modes [Wavelenghts and frequencies] for the height of the room. It is...
A swim club is designing a new pool to replace its old pool. The new pool...
A swim club is designing a new pool to replace its old pool. The new pool would need to last for 10 years since the club is planning on relocating after 10 years. A concrete shell would cost $85,000 and last for all 10 years. Another option is to install a vinyl liner that would cost only $70,000 to install. However, the vinyl is not guaranteed to last for all 10 years, and it has a 40% chance of breaking...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT