vault backup: 2023-09-11 16:18:42
This commit is contained in:
parent
0666f58d6f
commit
226cb54ea1
@ -202,3 +202,16 @@ val rate_express : int -> float = <fun>
|
||||
| x when x = "express" -> rate_express(kg)
|
||||
| _ -> invalid_arg "Bad type of shipping class";;
|
||||
val rate : string -> int -> float = <fun>
|
||||
|
||||
(*4th question*)
|
||||
let price w (p1, p2, p3, p4) =
|
||||
if w <=500 then p1
|
||||
else if w <=1000 then p2
|
||||
else if w <=2000 then p3
|
||||
else if w <=3000 then p4
|
||||
else failwith "Too heavy";;
|
||||
val price = int -> 'a * 'a * 'a * 'a -> 'a = <fun>
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user