Browse Source

docs(rectperimeter): fix subject

- added missing information and usage
- fixed grammar and indentation
DEV-4017-prototypes-exercise-1-animals
jrosendo 2 years ago committed by José Rosendo
parent
commit
f6de74789c
  1. 19
      subjects/rectperimeter/README.md

19
subjects/rectperimeter/README.md

@ -1,27 +1,29 @@
# rectperimeter
## rectperimeter
### Instructions
write a function that accepts two integer arguments, representing the two sides length of a rectangle and returning the perimeter of the rectangle.
Write a function that takes two `int`'s as arguments, representing the length of width and height of a rectangle and returning the perimeter of the rectangle.
your function should return -1 if one of the arguments is negative.
- If one of the arguments is negative it should return `-1`.
### Expected function
```go
func RectPerimeter(l, w int) int {
func RectPerimeter(w, h int) int {
}
```
### Usage
Here is a possible program to test your function:
```go
package main
import (
"fmt"
"piscine"
)
@ -30,3 +32,12 @@ func main() {
fmt.Println(piscine.RectPerimeter(434343, 898989))
}
```
And its output:
```console
$ go run .
24$
2666664$
$
```

Loading…
Cancel
Save