vault backup: 2023-09-07 21:58:53

This commit is contained in:
2023-09-07 21:58:53 +02:00
parent a7a9e908a8
commit 9986a83aa1
2 changed files with 49 additions and 3 deletions

View File

@ -3,6 +3,24 @@
"id": "6771390cbd136862",
"type": "split",
"children": [
{
"id": "dcf6a812f6fe360b",
"type": "tabs",
"children": [
{
"id": "26ca4bd66426e29b",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "Algo/Séminaire/Chapter 3 - Case analysis.md",
"mode": "source",
"source": false
}
}
}
]
},
{
"id": "f0451c5f7b886938",
"type": "tabs",
@ -69,7 +87,8 @@
}
],
"direction": "horizontal",
"width": 300
"width": 300,
"collapsed": true
},
"right": {
"id": "b83c16dd7908c658",
@ -149,10 +168,10 @@
"active": "bdba25946b821d06",
"lastOpenFiles": [
"Algo/Séminaire/Chapter 3 - Case analysis.md",
"Algo/Séminaire/Exercices seminaire.md",
"Algo/Séminaire/Chapter 2 - Functions.md",
"Algo/Séminaire/Chapter 1 - CAML basics.md",
"Algo/Séminaire/Introduction.md",
"Algo/Séminaire/Exercices seminaire.md",
"Algo/Séminaire/assets/69E2987C-209A-48CD-8964-5A60462966E5.jpg",
"Algo/Séminaire/assets",
"Algo/Séminaire/assets/F1D2AA19-E790-4022-AFFF-F778EAB28AB5.jpg",

View File

@ -170,4 +170,31 @@ val highest_square_sum : int -> int -> int -> int = <fun>
```
## Exercise 3.6
## Exercise 3.7
```Ocaml
# let rate_eco kg = match kg with
x when x <= 500. -> 3.40
| x when x <=1000. -> 4.60
| x when x <= 2000. -> 5.10
| x when x <= 3000. -> 6.90 ;;
val rate_eco : float -> float = <fun>
# let rate_standard kg = match kg with
x when x <= 500. -> 4.60
| x when x <=1000. -> 5.90
| x when x <= 2000. -> 6.50
| x when x <= 3000. -> 7.20;;
val rate_standart : float -> float = <fun>
# let rate_express kg = match kg with
x when x <= 500. -> 9.10
| x when x <=1000. -> 11.
| x when x <= 2000. -> 13.5
| x when x <= 3000. -> 14.2;;
val rate_express : float -> float = <fun>
# let rate rt kg = match rt with
x when x = "economic" -> rate_eco(kg)
| x when x = "standard" -> rate_standard(kg)
| x when x = "express" -> rate_express(kg);;
val rate : string -> float -> float = <fun>