Answer:
Answer of the Java class explained below with appropriate comments
Step-by-step explanation:
using System;
class MainClass {
public static void Main (string[] args) {
//entering wind speed of the hurricane
Console.WriteLine ("Enter wind speed in mph: ");
int windSpeed = Convert.ToInt32(Console.ReadLine());
//checking for the category with the credited wind speed
int category = GetCategory(windSpeed);
Console.WriteLine ("Category: " + category);
}
public static int GetCategory(int wind) {
//function for classifying the wind speeds
if(wind >= 157) {
return 5;
}
if(wind >= 130) {
return 4;
}
if(wind >= 111) {
return 3;
}
if(wind >= 96) {
return 2 ;
}
return 1;
}
}