Advertisement
schillergenbu

Calcula nota

Sep 17th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.52 KB | None | 0 0
  1. package main
  2.  
  3. import (
  4.   "fmt
  5.  "bufio"
  6.  "os"
  7. )
  8.  
  9. func calcula_nota(nota1 float32) (float32){
  10.  if nota1 < 0 {
  11.    return -1.0
  12.  } else if nota1 > 10 {
  13.    return -1.0
  14.  }
  15.  return (5.0 - 0.4 * nota1) / 0.6
  16. }
  17.  
  18. func main() {
  19.  var nota1 float32
  20.  
  21.  reader := bufio.NewReader(os.Stdin)
  22.  
  23.  nota1 = 9.5
  24.  if nota1 < 0 {
  25.    fmt.Println("Tu é burro mêmo em!")
  26.  } else if nota1 > 10 {
  27.    fmt.Println("Tu é o bichão mêmo em doido!")
  28.  }
  29.  fmt.Printf("Você precisa tirar %.2f\n", calcula_nota(nota1))
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement