@ -28,7 +28,7 @@ Create the structures `Circle` and `Point` (which will be made of two coordinate
This snippets are incomplete and it is part of the exercise to discover how to complete them. In the [usage](#usage) you will find all the information that you need.
@ -6,7 +6,7 @@ Given a list of integers (Vec<i32>) write three **functions**.
Write a **function** called `mean` that calculates the `mean` (the average value) of all the values in the list.
Write a **function** called `median` that calculates the `median` (for a sorted list, it is the value in the middle).
Write a **function** called `median` that calculates the `median` (for a sorted list, it is the value in the middle). If there is an even amount of numbers in the list, the middle pair must be determined, added together, and divided by two to find the median value.
Write a **function** called `mode` that calculates the mode (the value
Write a **program** that prints a riddle, receives input from the user and checks that the answer is correct.
The program must allow indefinite number of trials and only quit after the correct answer is given.
The program must allow an indefinite number of trials and only quit after the correct answer is given.
Every time the user introduces an incorrect answer the program must print the riddle again and after the user gives the correct answer the program must print the number of tries that took to get the correct answer.
@ -18,7 +18,7 @@ The `struct` must also have an implementation of 2 **functions** associated with
- `send_ms`, which only has its implementation type (**self**) as argument and returns an option:
- This function must return `None` if the content of the message is either **empty** or contains the word **stupid**. Otherwise it returns the content of the message.
You will have to create two more **functions** that are not associated with any structure:
You will have to create one more **function** that is not associated with any structure:
- `check_ms` which:
- receives as parameters the reference to the structure `Message`