add: go type system exercises
This commit is contained in:
@ -8,7 +8,8 @@
|
||||
package main
|
||||
|
||||
// ---------------------------------------------------------
|
||||
// EXERCISE
|
||||
// EXERCISE: Optimal Types
|
||||
//
|
||||
// 1. Choose the optimal data types for the given situations.
|
||||
// 2. Print them all
|
||||
// 3. Try converting them to lesser data types.
|
@ -12,7 +12,8 @@ import (
|
||||
)
|
||||
|
||||
// ---------------------------------------------------------
|
||||
// EXERCISE
|
||||
// EXERCISE: The Type Problem
|
||||
//
|
||||
// Solve the data type problem in the program.
|
||||
//
|
||||
// EXPECTED OUTPUT
|
@ -14,7 +14,8 @@ import (
|
||||
)
|
||||
|
||||
// ---------------------------------------------------------
|
||||
// EXERCISE
|
||||
// EXERCISE: Parse Arg Numbers
|
||||
//
|
||||
// Use strconv.ParseInt function to get int8, int16, and
|
||||
// int32, and int64 values from command-line.
|
||||
//
|
@ -13,7 +13,8 @@ import (
|
||||
)
|
||||
|
||||
// ---------------------------------------------------------
|
||||
// EXERCISE
|
||||
// EXERCISE: Time Multiplier
|
||||
//
|
||||
// You should get an argument from the command-line and
|
||||
// you need to multiply the time duration value `t` with
|
||||
// the given argument.
|
@ -8,7 +8,8 @@
|
||||
package main
|
||||
|
||||
// ---------------------------------------------------------
|
||||
// EXERCISE
|
||||
// EXERCISE: Refactor Feet to Meter
|
||||
//
|
||||
// Remember the feet to meters program?
|
||||
// Now, it's time to refactor it.
|
||||
// Define your own Feet and Meters types.
|
@ -10,7 +10,8 @@ package main
|
||||
import "fmt"
|
||||
|
||||
// ---------------------------------------------------------
|
||||
// EXERCISE
|
||||
// EXERCISE: Convert the Types
|
||||
//
|
||||
// Convert the variables to appropriate types.
|
||||
//
|
||||
// EXPECTED OUTPUT
|
13
09-go-type-system/exercises/README.md
Normal file
13
09-go-type-system/exercises/README.md
Normal file
@ -0,0 +1,13 @@
|
||||
# Types
|
||||
|
||||
1. **[Find the Optimal Types](https://github.com/inancgumus/learngo/tree/master/09-go-type-system/exercises/01-optimal-types)**
|
||||
|
||||
2. **[Fix the Type Problem](https://github.com/inancgumus/learngo/tree/master/09-go-type-system/exercises/02-the-type-problem)**
|
||||
|
||||
3. **[Parse Arg Numbers](https://github.com/inancgumus/learngo/tree/master/09-go-type-system/exercises/03-parse-arg-numbers)**
|
||||
|
||||
4. **[Time Multiplier](https://github.com/inancgumus/learngo/tree/master/09-go-type-system/exercises/04-time-multiplier)**
|
||||
|
||||
5. **[Refactor Feet to Meter](https://github.com/inancgumus/learngo/tree/master/09-go-type-system/exercises/05-refactor-feet-to-meter)**
|
||||
|
||||
6. **[Convert the Types](https://github.com/inancgumus/learngo/tree/master/09-go-type-system/exercises/06-convert-the-types)**
|
Reference in New Issue
Block a user