0

Temperature Checker 13.2 Go/Golang Basic Concepts If/else

What is the answer? You are writing a program for a temperature checking system at an airport. The system measures the body temperature of a person and needs to output "Allowed" if it is in the normal range, or "Fever" if it is higher than normal. Normal: up to 99.5 °F Fever: > 99.5 °F The program should take the temperature as a float from input and output the corresponding message. Sample Input: 101.3 Sample Output: Fever

30th Aug 2021, 2:13 PM
Rachel
Rachel - avatar
5 Respostas
+ 3
Please correct this package main import "fmt" func main() { //your code goes here var input float fmt.Scanln(&temperature) if temperature := 99.5; temperature > 99.5 { fmt.Println("Allowed") } else { fmt.Println("Fever") } }
10th Dec 2021, 11:15 PM
Tanaka Daka
Tanaka Daka - avatar
+ 2
Hello. First please show us your attempts. Then we can help you. Thanks. Happy Programming!!!
22nd Sep 2021, 6:53 AM
Anurag Saikia
+ 1
here you go! package main import "fmt" func main() { //your code goes here var temper float32 fmt.Scanln(&temper) if temper < 99.5 { fmt.Println("Allowed") } else { fmt.Println("Fever") } }
25th Sep 2022, 4:54 PM
Kerem DÜZENLİ
0
I need this
11th Dec 2021, 6:44 PM
Elshod Nematov
Elshod Nematov - avatar
0
package main import "fmt" func main() { var t float32 fmt.Scanln(&t) if t > 99.5{ fmt.Println("Fever") } else { fmt.Println("Allowed") } } Code this it works
20th Dec 2022, 2:10 AM
Lavanya Mangala