Skip to content

Instantly share code, notes, and snippets.

@ajbinky
Created October 1, 2018 23:52
Show Gist options
  • Save ajbinky/0384664aab4f9b23be402ee77a3ca016 to your computer and use it in GitHub Desktop.
Save ajbinky/0384664aab4f9b23be402ee77a3ca016 to your computer and use it in GitHub Desktop.
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