mirror of https://github.com/01-edu/public.git
docs(fooddeliverytime): refactor instructions and fix indentation
This commit is contained in:
parent
a46cf4285b
commit
a527e3f2ea
|
@ -2,11 +2,12 @@
|
||||||
|
|
||||||
### Instructions
|
### Instructions
|
||||||
|
|
||||||
Given a menu with the corresponding time that each item takes to cook (burger takes 15 min, chips takes 10 min and nuggets takes 12 min), return the time each item takes to be prepared and the total amount of time for the order to be ready assuming the items are cooked one after the other.
|
Given the following menu with the corresponding times that each item takes to cook (burger takes 15 min, chips takes 10 min and nuggets takes 12 min), return the time that each order item takes to be prepared and the total amount of time for the order to be ready assuming the items are cooked one after the other.
|
||||||
|
|
||||||
Write a function `FoodDeliveryTime()` that takes a `string` and returns an `int`.
|
Write a function `FoodDeliveryTime()` that takes a `string` and returns an `int`.
|
||||||
|
|
||||||
- Use structures to answer the subject.
|
- Use structs to answer the subject.
|
||||||
|
- If any of the order items don't exist in the menu above return the error message `404`.
|
||||||
|
|
||||||
### Expected function
|
### Expected function
|
||||||
|
|
||||||
|
@ -28,21 +29,21 @@ Here is a possible program to test your function:
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"piscine"
|
"piscine"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
fmt.Println(piscine.FoodDeliveryTime("burger"))
|
fmt.Println(piscine.FoodDeliveryTime("burger"))
|
||||||
fmt.Println(piscine.FoodDeliveryTime("chips"))
|
fmt.Println(piscine.FoodDeliveryTime("chips"))
|
||||||
fmt.Println(piscine.FoodDeliveryTime("nuggets"))
|
fmt.Println(piscine.FoodDeliveryTime("nuggets"))
|
||||||
fmt.Println(piscine.FoodDeliveryTime("burger") + piscine.FoodDeliveryTime("chips") + piscine.FoodDeliveryTime("nuggets"))
|
fmt.Println(piscine.FoodDeliveryTime("burger") + piscine.FoodDeliveryTime("chips") + piscine.FoodDeliveryTime("nuggets"))
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
And its output:
|
And its output:
|
||||||
|
|
||||||
```go
|
```console
|
||||||
$ go run . | cat -e
|
$ go run . | cat -e
|
||||||
15$
|
15$
|
||||||
10$
|
10$
|
||||||
|
|
Loading…
Reference in New Issue