add: if statement exercises

This commit is contained in:
Inanc Gumus
2018-10-27 17:40:20 +03:00
parent 12b09c3174
commit 1d1280d76b
22 changed files with 835 additions and 0 deletions

View File

@@ -0,0 +1,49 @@
// 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: Vowel or Consonant
//
// Detect whether a letter is vowel or consonant.
//
// NOTE
// y or w is called a semi-vowel.
// Check out: https://en.oxforddictionaries.com/explore/is-the-letter-y-a-vowel-or-a-consonant/
//
// HINT
// + You can find the length of an argument using the len function.
//
// + len(os.Args[1]) will give you the length of the 1st argument.
//
// BONUS
// Use strings.IndexAny function to detect the vowels.
// Search on Google for: golang pkg strings IndexAny
//
// EXPECTED OUTPUT
// go run main.go
// Give me a letter
//
// go run main.go hey
// Give me a letter
//
// go run main.go a
// "a" is a vowel.
//
// go run main.go y
// "y" is sometimes a vowel, sometimes not.
//
// go run main.go w
// "w" is sometimes a vowel, sometimes not.
//
// go run main.go x
// "x" is a consonant.
// ---------------------------------------------------------
func main() {
}