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
hi friends I got the answer down load tutu app from chrome then from tutu app we can download any rare games for ex. Pokemon sun
svlad2 [7]

Answer: Cool!

Explanation: That's sounds amazing!^^

7 0
4 years ago
Who has a brainpop acct. can i pls use it !
RSB [31]

Answer:

Союз нерушимый республик свободных

Сплотила навеки Великая Русь.

Да здравствует созданный волей народов

Единый, могучий Советский Союз!

Славься, Отечество наше свободное,

Дружбы, народов надежный оплот!

Знамя советское, знамя народное

Пусть от победы, к победе ведет!

Сквозь грозы сияло нам солнце свободы,

И Ленин великий нам путь озарил.

Нас вырастил Сталин - на верность народу

На труд и на подвиги нас вдохновил.

Славься, Отечество чаше свободное,

Счастья народов надежный оплот!

Знамя советское, знамя народное

Пусть от победы к победе ведет!

Skvoz grozy siialo nam solntse svobody,

I Lenin velikij nam put ozaril.

Nas vyrastil Stalin - na vernost narodu

Na trud i na podvigi nas vdokhnovil.

Slavsia, Otechestvo chashe svobodnoe,

Schastia narodov nadezhnyj oplot!

Znamia sovetskoe, znamia narodnoe

Pust ot pobedy k pobede vedet!

Мы армию нашу растили в сраженьях,

Захватчиков подлых с дороги сметем!

Мы в битвах решаем судьбу поколений,

Мы к славе Отчизну свою поведем!

Славься, Отечество наше свободное,

Славы народов надежный оплот!

Знамя советское, знамя народное

Пусть от победы к победе ведет!Explanation:

8 0
3 years ago
A _______ is the most commonly used input device.
nirvana33 [79]
The answer is B.Keyboard
4 0
3 years ago
Read 2 more answers
Which evaluation factor will be most important when choosing technology for the company
soldier1979 [14.2K]

Answer and Explanation:

Look for a company's latest updates, see what servers they use, check if they're using the latest technology like containers or AI and look for how flexible they are with regards to change and innovation.

7 0
3 years ago
if anyone is on a Chromebook, do you ever mean to press backspace, then you accidentally press the power button and think "OH CR
Pie

Answer:

every single day of my life

7 0
3 years ago
Read 2 more answers
Other questions:
  • Preserving confidentiality, integrity, and availability of data is a restatement of the concern over interruption, modification,
    15·1 answer
  • Create a script that asks for the visitor's weight in pounds and his/her height in inches. The program should then calculate the
    13·1 answer
  • Samantha was calculating a mathematical formula on an electronic spreadsheet. She used multiple values to recalculate the formul
    7·2 answers
  • Define a class named ComparableSquare that extends Square (defined above) and implements Comparable. Implement the compareTo met
    7·1 answer
  • You have two DCs, each with three Active Directory-integrated zones. You're getting inconsistent DNS lookup results and suspect
    8·1 answer
  • 30 POINTS !!!!!!!!
    12·1 answer
  • Which option correctly describes a DDMS application?
    6·1 answer
  • When using a small mic that attaches to your interview subject, where should you place that mic and why?
    5·1 answer
  • What are some similarity's between NES console and consoles today
    14·2 answers
  • Which keyboard shortcut can you use to access the go to feature, which will allow you to move quickly to another location in the
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!