-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
44 lines (35 loc) · 865 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package main
import (
"fmt"
"os"
"strings"
)
func main() {
for {
fmt.Println("--------------- Temperature Converter ---------------")
fmt.Println("1: C to F")
fmt.Println("2: F to C")
fmt.Print("3: Exit \n")
option := Input()
switch option {
case "1":
fmt.Println("--------------- Celsius To Farenheight Converter ---------------")
fmt.Println()
fmt.Print("Enter the temperature you want to convert: ")
CToF(Input())
case "2":
fmt.Println("--------------- Farenheight To Celsius Converter ---------------")
fmt.Println()
fmt.Print("Enter the temperature you want to convert: ")
FToC(Input())
case "3":
fmt.Println("--------------- Exit ---------------")
os.Exit(1)
}
fmt.Println("Do you want to make another conversion? Y/N")
input := Input()
if strings.ToLower(input) != "y" {
break
}
}
}