Skip to content

Instantly share code, notes, and snippets.

@JorgeOlvera
Created November 6, 2013 15:01
Show Gist options
  • Save JorgeOlvera/7337461 to your computer and use it in GitHub Desktop.
Save JorgeOlvera/7337461 to your computer and use it in GitHub Desktop.
/*1. Write a program (save it as Fever) that prompts the user for a patient’s temperature
and would display on screen if he/she has fever depending whether his/her temperature
exceeds 39° Celsius. If it is less than that, then the patient has normal temperature
*/
import java.util.Scanner;
import java.io.*;
public class fever {
public static void main(String[] args) {
String temperature;
Scanner input = new Scanner(System.in);
System.out.println("You might have a fever! Pleae introduce your temperature in Celsius degrees");
temperature = input.nextLine();
if (temperature >= 39){
System.out.println("Looks like you have a fever. Go see a doctor");
}
else if (temperature < 39) {
System.out.println("You look fine to me!");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment