Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Instructions The Saffir - Simpson Hurricane Scale classifies hurricanes into five categories numbered 1 through 5 . Write an application named Hurricane that outputs a

Instructions
The Saffir-Simpson Hurricane Scale classifies hurricanes into five categories numbered 1 through 5.
Write an application named Hurricane that outputs a hurricanes category based on the users 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.
Solution
using System;
using static System.Console;
class Hurricane
{
static void Main()
{
int wind;
int category =0;
const int CAT5=157;
const int CAT4=130;
const int CAT3=111;
const int CAT2=96;
const int CAT1=74;
Write("Enter wind speed for hurricane >>");
wind = Convert.ToInt32(ReadLine());
if(wind >= CAT5)
category =5;
else
if(wind >= CAT4)
category =4;
else
if(wind >= CAT3)
category =3;
else
if(wind >= CAT2)
category =2;
else
if(wind >= CAT1)
category =1;
if(category ==0)
WriteLine("This is not a hurricane");
else
WriteLine("This is a category {0} hurricane", category);
}
}
------------------------------------------------------------------
Previously , you wrote a program named Hurricane that classified hurricanes into five categories using the Saffir-Simpson Hurricane Scale. Now, create a modified version named HurricaneModularized that passes a users input wind speed to a method that returns the hurricane category.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Focus On Geodatabases In ArcGIS Pro

Authors: David W. Allen

1st Edition

1589484452, 978-1589484450

More Books

Students also viewed these Databases questions

Question

How can I creating an attention-grabbing event page

Answered: 1 week ago

Question

Give a brief defi ni tion of the terms population and sample.

Answered: 1 week ago

Question

1. Identify six different types of history.

Answered: 1 week ago

Question

2. Define the grand narrative.

Answered: 1 week ago

Question

4. Describe the role of narratives in constructing history.

Answered: 1 week ago