diff --git a/06-variables/04-assignment/exercises/04-find-the-rectangle-area/main.go b/06-variables/04-assignment/exercises/04-find-the-rectangle-perimeter/main.go similarity index 76% rename from 06-variables/04-assignment/exercises/04-find-the-rectangle-area/main.go rename to 06-variables/04-assignment/exercises/04-find-the-rectangle-perimeter/main.go index 68a4634..4a89de9 100644 --- a/06-variables/04-assignment/exercises/04-find-the-rectangle-area/main.go +++ b/06-variables/04-assignment/exercises/04-find-the-rectangle-perimeter/main.go @@ -8,15 +8,15 @@ package main // --------------------------------------------------------- -// EXERCISE: Find the Rectangle's Area +// EXERCISE: Find the Rectangle's Perimeter // -// 1. Find the area of a rectangle +// 1. Find the perimeter of a rectangle // Its width is 5 // Its height is 6 // -// 2. Assign the result to the `area` variable +// 2. Assign the result to the `perimeter` variable // -// 3. Print the `area` variable +// 3. Print the `perimeter` variable // // HINT // Rectangle formula = 2 * (width + height) @@ -29,7 +29,7 @@ func main() { // UNCOMMENT THE CODE BELOW: // var ( - // area int + // perimeter int // width, height = 5, 6 // ) diff --git a/06-variables/04-assignment/exercises/04-find-the-rectangle-area/solution/main.go b/06-variables/04-assignment/exercises/04-find-the-rectangle-perimeter/solution/main.go similarity index 82% rename from 06-variables/04-assignment/exercises/04-find-the-rectangle-area/solution/main.go rename to 06-variables/04-assignment/exercises/04-find-the-rectangle-perimeter/solution/main.go index 86114dd..24a5ef6 100644 --- a/06-variables/04-assignment/exercises/04-find-the-rectangle-area/solution/main.go +++ b/06-variables/04-assignment/exercises/04-find-the-rectangle-perimeter/solution/main.go @@ -11,7 +11,7 @@ import "fmt" func main() { var ( - area int + perimeter int width, height = 5, 6 ) @@ -20,7 +20,7 @@ func main() { // just like in math - area = 2 * (width + height) + perimeter = 2 * (width + height) - fmt.Println(area) + fmt.Println(perimeter) } diff --git a/06-variables/04-assignment/exercises/README.md b/06-variables/04-assignment/exercises/README.md index 7a8fdfb..a372fef 100644 --- a/06-variables/04-assignment/exercises/README.md +++ b/06-variables/04-assignment/exercises/README.md @@ -10,7 +10,7 @@ Now, get your feet wet and try some assignment exercises. 3. **[Assign With Expressions](https://github.com/inancgumus/learngo/tree/master/06-variables/04-assignment/exercises/03-assign-with-expressions)** -4. **[Find the Rectangle's Area](https://github.com/inancgumus/learngo/tree/master/06-variables/04-assignment/exercises/04-find-the-rectangle-area)** +4. **[Find the Rectangle's Perimeter](https://github.com/inancgumus/learngo/tree/master/06-variables/04-assignment/exercises/04-find-the-rectangle-perimeter)** 5. **[Multi Assign](https://github.com/inancgumus/learngo/tree/master/06-variables/04-assignment/exercises/05-multi-assign)**