From 1aee0b287148cabb8006318b7b23c160ce573040 Mon Sep 17 00:00:00 2001 From: hamza Date: Wed, 15 Jun 2022 17:46:18 +0100 Subject: [PATCH] subject(is-the-square-a-child): add readmed --- subjects/isthesquareachild/README.md | 46 ++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 subjects/isthesquareachild/README.md diff --git a/subjects/isthesquareachild/README.md b/subjects/isthesquareachild/README.md new file mode 100644 index 000000000..d6665b129 --- /dev/null +++ b/subjects/isthesquareachild/README.md @@ -0,0 +1,46 @@ +## is-the-square-a-child + +### Instructions + +Write a function `IsTheSquareAChild` that takes a number and returns `true` if the number is a square and `false` otherwise. +- The function should return `false` if the number is negative. +- Check only if the first parameter is the square of the second one. + +### Expected Function +```go +func IsTheSquareAChild(number int, square int) bool { + // your code here +} +``` + +### Usage + +``` go +package main + +import "fmt" + +func main(){ + fmt.Println(IsTheSquareAChild(4, 16)) + fmt.Println(IsTheSquareAChild(5, 23)) + fmt.Println(IsTheSquareAChild(5, 25)) + fmt.Println(IsTheSquareAChild(2, 27)) + fmt.Println(IsTheSquareAChild(6, 36)) + fmt.Println(IsTheSquareAChild(-10, 100)) + fmt.Println(IsTheSquareAChild(100,10)) +} +``` + +and its output: + +```console +$ go run . +true +false +true +false +true +false +false +``` +