mirror of
https://github.com/MichaelCade/90DaysOfDevOps.git
synced 2025-07-06 16:31:38 +07:00
day 12
This commit is contained in:
21
Days/Go/day12_example1.go
Normal file
21
Days/Go/day12_example1.go
Normal file
@ -0,0 +1,21 @@
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
|
||||
challenge := "#90DaysOfDevOps"
|
||||
const daystotal = 90
|
||||
|
||||
fmt.Printf("Welcome to %v\n", challenge)
|
||||
fmt.Printf("This is a %v challenge\n", daystotal)
|
||||
|
||||
var TwitterName string
|
||||
var DaysComplete int
|
||||
// ask user for their twitter handle
|
||||
|
||||
TwitterName = "@MichaelCade1"
|
||||
DaysComplete = 12
|
||||
fmt.Printf("%v has completed %v days of the challenge\n", TwitterName, DaysComplete)
|
||||
fmt.Println("Great work")
|
||||
}
|
24
Days/Go/day12_example2.go
Normal file
24
Days/Go/day12_example2.go
Normal file
@ -0,0 +1,24 @@
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
|
||||
const DaysTotal int = 90
|
||||
challenge := "#90DaysOfDevOps"
|
||||
|
||||
fmt.Printf("Welcome to the %v challenge.\nThis challenge consists of %v days\n", challenge, DaysTotal)
|
||||
|
||||
var TwitterName string
|
||||
var DaysCompleted uint
|
||||
|
||||
// asking for user input
|
||||
fmt.Println("Enter Your Twitter Handle: ")
|
||||
fmt.Scanln(&TwitterName)
|
||||
|
||||
fmt.Println("How many days have you completed?: ")
|
||||
fmt.Scanln(&DaysCompleted)
|
||||
|
||||
fmt.Printf("Thank you %v for taking part and completing %v days.\n", TwitterName, DaysCompleted)
|
||||
fmt.Println("Good luck")
|
||||
}
|
29
Days/Go/day12_example3.go
Normal file
29
Days/Go/day12_example3.go
Normal file
@ -0,0 +1,29 @@
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
|
||||
const DaysTotal int = 90
|
||||
var remainingDays uint = 90
|
||||
challenge := "#90DaysOfDevOps"
|
||||
|
||||
fmt.Printf("Welcome to the %v challenge.\nThis challenge consists of %v days\n", challenge, DaysTotal)
|
||||
|
||||
var TwitterName string
|
||||
var DaysCompleted uint
|
||||
|
||||
// asking for user input
|
||||
fmt.Println("Enter Your Twitter Handle: ")
|
||||
fmt.Scanln(&TwitterName)
|
||||
|
||||
fmt.Println("How many days have you completed?: ")
|
||||
fmt.Scanln(&DaysCompleted)
|
||||
|
||||
// calculate remaining days
|
||||
remainingDays = remainingDays - DaysCompleted
|
||||
|
||||
fmt.Printf("Thank you %v for taking part and completing %v days.\n", TwitterName, DaysCompleted)
|
||||
fmt.Printf("You have %v days remaining for the %v challenge\n", remainingDays, challenge)
|
||||
fmt.Println("Good luck")
|
||||
}
|
11
Days/Go/day12_example4.go
Normal file
11
Days/Go/day12_example4.go
Normal file
@ -0,0 +1,11 @@
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
var challenge = "#90DaysOfDevOps"
|
||||
|
||||
fmt.Println(challenge)
|
||||
fmt.Println(&challenge)
|
||||
|
||||
}
|
Reference in New Issue
Block a user