Initial commit

This commit is contained in:
Inanc Gumus
2018-10-15 19:34:48 +03:00
commit cde4e6632c
567 changed files with 17896 additions and 0 deletions
@@ -0,0 +1,31 @@
// 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
import (
"fmt"
"os"
"strconv"
)
// EXERCISE
//
// This program uses magic numbers
// Refactor it and use named constants instead
func main() {
arg := os.Args[1]
feet, _ := strconv.ParseFloat(arg, 64)
meters := feet * 0.3048
yards := feet * 0.3333
fmt.Printf("%g feet is %g meters.\n", feet, meters)
fmt.Printf("%g feet is %g yards.\n", feet, yards)
}