Advertisement
Spocoman

10. Weather Forecast - Part 2

Sep 15th, 2024 (edited)
163
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. import "fmt"
  3.  
  4. func main() {
  5.     var degrees float32
  6.     fmt.Scanln(&degrees)
  7.    
  8.     if (degrees >= 5 && degrees < 12) {
  9.         fmt.Println("Cold")
  10.     } else if (degrees >= 12 && degrees < 15) {
  11.         fmt.Println("Cool")
  12.     } else if (degrees >=15 && degrees <= 20) {
  13.         fmt.Println("Mild")
  14.     } else if (degrees > 20 && degrees < 26) {
  15.         fmt.Println("Warm")
  16.     } else if (degrees >= 26 && degrees <= 35) {
  17.         fmt.Println("Hot")
  18.     } else {
  19.         fmt.Println("unknown")
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement