add: if statement exercises
This commit is contained in:
34
11-if/exercises/01-age-seasons/main.go
Normal file
34
11-if/exercises/01-age-seasons/main.go
Normal file
@@ -0,0 +1,34 @@
|
||||
// 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: Age Seasons
|
||||
//
|
||||
// Let's start simple. Print the expected outputs,
|
||||
// depending on the age variable.
|
||||
//
|
||||
// EXPECTED OUTPUT
|
||||
// If age is greater than 60, print:
|
||||
// Getting older
|
||||
// If age is greater than 30, print:
|
||||
// Getting wiser
|
||||
// If age is greater than 20, print:
|
||||
// Adulthood
|
||||
// If age is greater than 10, print:
|
||||
// Young blood
|
||||
// Otherwise, print:
|
||||
// Booting up
|
||||
// ---------------------------------------------------------
|
||||
|
||||
func main() {
|
||||
// Change this accordingly to produce the expected outputs
|
||||
// age := 10
|
||||
|
||||
// Type your if statement here.
|
||||
}
|
||||
Reference in New Issue
Block a user