Created
October 1, 2018 23:52
-
-
Save ajbinky/0384664aab4f9b23be402ee77a3ca016 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
package week4; | |
import java.util.Scanner; | |
public class EFScale { | |
public static void main(String[] args) { | |
Scanner scan = new Scanner(System.in); | |
System.out.print("Enter 3 second wind speed: "); | |
int windSpeed = scan.nextInt(); | |
scan.close(); | |
int ef = 0; | |
if (windSpeed < 65) { | |
System.out.println("Enter valid number"); | |
System.exit(0); | |
} | |
if (windSpeed < 110) { | |
ef = 1; | |
} else if (windSpeed < 135) { | |
ef = 2; | |
} else if (windSpeed < 165) { | |
ef = 3; | |
} else if (windSpeed < 200) { | |
ef = 4; | |
} else { | |
ef = 5; | |
} | |
System.out.println("The EF rating is " + ef); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment