Browse Source

Add remaining activities of chapter 01

T. Meissner 3 months ago
parent
commit
89c38eef04
2 changed files with 34 additions and 0 deletions
  1. 18
    0
      chapter_01/activity_1.03/main.go
  2. 16
    0
      chapter_01/activity_1.04/main.go

+ 18
- 0
chapter_01/activity_1.03/main.go View File

@@ -0,0 +1,18 @@
1
+package main
2
+
3
+import "fmt"
4
+
5
+func main() {
6
+
7
+  count := 5
8
+  var message string
9
+
10
+  if count > 5 {
11
+    message = "Greater than 5"
12
+  } else {
13
+    message = "Not greater than 5"
14
+  }
15
+
16
+  fmt.Println(message)
17
+
18
+}

+ 16
- 0
chapter_01/activity_1.04/main.go View File

@@ -0,0 +1,16 @@
1
+package main
2
+
3
+import "fmt"
4
+
5
+func main() {
6
+
7
+  count := 0
8
+
9
+  if count < 5 {
10
+    count = 10
11
+    count++
12
+  }
13
+
14
+  fmt.Println(count == 11)
15
+
16
+}