Created
November 6, 2013 15:01
-
-
Save JorgeOlvera/7337461 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*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