Answer:
Explanation:
namespace Hurricane
{
public partial class Hurricane : Form
{
public Hurricane()
{
InitializeComponent();
}
private void btnSubmit_Click(object sender, EventArgs e)
{
//declare constants and variables
const int CAT5 = 157, CAT4 = 130, CAT3 = 111, CAT2 = 96, CAT1 = 74;
double WindSpeed = Convert.ToDouble(txtInput.Text);
string Category;
//determine hurricane category
if (WindSpeed >= CAT5)
Category = "a category 5 hurricane.";
else if (WindSpeed >= CAT4)
Category = "a category 4 hurricane.";
else if (WindSpeed >= CAT3)
Category = "a category 3 hurricane.";
else if (WindSpeed >= CAT2)
Category = "a category 2 hurricane.";
else if (WindSpeed >= CAT1)
Category = "a category 1 hurricane.";
else
Category = "not a hurricane.";
//output
lblOutput.Text = "A windspeed of " + WindSpeed + "mph is " + Category;
}
private void btnExit_Click(object sender, EventArgs e)
{
Application.Exit();
}
}
}