Problem Statement
Your program should return an
Definition
- Class:
- FastSpider
- Method:
- findTime
- Parameters:
- double, double
- Returns:
- int
- Method signature:
- int findTime(double spiderSpeed, double manSpeed)
- (be sure your method is public)
Notes
- Don't forget that while the man is walking he is stretching the band, which moves the spider with it.
- All movement is continuous.
Constraints
- spiderSpeed will be between 0.2 and 0.5, inclusive.
- manSpeed will be between 1 and 5, inclusive.
- The answer, prior to rounding, will not be within 0.01 of x.5 for any integer x.
- If the spider will ever overtake the man, it will take 1 hour (3600 seconds) or less.
Examples
0.25
1
Returns: 54
0.5
1
Returns: 6
0.5
4.8877377
Returns: 3600
0.2
1
Returns: 147
0.47
2.78
Returns: 133
0.23237120490148247
1.3861233623877531
Returns: 280
0.4860346899195756
2.1453090856549557
Returns: 38
0.3893122084936773
1.3775108049378084
Returns: 24
0.22192978592904428
1.2179259257344017
Returns: 198
0.4337737603217932
1.091448852734342
Returns: 10
0.4614311459654846
3.7619849110399772
Returns: 923
0.37935574071561684
1.7729609003439992
Returns: 60
0.2865618752931029
1.777203892905189
Returns: 277
0.29099121644108056
1.6774062722861003
Returns: 189
0.45570150300173223
2.80458595082542
Returns: 168
0.3049742992182573
1.5922319450854472
Returns: 116
0.4216300548816815
3.223493194659371
Returns: 648
0.46503486836221286
3.8548576573670252
Returns: 1033
0.3617935378639448
2.3538538806281015
Returns: 284
0.4719693229540898
3.5402887877668636
Returns: 511
0.406814213831339
1.4749308802703385
Returns: 25
0.24517434438026817
2.181079373387396
Returns: 3348
0.3418729955154742
2.2681865966398957
Returns: 335
0.495274020717714
3.4950643511536716
Returns: 332
0.4884484221062418
2.794435616043163
Returns: 109
0.47
2.78
Returns: 133
0.25
1.0
Returns: 54
0.5
4.8877377
Returns: 3600