docs(fooddeliverytime): refactor instructions and fix indentation

This commit is contained in:
Tiago Collot 2022-10-03 15:53:49 +01:00
parent a46cf4285b
commit a527e3f2ea
1 changed files with 10 additions and 9 deletions

View File

@ -2,11 +2,12 @@
### 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`.
- 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
@ -28,21 +29,21 @@ Here is a possible program to test your function:
package main
import (
"fmt"
"piscine"
"fmt"
"piscine"
)
func main() {
fmt.Println(piscine.FoodDeliveryTime("burger"))
fmt.Println(piscine.FoodDeliveryTime("chips"))
fmt.Println(piscine.FoodDeliveryTime("nuggets"))
fmt.Println(piscine.FoodDeliveryTime("burger") + piscine.FoodDeliveryTime("chips") + piscine.FoodDeliveryTime("nuggets"))
fmt.Println(piscine.FoodDeliveryTime("burger"))
fmt.Println(piscine.FoodDeliveryTime("chips"))
fmt.Println(piscine.FoodDeliveryTime("nuggets"))
fmt.Println(piscine.FoodDeliveryTime("burger") + piscine.FoodDeliveryTime("chips") + piscine.FoodDeliveryTime("nuggets"))
}
```
And its output:
```go
```console
$ go run . | cat -e
15$
10$