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]
2 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]2 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
after installing a secondary hard drive what needs to be done to the hard drive and what do these two task do?
gladu [14]
Keep the first hard drive then override it insert the second one and memory goes into the second one
8 0
3 years ago
Robots can work 24 hours a day, 365 days of the year, but human beings
statuscvo [17]

The word that best completes the sentence is:  "<em>can't</em>".
6 0
3 years ago
Read 2 more answers
What is the use of an NDP?
Makovka662 [10]

Answer:

It defines five ICMPv6 packet types for router solicitation,router advertisement,neighbor solicitation,neighbor advertisement,and network redirects.

Explanation:

8 0
2 years ago
Discuss the inte Generation of computer, Inlith
ch4aika [34]

Generations of Computers

The computers of today find their roots in the second half of the twentieth century. Later as time progressed, we saw many technological improvements in physics and electronics. This has eventually led to revolutionary developments in the hardware and software of computers. In other words, soon the computer started to evolve. Each such technological advancement marks a generation of computers.

3 0
3 years ago
_____ regulate current/voltage flow, similar function as _____,but are smaller, cheaper, and more reliable.
Tpy6a [65]

Direct Current Power regulates current/voltage flow, similar function as unregulated or regulated, but is smaller, cheaper, and more reliable.

<h3>What is Direct Current Power?</h3>
  • In contrast to the flow of a river, direct current is a technique in which electricity constantly flows in the same direction. It speaks about the flow of electricity produced by batteries, solar cells, and other sources.
  • Alternating current (AC), on the other hand, is a technique in which the positive and negative sides are consistently swapped at regular intervals, changing the direction of the electricity flow in accordance.
  • This is the electricity that comes from a generator or a plug-in.
  • Alternating current is used to transmit both the electricity generated at power plants and the electricity delivered to houses.

To learn more about Direct Current Power, refer:

brainly.com/question/1402412

#SPJ4

8 0
2 years ago
Other questions:
  • In this type of network, data is certain to reach its destination.
    7·1 answer
  • What part of the code is a signal for the function to execute and pass back a value?
    11·2 answers
  • Pseudocode is an improvement over the IPO chart because it lays out the a0 sequence of steps for a particular program.
    6·1 answer
  • 5. RAM IS YOUR SYSTEM’S-
    14·2 answers
  • Evolution of computers
    13·2 answers
  • Heres the last questions
    5·1 answer
  • Write a class called Date that represents a date consisting of a day, month, and year. A date object should have the following m
    10·1 answer
  • Write a small program that takes in two numbers from the user. Using an if statement and an else statement, compare them and tel
    12·1 answer
  • Is the most important characteristic of a hard drive.​
    7·2 answers
  • You have a filtered dataset for Customer Sales with some null value rows. You want to remove these rows completely. How will you
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!