variables - Defining Numerical Values in Racket -


forgive me, starting racket, question may simple answer. trying design function when given integer represents distance in miles return time (in hours) takes travel distance when going 60 mph. know basic python, familiar programming.. not know how set type of function in racket.

first have declare function parameter, this:

(define (calculate-time distance)   ...) 

and then, perform actual calculation. remember, in scheme use prefix notation:

(define (calculate-time distance)   (/ distance 60.0)) 

for example, cover distance of 600 miles, it'll take 10 hours:

(calculate-time 600) => 10.0 

Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -