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
Basil was reading about a new attack that forces the system to abandon a higher cryptographic security mode of operation and ins
Murljashka [212]

Since Basil was reading about a new attack that forces the system to abandon a higher cryptographic security mode of operation and the kind of attack is known to be Downgrade attack.

<h3>What is downgrade security attack?</h3>

A downgrade attack is known  to be a kind of of cyber attack that is made up of the fact that an attacker is known to often forces a network channel to make a switch to a kind of an unprotected or one that is said to be less secure data transmission standard.

Note also that the  Downgrading of a given protocol version is said to be a key element of  a type of a  man-in-the-middle attacks, and it is known to be one that is often used to take or hijack encrypted traffic.

Hence, Since Basil was reading about a new attack that forces the system to abandon a higher cryptographic security mode of operation and the kind of attack is known to be Downgrade attack

Learn more about Downgrade attack from

brainly.com/question/24304791

#SPJ1

3 0
1 year ago
How do i unblock a website on a school computer if a school blocks it?
tresset_1 [31]

Answer:

look up ultrasurf and just follow the thingy and it will download a vpn ive had it on my computer for a fat min

Explanation:

4 0
2 years ago
Why coaxial cable is called coaxial cable?
lyudmila [28]

Answer: Coaxial Cable got its name as "coaxial cable" as it has two physical layer of channel in same cable axis.

Explanation: Coaxial cable is the cable that is basically composed of copper and shield of other materials.They have two physical channels and having a insulating layer between them and the outer layer serving as the ground layer. Both the channel of physical layer have the same axis that why it is termed as "coaxial".These cables are commonly used in the cable televisions , sometimes in telephone line etc.

3 0
3 years ago
Java Homework:(The Person, Student, Employee, Faculty, and Staff classes) Design a class named Person and its two subclasses nam
miss Akunina [59]

Answer: Wait, so what is the question exactly..?

8 0
3 years ago
What is mark in in premiere pro
Studentka2010 [4]
Markers are an often underutilized tool in the Premiere Pro CC toolbox. They are little colored tabs you can apply to both your timeline and your source clips to indicate important points in time with a color or note.
5 0
2 years ago
Other questions:
  • You created a vm and installed windows server 2008 r2 over the network, using pxe boot. when you start the vm, it doesn't attemp
    7·1 answer
  • Assume that play_list refers to a non-empty list, and that all its elements are integers. Write a statement that associates a ne
    7·1 answer
  • ________ are websites that provide collections of content from all over the world wide web a. aggregators b. social networks c.
    6·1 answer
  • Keyboard question: <br> How do I make the 'congruent to' symbol on this keyboard?
    8·1 answer
  • Write a Python program calculate summary statistics about a class assignment. First, prompt the user for the number scores to be
    6·1 answer
  • In Python, parentheses are used in calculations where the order of operations affects the outcome. (5 points)
    9·1 answer
  • The main part of your program has the following line of code.
    7·1 answer
  • How i simplify this boolean expression ?A'.B'.C'+A'.B'.C+A'.B.C+A.B'.C+A.B.C
    6·2 answers
  • 10. List three adaptations of wind-pollinated plants to promote pollination.<br>​
    12·1 answer
  • If you try to add a new item to a full stack the resulting condition is called a(n)?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!