diff --git a/subjects/fooddeliverytime/README.md b/subjects/fooddeliverytime/README.md index 26703740..4dc61936 100644 --- a/subjects/fooddeliverytime/README.md +++ b/subjects/fooddeliverytime/README.md @@ -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$