Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // controles ifelseif ifelseif.go
- package main
- import "fmt"
- func notaParaConceito(n float64) string {
- if n >= 9 && n <= 10 {
- return "A"
- } else if n >= 8 && n < 9 {
- return "B"
- } else if n >= 5 && n < 8 {
- return "C"
- } else if n >= 3 && n < 5 {
- return "D"
- } else {
- return "E"
- }
- }
- func main() {
- fmt.Println(notaParaConceito(9.8))
- fmt.Println(notaParaConceito(6.9))
- fmt.Println(notaParaConceito(2.1))
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement