2023-10-25 11:55:04 -04:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"log"
|
|
|
|
|
2024-01-11 11:18:00 -05:00
|
|
|
"git.linuxhg.com/Go_Training/keyboard"
|
2023-10-25 11:55:04 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
func toCelsius() {
|
|
|
|
fmt.Println("Enter a temperature in Fahrenheit: ")
|
|
|
|
fahrenheit, err := keyboard.GetFloat()
|
|
|
|
if err != nil {
|
|
|
|
log.Fatal(err)
|
|
|
|
}
|
|
|
|
celsius := (fahrenheit - 32) * 5 / 9
|
|
|
|
fmt.Printf("%0.2f degrees Celsius\n", celsius)
|
|
|
|
}
|