An autonomous car can move only in the front and reverse. There are two walls, one in df meter front of the car and the other dr meter back of the car. The car has forward speed sf m/sec and backward speed sr m/sec. The car moves forward and backward alternatively in each second.
At the start if the signal sg = 0, car starts moving in forward direction, otherwise if sg = 1, car starts moving in backward direction. Given the inputs df, dr, sf, sr and sg, out put following
(A) Whether car will collide with any of the wall
(B) Which wall?
(B) After how many seconds
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
An autonomous car can move only in the front and reverse. There are two walls, one in df meter front of the car and the other dr meter back of the car. The car has forward speed sf m/sec and backward speed sr m/sec. The car moves forward and backward alternatively in each second.
At the start if the signal sg = 0, car starts moving in forward direction, otherwise if sg = 1, car starts moving in backward direction. Given the inputs df, dr, sf, sr and sg, out put following
(A) Whether car will collide with any of the wall
(B) Which wall?
(B) After how many seconds