Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

C# please Create an application that prompts the user for a storm windspeed in m

ID: 3797262 • Letter: C

Question

C# please

Create an application that prompts the user for a storm windspeed in mph, then determines the correct typhoon category. The program must run all test cases of storm windspeed in one execution. Use a sentinel value to terminate the program. Do not assume a specific number of inputs. Determine the maximum storm windspeed value input. Note that the maximum must be evaluated within your program. You MAY NOT use C built in function. Output screenshot must include the input values shown below, their calculated typhoon level and the maximum storm wind speed entered Wind speed must be greater than zero. If zero or less, reprompt for that windspeed again Windspeed mph) hoon category 74 Tropical storm-not a typhoon 74 to 95 96 to 110 111 to 130 131 to 155 156 or more Run your application with the following data and save the screenshot of inputs and outputs to submit. Storm MPH

Explanation / Answer

using System;

public class Test
{
   public static void Main()
   {
       int typhoonCategory = 0;
      
       Console.WriteLine("Enter storm windspeed in mph");
       int windSpeed = Convert.ToInt32(Console.ReadLine());
      
       while(windSpeed != 0) //0 is sentinnel value to close the loop
       {
           if(windSpeed < 74)
           Console.WriteLine("Tropical storm - not a typhoon");
           else if(windSpeed >= 74 && windSpeed <=95)
           typhoonCategory = 1;
           else if(windSpeed >= 96 && windSpeed <=110)
           typhoonCategory = 2;
           else if(windSpeed >= 111 && windSpeed <=130)
           typhoonCategory = 3;
           else if(windSpeed >= 131 && windSpeed <=155)
           typhoonCategory = 4;
           else if(windSpeed >= 156)
           typhoonCategory = 5;
           Console.WriteLine("Enter storm windspeed in mph");
           windSpeed = Convert.ToInt32(Console.ReadLine());
           Console.WriteLine("MPH#: Typhoon Category#:");
           Console.WriteLine(windSpeed+" "+typhoonCategory);
       }
      
      
      
   }
}

Output: