6 kyu
Ball Upwards
2,214 of 8,241g964
Description:
You throw a ball vertically upwards with an initial speed v0 (in km per hour)
.
The height h
of the ball at each time t
is given by , where g
is the Earth's gravity .
A device is recording at every tenth of second the height of the ball.
For example, with v0 = 15 km/h
, the device gets something of the following form:
(0, 0.0), (1, 0.367...), (2, 0.637...), (3, 0.808...), (4, 0.881..) ...
where the first number is the time in tenths of a second and the second number the height in meter.
Task
Write a function with a parameter v0 (in km per hour)
that returns the time in tenth of second
of the maximum height recorded by the device.
Examples
Given initial speed v0 = 15 --> should return 4
Given initial speed v0 = 25 --> should return 7
Notes
- Remember to convert the velocity from km/h to m/s or from m/s to km/h when necessary.
- The maximum height recorded by the device is not necessarily the maximum height reached by the ball.
Fundamentals
Similar Kata:
Stats:
Created | Dec 12, 2015 |
Published | Dec 12, 2015 |
Warriors Trained | 27247 |
Total Skips | 7662 |
Total Code Submissions | 43237 |
Total Times Completed | 8241 |
Python Completions | 2214 |
JavaScript Completions | 1427 |
Java Completions | 780 |
C# Completions | 370 |
CoffeeScript Completions | 14 |
Haskell Completions | 123 |
Clojure Completions | 60 |
Ruby Completions | 156 |
Elixir Completions | 116 |
TypeScript Completions | 168 |
C++ Completions | 772 |
PHP Completions | 207 |
Crystal Completions | 15 |
F# Completions | 62 |
C Completions | 445 |
OCaml Completions | 52 |
Rust Completions | 312 |
Swift Completions | 188 |
Go Completions | 368 |
Shell Completions | 74 |
R Completions | 75 |
Nim Completions | 23 |
Objective-C Completions | 26 |
Kotlin Completions | 171 |
Fortran Completions | 26 |
Julia Completions | 39 |
NASM Completions | 21 |
Scala Completions | 129 |
PowerShell Completions | 37 |
Reason Completions | 11 |
Racket Completions | 32 |
Forth Completions | 15 |
Prolog Completions | 18 |
Haxe Completions | 9 |
CommonLisp Completions | 100 |
Dart Completions | 119 |
Pascal Completions | 15 |
Raku Completions | 7 |
Lua Completions | 40 |
Perl Completions | 14 |
COBOL Completions | 10 |
Elm Completions | 6 |
D Completions | 9 |
Erlang Completions | 8 |
Total Stars | 405 |
% of votes with a positive feedback rating | 79% of 1182 |
Total "Very Satisfied" Votes | 800 |
Total "Somewhat Satisfied" Votes | 268 |
Total "Not Satisfied" Votes | 114 |