refactor: 6th section first two lectures exercises and questions

This commit is contained in:
Inanc Gumus
2018-10-22 22:00:34 +03:00
parent 2e650b9a1e
commit 411be187ab
33 changed files with 114 additions and 49 deletions

View File

@ -8,9 +8,11 @@
package main
// ---------------------------------------------------------
// EXERCISE
// 1- Declare and print a variable with an int type
// 2- The declared variable's name should be: height
// EXERCISE: Declare int
//
// 1. Declare and print a variable with an int type
//
// 2. The declared variable's name should be: height
//
// EXPECTED OUTPUT
// 0

View File

@ -8,9 +8,11 @@
package main
// ---------------------------------------------------------
// OPTIONAL EXERCISE
// 1- Declare and print a bool variable
// 2- The variable's name should be: isOn
// EXERCISE: Declare bool
//
// 1. Declare and print a bool variable
//
// 2. The variable's name should be: isOn
//
// EXPECTED OUTPUT
// false

View File

@ -8,9 +8,11 @@
package main
// ---------------------------------------------------------
// EXERCISE
// 1- Declare and print a variable with a float64 type
// 2- The declared variable's name should be: brightness
// EXERCISE: Declare float64
//
// 1. Declare and print a variable with a float64 type
//
// 2. The declared variable's name should be: brightness
//
// EXPECTED OUTPUT
// 0

View File

@ -8,9 +8,11 @@
package main
// ---------------------------------------------------------
// EXERCISE
// 1- Declare a string variable
// 2- Print that variable
// EXERCISE: Declare string
//
// 1. Declare a string variable
//
// 2. Print that variable
//
// EXPECTED OUTPUT
// ""

View File

@ -8,8 +8,9 @@
package main
// ---------------------------------------------------------
// EXERCISE
// 1- Declare the variables below:
// EXERCISE: Undeclarables
//
// 1. Declare the variables below:
// 3speed
// !speed
// spe?ed
@ -17,10 +18,10 @@ package main
// func
// package
//
// 2- Observe the error messages
// 2. Observe the error messages
//
// NOTE
// The types of the variables are not important.
// The types of the variables are not important.
// ---------------------------------------------------------
func main() {

View File

@ -8,8 +8,9 @@
package main
// ---------------------------------------------------------
// EXERCISE
// 1- Declare a few variables using the following types
// EXERCISE: Declare with bits
//
// 1. Declare a few variables using the following types
// int
// int8
// int16
@ -24,8 +25,9 @@ package main
// rune
// byte
//
// 2- Observe their output
// 3- After you've done, check out the solution
// 2. Observe their output
//
// 3. After you've done, check out the solution
// and read the comments there
//
// EXPECTED OUTPUT

View File

@ -8,7 +8,8 @@
package main
// ---------------------------------------------------------
// EXERCISE
// EXERCISE: Multiple
//
// 1. Declare two variables using
// multiple variable declaration statement
//

View File

@ -8,7 +8,8 @@
package main
// ---------------------------------------------------------
// EXERCISE
// EXERCISE: Multiple #2
//
// 1. Declare and initialize two string variables
// using multiple variable declaration
//

View File

@ -8,10 +8,13 @@
package main
// ---------------------------------------------------------
// EXERCISE
// 1- Declare a variable
// 2- Variable's name should be: isLiquid
// 3- Discard it using a blank-identifier
// EXERCISE: Unused
//
// 1. Declare a variable
//
// 2. Variable's name should be: isLiquid
//
// 3. Discard it using a blank-identifier
//
// NOTE
// Do not print the variable

View File

@ -8,10 +8,11 @@
package main
// ---------------------------------------------------------
// EXERCISE
// 1- Declare a variable in the package-scope
// EXERCISE: Package Variable
//
// 2- Observe whether something happens when you don't
// 1. Declare a variable in the package-scope
//
// 2. Observe whether something happens when you don't
// use it
// ---------------------------------------------------------

View File

@ -8,11 +8,14 @@
package main
// ---------------------------------------------------------
// EXERCISE
// 1- Print a variable
// 2- Then declare it
// EXERCISE: Wrong doer
//
// 1. Print a variable
//
// 2. Then declare it
// (This means: Try to print it before its declaration)
// 3- Observe the error
//
// 3. Observe the error
// ---------------------------------------------------------
func main() {

View File

@ -0,0 +1,25 @@
# Declare and Print Variables
Warm up. Declare a few variables and get some experience. Get used to the variable declaration syntax.
1. **[Declare int](https://github.com/inancgumus/learngo/tree/master/06-variables/02-declarations/exercises/01-int)**
2. **[Declare bool](https://github.com/inancgumus/learngo/tree/master/06-variables/02-declarations/exercises/02-bool)**
3. **[Declare float64](https://github.com/inancgumus/learngo/tree/master/06-variables/02-declarations/exercises/03-float64)**
4. **[Declare string](https://github.com/inancgumus/learngo/tree/master/06-variables/02-declarations/exercises/04-string)**
5. **[Declare undeclarables](https://github.com/inancgumus/learngo/tree/master/06-variables/02-declarations/exercises/05-undeclarables)**
6. **[Declare with bits](https://github.com/inancgumus/learngo/tree/master/06-variables/02-declarations/exercises/06-with-bits)**
7. **[Declare multiple](https://github.com/inancgumus/learngo/tree/master/06-variables/02-declarations/exercises/07-multiple)**
8. **[Declare multiple 2](https://github.com/inancgumus/learngo/tree/master/06-variables/02-declarations/exercises/08-multiple-2)**
9. **[Declare an unused variable](https://github.com/inancgumus/learngo/tree/master/06-variables/02-declarations/exercises/09-unused)**
10. **[Declare a package variable](https://github.com/inancgumus/learngo/tree/master/06-variables/02-declarations/exercises/10-package-variable)**
11. **[Use before declare](https://github.com/inancgumus/learngo/tree/master/06-variables/02-declarations/exercises/11-wrong-doer)**