diff --git a/11-if/questions/1-comparison-operators.md b/11-if/questions/1-comparison-operators.md index cdcaeee..0ce52b9 100644 --- a/11-if/questions/1-comparison-operators.md +++ b/11-if/questions/1-comparison-operators.md @@ -3,10 +3,10 @@ 2. `!=` 3. `>` *CORRECT* -> **3:** That's the greater operator. It checks whether a ordered value is greater than the other or not. +> **3:** That's the greater operator. It checks whether an ordered value is greater than the other or not. -## Which one below is not one of the comparison operators of Go? +## Which one below is not one of the ordering operators of Go? 1. `>` 2. `<=` 3. `==` *CORRECT* @@ -24,7 +24,7 @@ > **3:** That's right. All the comparison operators return an untyped bool value (true or false). -## Which one of these cannot be used as an operand to ordering operators (`>`, `<`, `>=`, `<=`)? +## Which one of these below cannot be used as an operand to ordering operators (`>`, `<`, `>=`, `<=`)? 1. int value 2. byte value 3. string value diff --git a/11-if/questions/2-logical-operators.md b/11-if/questions/2-logical-operators.md index e674f3c..2230cdb 100644 --- a/11-if/questions/2-logical-operators.md +++ b/11-if/questions/2-logical-operators.md @@ -117,7 +117,7 @@ func main() { // Don't mind about these functions. // Just focus on the problem. -// These are here just for you to understand it better. +// They are here just for you to understand what's going on better. func super() bool { fmt.Print("super ") return true diff --git a/11-if/questions/3-if.md b/11-if/questions/3-if.md index 2e8739c..5938054 100644 --- a/11-if/questions/3-if.md +++ b/11-if/questions/3-if.md @@ -79,7 +79,7 @@ func main() { > > **3:** Perfect! You don't need to compare the value to `true`. `happy` is already true, so it'll print "cool!". > -> **4:** That won't print anything. `happy` will be true. +> **4:** That won't print anything. `!happy` yields false. ## How can you simplify the following code? You only need to change the condition expression, but how? @@ -108,7 +108,7 @@ func main() { > **4:** That won't print anything. `happy` will be true. -## Is this code going to work? Why? +## This code contains an error. How to fix it? ```go package main diff --git a/11-if/questions/4-error-handling.md b/11-if/questions/4-error-handling.md index faabeb9..d27e8b8 100644 --- a/11-if/questions/4-error-handling.md +++ b/11-if/questions/4-error-handling.md @@ -1,3 +1,16 @@ +## Why error handling is needed? +1. I don't know. +2. To control the execution flow. +3. To make a program malware safe. +4. Because, things can go wrong. *CORRECT* + +> **1:** Then, please watch the lecture again! :) +> +> **2:** Actually yes, but that's not the main reason. +> +> **3:** Come on! + + ## What's a nil value? 1. The dark matter that rules the universe. 2. It's a zero value for pointers or pointer-based types. It means the value is uninitialized. *CORRECT* @@ -13,25 +26,12 @@ > -## Why error handling is needed? -1. I don't know. -2. To control the execution flow. -3. To make a program malware safe. -4. Because, things can go wrong. *CORRECT* - -> **1:** Then, please rewatch the lecture! :) -> -> **2:** Actually yes, but that's not the main reason. -> -> **3:** Come on! - - ## How Go handles error handling? -1. Using a throw/catch block +1. Using a throw/catch statement 2. Using a simple if statement with nil comparison *CORRECT* 3. Using a mechanism called tagging -> **1:** There isn't a throw/catch block in Go; unlike Java, C#, and so on... Go is explicit. +> **1:** There isn't a throw/catch statement in Go; unlike Java, C#, and so on... Go is explicit. ## When you should handle the errors? diff --git a/11-if/questions/5-short-if.md b/11-if/questions/5-short-if.md index 4463951..1aa4406 100644 --- a/11-if/questions/5-short-if.md +++ b/11-if/questions/5-short-if.md @@ -62,7 +62,7 @@ func main() { 3. Change the done declaration of the main() to an assignment 4. Change the done declaration of the short-if to an assignment. And, after the if statement, assign false back to the done variable. *CORRECT* -> **1:** That will break the program. The last line tries to print it. +> **1:** That will break the program. Because, the last line prints it. > > **2:** The program wants to use it to print true. > diff --git a/12-switch/exercises/00/main.go b/12-switch/exercises/00/main.go deleted file mode 100644 index 1bace58..0000000 --- a/12-switch/exercises/00/main.go +++ /dev/null @@ -1,22 +0,0 @@ -// For more tutorials: https://blog.learngoprogramming.com -// -// Copyright © 2018 Inanc Gumus -// Learn Go Programming Course -// License: https://creativecommons.org/licenses/by-nc-sa/4.0/ -// - -package main - -// --------------------------------------------------------- -// EXERCISE -// ? -// -// NOTE -// ? -// -// EXPECTED OUTPUT -// ? -// --------------------------------------------------------- - -func main() { -} diff --git a/12-switch/exercises/00/solution/main.go b/12-switch/exercises/00/solution/main.go deleted file mode 100644 index b5e729e..0000000 --- a/12-switch/exercises/00/solution/main.go +++ /dev/null @@ -1,11 +0,0 @@ -// For more tutorials: https://blog.learngoprogramming.com -// -// Copyright © 2018 Inanc Gumus -// Learn Go Programming Course -// License: https://creativecommons.org/licenses/by-nc-sa/4.0/ -// - -package main - -func main() { -}