From a527e3f2ea1c3c33c4e42bc1487e101ccee1327a Mon Sep 17 00:00:00 2001 From: Tiago Collot Date: Mon, 3 Oct 2022 15:53:49 +0100 Subject: [PATCH] docs(fooddeliverytime): refactor instructions and fix indentation --- subjects/fooddeliverytime/README.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) 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$