Computer Science, asked by Huzaifa1622, 1 year ago

Tony crosses a street that is x m long in Y minutes write an algorithm to compute his speed in kilometre per hour
given x and y​

Answers

Answered by rishabhsingh0156
8

by using python 3

print('Algorithm')

x = int(input('Enter Meter: '))

y = int(input('Enter Minute: '))

# changing unit

xk = x/1000 # now it is in km

yh = y/60 # now it is in hour

speed = (xk/yh)

print('Tony covers',x,'meters in',y,'minutes with speed of',speed,'km/hour')

Answered by iadarsh
29

Answer:

Algorithm for Calculating Speed:

START

1. Take two numbers as input and store them in the variables x and y.

2. Divide x by 1000 to convert the distance into Kilometers. (x = x / 1000)

3. Divide y by 60 to convert the minutes into hours. (y = y / 60)

4. Now, to find the speed use the formula speed = distance/time (speed = x / y)

5. And then, print the speed.

END

Explanation:

Similar questions