diff --git a/Section6/main.go b/Section6/main.go new file mode 100644 index 0000000..c6c315b --- /dev/null +++ b/Section6/main.go @@ -0,0 +1,37 @@ +package main + +import "fmt" + +func main() { + price, inStock := 100, true + + if price > 80 { + fmt.Println("Too Expensive!") + } + + // _ = inStock + + if price <= 100 && inStock == true { + fmt.Println("Buy it!") + } + + if price < 100 { + fmt.Println("It is cheap") + } else if price == 100 { + fmt.Println("hmmm...") + } else { + fmt.Println("Expensive!") + } + + age := 17 + + if age >= 0 && age < 18 { + fmt.Printf("You can not vote. Please return in %d years. \n", 18-age) + } else if age == 18 { + fmt.Printf("This is your first vote") + } else if age > 18 && age <= 100 { + fmt.Printf("Please vote") + } else { + fmt.Printf("Invalid age") + } +}