add: numbers and strings exercises
This commit is contained in:
@ -8,7 +8,8 @@
|
||||
package main
|
||||
|
||||
// ---------------------------------------------------------
|
||||
// EXERCISE
|
||||
// EXERCISE: Do Some Calculations
|
||||
//
|
||||
// 1. Print the sum of 50 and 25
|
||||
// 2. Print the difference of 50 and 15.5
|
||||
// 3. Print the product of 50 and 0.5
|
||||
@ -26,9 +27,4 @@ package main
|
||||
// ---------------------------------------------------------
|
||||
|
||||
func main() {
|
||||
// ADD YOUR CODE BELOW
|
||||
// USE `fmt.Println` for each question
|
||||
|
||||
// UNCOMMENT IT FIRST, THEN DO NOT TOUCH THIS CODE
|
||||
// fmt.Println(x)
|
||||
}
|
@ -10,7 +10,8 @@ package main
|
||||
import "fmt"
|
||||
|
||||
// ---------------------------------------------------------
|
||||
// EXERCISE
|
||||
// EXERCISE: Fix the Float
|
||||
//
|
||||
// Fix the program to print 2.5 instead of 2
|
||||
//
|
||||
// EXPECTED OUTPUT
|
@ -10,7 +10,8 @@ package main
|
||||
import "fmt"
|
||||
|
||||
// ---------------------------------------------------------
|
||||
// EXERCISE
|
||||
// EXERCISE: Precedence
|
||||
//
|
||||
// Change the expressions to produce the expected outputs
|
||||
//
|
||||
// RESTRICTION
|
@ -8,7 +8,8 @@
|
||||
package main
|
||||
|
||||
// ---------------------------------------------------------
|
||||
// EXERCISE
|
||||
// EXERCISE: Incdecs
|
||||
//
|
||||
// 1. Increase the `counter` 5 times
|
||||
// 2. Decrease the `factor` 2 times
|
||||
// 3. Print the product of counter and factor
|
@ -10,7 +10,8 @@ package main
|
||||
import "fmt"
|
||||
|
||||
// ---------------------------------------------------------
|
||||
// EXERCISE
|
||||
// EXERCISE: Manipulate a Counter
|
||||
//
|
||||
// 1. Write the simplest line of code to increase
|
||||
// the counter variable by 1.
|
||||
//
|
@ -10,7 +10,8 @@ package main
|
||||
import "fmt"
|
||||
|
||||
// ---------------------------------------------------------
|
||||
// EXERCISE
|
||||
// EXERCISE: Simplify the Assignments
|
||||
//
|
||||
// Simplify the code (refactor)
|
||||
//
|
||||
// RESTRICTION
|
@ -12,7 +12,8 @@ import (
|
||||
)
|
||||
|
||||
// ---------------------------------------------------------
|
||||
// EXERCISE
|
||||
// EXERCISE: Circle Area
|
||||
//
|
||||
// Calculate the area of a circle from the given radius
|
||||
//
|
||||
// CIRCLE AREA FORMULA
|
@ -12,7 +12,8 @@ import (
|
||||
)
|
||||
|
||||
// ---------------------------------------------------------
|
||||
// EXERCISE
|
||||
// EXERCISE: Sphere Area
|
||||
//
|
||||
// 1. Get the radius from the command-line
|
||||
// 2. Convert it to a float64
|
||||
// 3. Calculate the surface area of a sphere
|
@ -12,7 +12,8 @@ import (
|
||||
)
|
||||
|
||||
// ---------------------------------------------------------
|
||||
// EXERCISE
|
||||
// EXERCISE: Sphere Volume
|
||||
//
|
||||
// 1. Get the radius from the command-line
|
||||
// 2. Convert it to a float64
|
||||
// 3. Calculate the volume of a sphere
|
19
08-numbers-and-strings/01-numbers/exercises/README.md
Normal file
19
08-numbers-and-strings/01-numbers/exercises/README.md
Normal file
@ -0,0 +1,19 @@
|
||||
# Numbers, Precedence, and Assignment Operations
|
||||
|
||||
1. **[Do Some Calculations](https://github.com/inancgumus/learngo/tree/master/08-numbers-and-strings/01-numbers/exercises/01-do-some-calculations)**
|
||||
|
||||
2. **[Fix the Float](https://github.com/inancgumus/learngo/tree/master/08-numbers-and-strings/01-numbers/exercises/02-fix-the-float)**
|
||||
|
||||
3. **[Precedence](https://github.com/inancgumus/learngo/tree/master/08-numbers-and-strings/01-numbers/exercises/03-precedence)**
|
||||
|
||||
4. **[IncDecs](https://github.com/inancgumus/learngo/tree/master/08-numbers-and-strings/01-numbers/exercises/04-incdecs)**
|
||||
|
||||
5. **[Manipulate a Counter](https://github.com/inancgumus/learngo/tree/master/08-numbers-and-strings/01-numbers/exercises/05-manipulate-a-counter)**
|
||||
|
||||
6. **[Simplify the Assignments](https://github.com/inancgumus/learngo/tree/master/08-numbers-and-strings/01-numbers/exercises/06-simplify-the-assignments)**
|
||||
|
||||
7. **[Circle Area](https://github.com/inancgumus/learngo/tree/master/08-numbers-and-strings/01-numbers/exercises/07-circle-area)**
|
||||
|
||||
8. **[Sphere Area](https://github.com/inancgumus/learngo/tree/master/08-numbers-and-strings/01-numbers/exercises/08-sphere-area)**
|
||||
|
||||
9. **[Sphere Volume](https://github.com/inancgumus/learngo/tree/master/08-numbers-and-strings/01-numbers/exercises/09-sphere-volume)**
|
Reference in New Issue
Block a user