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
Help me. thank you very much
Scilla [17]

Answer:

3425236235623523334252362356235233342523623562352333425236235623523334252362356235233362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252363623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523636235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252363623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523636235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252363623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523636235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252363623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233  5623523334252362356235233342523636235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252363425236235623523334252362356235233342523623562352332

Explanation:

342523623562352333425236235623523334252362356235233342523 6235233342523636235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425 5236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252363623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523636235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252363623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233342523623562352333425236235623523334252362356235233

4 0
2 years ago
Which of the following is something you need to keep an eye out for
Brilliant_brown [7]

Answer:

D. Pedestrians ignoring DON'T WALK signs

Explanation:

Pedestrians ignoring DON'T WALK signs is something you need to keep an eye out for  near packed intersections.

4 0
3 years ago
Read 2 more answers
Complete the statement below with the correct term.
Lilit [14]

Answer:

<em>Every </em><em>couple</em><em> </em><em>of </em><em>month </em><em>or </em><em>whatever </em><em>you </em><em>give </em><em>it </em><em>to </em><em>someone</em><em> </em><em>else</em>

8 0
2 years ago
Write a function that checks whether two words are anagrams. Two words are anagrams if they contain the same letters. For exampl
Masteriza [31]

Answer:

def isAnagram(s1, s2):

   list1=s1

   list2=s2

   sortedlist1 = sorted(list1)

   sortedlist2 = sorted(list2)

   if sortedlist1 == sortedlist2:

       print(list1+ " and "+list2+ " are anagram")

   else:

       print(list1+ " and "+list2+ " are not anagram")

Explanation:

Here is a call to the function isAnagram():

list1 =input("Enter String1 ")

list1 =input("Enter String2 ")

isAnagram(list1,list2)

Attached is the run and output for this program

4 0
3 years ago
Contemporary Information Systems are interfacing with customers andsuppliers using:A. Electronic commerceB. CRMC. SCMD. all of t
ch4aika [34]

Answer:

D. all of the above

Explanation:

Contemporary Information Systems are interfacing with customers andsuppliers using, electronic commerce, CRM, and SCM.

7 0
3 years ago
Other questions:
  • For each MIPS instruction, show the value of the opcode (OP), source register (RS), and target register (RT) fi elds. For the I-
    13·1 answer
  • Which of the following identifies the patterns used for each data series in a chart?
    13·1 answer
  • A company is utilizing servers, data storage, data backup, and software development platforms over an Internet connection.
    14·1 answer
  • Is it better to meet online or offline<br> (Please answer QUICK)<br><br> Thanks :')
    5·2 answers
  • Which of the following actions is an example of "window dressing?" a. Using some of the firm’s cash to reduce long-term debt. b.
    13·1 answer
  • Given two variables, is Empty of type boolean, indicating whether a class roster is empty or not, and number Of Credits of type
    10·1 answer
  • Describe three perimeter intrusion detection systems and give an example of one that you have seen deployed either at work or an
    8·1 answer
  • Your sister asks you if it is possible to get an office productivity suite for free. What do you tell her?
    13·1 answer
  • What will be result of below if statement.
    13·1 answer
  • What type of app is Drake designing? Drake is designing a mobile app for an online travel blog. The app will enable browsers to
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!