In one pass, Train A can start from source station at
time T[O] ,halt at each station for h unit of time until
it reaches last station at time T [n-1),where n is the
positive Integer representing total number of
stations.
Given, Train A's timings
T[0] = 10.00 T[1] = 10.04 T[2] = 10.09 T
[3] = 10.15 T[4] = 10.19 T[5] = 10.22
Now, suppose Railway Admin want to add more
trains to increase the frequency. So, to launch other
Train B, for the same stations as of Train A's.
Provided the train B starts at time t, they would like
to know the timings for train B.
The program should return a String array S
(timestamps(in float) for train B at each station from
first to last station like train A).
Note that time is represented in 24 Hour Fashion.
startHour should be in range 0... 23.
startMinute should be in range 0.... 59.
Enter start time(24 Hrs)
Example 1:
Answers
Answered by
0
Answer:
Given, Train A's timings
T[0] = 10.00 T[1] = 10.04 T[2] = 10.09 T
[3] = 10.15 T[4] = 10.19 T[5] = 10.22
Now, suppose Railway Admin want to add more
trains to increase the frequency. So, to launch other
Train B, for the same stations as of Train A's.
Provided the train B starts at time t, they would like
to know the timings for train B.
The program should return a String array S
(timestamps(in float) for train B at each station from
first to last station like train A).
Note that time is represented in 24 Hour Fashion.
startHour should be in range 0... 23.
startMinute should be in range 0.... 59.
Enter start time(24 Hrs)
Similar questions
English,
3 months ago
Computer Science,
3 months ago
Social Sciences,
7 months ago
Math,
11 months ago
Science,
11 months ago
Biology,
11 months ago