1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
elena-14-01-66 [18.8K]
3 years ago
5

The Beaufort Wind Scale is used to characterize the strength of winds. The scale uses integer values and goes from a force of 0,

which is no wind, up to 12, which is a hurricane. The following script first generates a random force value. Then, it prints a message regarding what type of wind that force represents, using a switch statement. You are to rewrite this switch statement as one nested 150 CHAPTER 4: Selection Statements if-else statement that accomplishes exactly the same thing. You may use else and/or elseif clauses.
ranforce = randi([0, 12]); switch ranforce case 0 disp('There is no wind') case {1,2,3,4,5,6} disp('There is a breeze') case {7,8,9} disp('This is a gale') case {10,11} disp('It is a storm') case 12 disp('Hello, Hurricane!') end
Computers and Technology
1 answer:
TEA [102]3 years ago
5 0

Answer:

ranforce = randi([0, 12]);

if (ranforce == 0)

     disp('There is no wind')

else  if(ranforce>0 && ranforce <7)

     disp('There is a breeze')

else  if(ranforce>6 && ranforce <10)

     disp('This is a gale')

else  if(ranforce>9 && ranforce <12)

     disp('It is a storm')

else  if(ranforce==12)

     disp('Hello, Hurricane!')

end

Explanation:

<em>Replace all switch case statements with if and else if statements.</em>

<em>An instance is:</em>

<em>case {7,8,9}</em>

<em>is replaced with</em>

<em>else  if(ranforce>9 && ranforce <12)</em>

<em>All other disp statements remain unchanged</em>

You might be interested in
Once you've connected to a data source, which button would you select to add a first name to your form letter?
Vesnalui [34]

Selecting the Address Block to add a first name to your form letter.

4 0
3 years ago
Read 2 more answers
What might be the explanation for the following scenario? A user reports that it took a longer than usual amount of time to acce
emmainna [20.7K]
<h2>Answer: </h2>

Usually a report is fetched from the database where data from all previous years is available. Once data is fetched, the raw data is compiled and formulated into appropriate report. The reason that report took longer is that user might have selected a date range from last two years until now which means that entire two years data was fetched from the database, operations were performed onto the raw data and the compiled data was then adjusted as per the report output.


3 0
4 years ago
Lydia is trying to take an aerial shot from the window of an airplane. Where should she hold her camera to get the best shot?
IrinaVladis [17]
Inside The window inside the house
8 0
3 years ago
Screen reading for extended periods can cause___________ _____________, so the position the monitor to minimize glare and give y
choli [55]

Screen reading for extended periods can cause a syndrome known as the computer vision syndrome

<h3>Computer vision Syndrome</h3>

What is computer vision Syndrome?

the computer syndrome is characterised by eye discomfort and fatigue, dry eye, blurry vision, and headaches, glare, etc. Uncorrected vision problems are a major cause. it is recommended to stay off the computer for at least thirty minutes to minimise the effects

Learn more about Computer vision Syndrome here:

brainly.com/question/8114244

7 0
2 years ago
What’s unique about windows 8 compared to earlier windows
skad [1K]
New Interface, features like start screen, faster boot time, dynamic desktop, improved search function, windows love syncing, windows to go, and improved security.
7 0
3 years ago
Other questions:
  • Cattell classified projective tests, such as the rorschach inkblot test, as:
    13·1 answer
  • Which is a feature of a strong thesis statement? A) It presents only the facts. B) It is open-ended. C) It answers the central q
    15·1 answer
  • Which term refers to the technical structure of the software, how users interact with the software, and how the software is phys
    10·1 answer
  • What are short handled screwdrivers used for?
    12·1 answer
  • Of the three types of mutating malware, what type changes its internal code to one of a set number of predefined mutations whene
    9·1 answer
  • Help meee pleaseeee
    5·1 answer
  • Heeeeeeeeeeeeeeeeeeelp plz
    11·1 answer
  • Which of the following statements tests if users walked 10,000 or more steps and ate fewer than 25 grams of sugar?
    9·1 answer
  • What will be the output of following python code? a,b=3,4 a,b,c=b,a+3,b-1 print(a,b,c)​
    7·1 answer
  • What function does a resource manager in an IDE perform?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!