Question

In: Computer Science

In C# The Saffir-Simpson Hurricane Scale classifies hurricanes into five categories numbered 1 through 5. Write...

In C# The Saffir-Simpson Hurricane Scale classifies hurricanes into five categories numbered 1 through 5. Write an application named Hurricane that outputs a hurricane’s category based on the user’s input of the wind speed. Category 5 hurricanes have sustained winds of at least 157 miles per hour. The minimum sustained wind speeds for categories 4 through 1 are 130, 111, 96, and 74 miles per hour, respectively. Any storm with winds of less than 74 miles per hour is not a hurricane. If a storm falls into one of the hurricane categories, output This is a category # hurricane, with # replaced by the category number. If a storm is not a hurricane, output This is not a hurricane.

Solutions

Expert Solution

Answer)

The code

using System;
//declare the class hurricane
class hurricane
{
//Main started and declared
static void Main()
{
  
   Console.Write("Enter the wind speed in miles per hour: ");
   //input taken
   string uws = Console.ReadLine();
   //input converted from string to integer Convert.ToInt32() function
   int ws = Convert.ToInt32(uws);
   //checks the value of ws for the wind categories
   if(ws<74)
       Console.WriteLine("Not a hurricane");
   if(ws>=74 && ws<96)
       Console.WriteLine("This is a category 1 hurricane");
   if(ws>=96 && ws<111)
       Console.WriteLine("This is a category 2 hurricane");
   if(ws>=111 && ws<130)
       Console.WriteLine("This is a category 3 hurricane");
   if(ws>=130 && ws<157)
       Console.WriteLine("This is a category 4 hurricane");
   if(ws>157)
       Console.WriteLine("This is a category 5 hurricane");
}
}

goto command prompt of windows and use a notepad to write the program, then compile it, after that run by the filename only.

Screenshot


Related Solutions

(Language: c++)Write a program that displays a question and 4 possible answers numbered 1 through 4....
(Language: c++)Write a program that displays a question and 4 possible answers numbered 1 through 4. . The program should ask the user to answer 1, 2, 3, or 4 and tell them if they are correct or not. If the user enters anything besides 1, 2, 3, or 4 the program should return an error message example outout: whats 2+5? 1. 4 2. 7 3. 1 4. 0 // if user inputs anything other then option 2 the screen...
An urn contains 10 balls numbered 1 through 10. Five balls are drawn at random and...
An urn contains 10 balls numbered 1 through 10. Five balls are drawn at random and without replacement. Let A be the event that “Exactly two odd-numbered balls are drawn and they occur on odd-numbered draws from the urn.” What is the probability of event A? Please explain Thank you
(Urn Poker) An urn contains 8 red balls numbered 1 through 8, 8 yellow balls numbered...
(Urn Poker) An urn contains 8 red balls numbered 1 through 8, 8 yellow balls numbered 1 through 8, 8 green balls numbered 1 through 8, and 8 black balls numbered 1 through 8. If 4 balls are randomly selected, find the probability of getting: three of a kind. (Three of a kind is 3 balls of one denomination and a fourth ball of a different denomination. e.g., 5,5,5,2) (c) two pairs. (A pair is two balls of the same...
1. What is fair value accounting?   2. Fair value accounting classifies FV assets into three categories....
1. What is fair value accounting?   2. Fair value accounting classifies FV assets into three categories. What are those categories? 3. What are some issues with the reliability of FV assets classified as Level 3? 4. Would you audit a portfolio of Level 3 assets differently than a portfolio of Level 1 assets?
C++ Primary U.S. interstate highways are numbered 1-99. Odd numbers (like the 5 or 95) go...
C++ Primary U.S. interstate highways are numbered 1-99. Odd numbers (like the 5 or 95) go north/south, and evens (like the 10 or 90) go east/west. Auxiliary highways are numbered 100-999, and service the primary highway indicated by the rightmost two digits. Thus, the 405 services the 5, and the 290 services the 90. Your program will prompt the user to type a highway number ("Please enter a highway number, Ex: 65: "), read in the number typed by the...
In a small pond there are five lily pads in a circle labeled 1 through 5....
In a small pond there are five lily pads in a circle labeled 1 through 5. A frog is sitting on pad 1. When the frog is on pad n, it will jump to right pad with probability 1/2 and to left pad with probability 1/2. Each jump is independent of the previous jumps. What is the probability that the frog will return to pad 1 with jumping 7 times? What is the probability that the frog will return to...
c) An organisation has 1000 employees. There are five categories of employees in the organisation (human...
c) An organisation has 1000 employees. There are five categories of employees in the organisation (human resources, IT, finance, marketing, and maintenance). Top management is interested in obtaining feedback from the employees with regard to job satisfaction. Given that the proportion of employees from the various departments are as follows; 20% from human resources, 10% IT, 30% from finance, 30% from marketing and the balance from maintenance. i) The researcher plans to take a sample of 200 employees. State and...
There are 7 balls numbered 1 through 7 placed in a bucket. What is the probability...
There are 7 balls numbered 1 through 7 placed in a bucket. What is the probability of reaching into the bucket and randomly drawing two balls numbered 6 and 3 without replacement, in that order? Express your answer as a fraction in lowest terms or a decimal rounded to the nearest millionth.
You plan to open a bar and run it for five years (year 1 through 5)....
You plan to open a bar and run it for five years (year 1 through 5). - The equipment will cost $2 million in year 0 and will be straight-line depreciated to $0 over 10 years, but you expect to sell it for $1.2 million at the end of year 5. The average and marginal tax rate is 10%. - In year 1 through 5, you expect annual revenues to be $2 million, annual fixed costs to be $100,000, and...
Q-1)1 to 5 in bag A; 1 to 11 in bag B there are numbered cards....
Q-1)1 to 5 in bag A; 1 to 11 in bag B there are numbered cards. A random from the randomly selected bag card is selected. Since there is an odd number on the selected card, A What is the probability of being chosen from the bag? Note: Make a tree diagram and express your results with Bayes Theorem and Confirm. Q-2)ABCD is a rectangle whose long edge is twice the short edge. Long midpoint X of edge AB; The...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT