trying_out_go/passfail.go
2023-10-16 12:44:08 -04:00

26 lines
345 B
Go

package main
import (
"fmt"
"log"
"git.linuxhg.com/john-okeefe/keyboard"
)
func passFail() {
fmt.Print("Enter a grade: ")
grade, err := keyboard.GetFloat()
if err != nil {
log.Fatal(err)
}
var status string
if grade >= 60 {
status = "passing"
} else {
status = "failing"
}
fmt.Println("A grade of", grade, "is", status)
}