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
Please help!!!! will mark brainliest!!
fgiga [73]

Answer:

1. Speaking or texting on the cell phone while driving.

= It cause an accident.

2. Using technology for bullying others.

Hope this answer will help you.

7 0
3 years ago
Read 2 more answers
John was carrying on at the water cooler the other day, trying to show off his knowledge of networking. He claimed that the comp
alexdok [17]

Answer:

The correct answer for the following question is UTP cables.

Explanation:

UTP : It stands for Unshield Twisted Pair cables, used in telecommunication industry and computer as an Ethernet cables widely.

There are five types of UTP cables :

  • CAT3 (mainly placed in phone lines, rarely used)
  • CAT4 (available in token ring networks)
  • CAT5 (two twisted pairs contained)
  • CAT5e (four twisted pairs contained)
  • CAT6

In this UTP cables, the copper wires are covered with metallic shielding which provides the balanced signal and minimize electronic involvement.  

7 0
3 years ago
Suppose that you have the following declaration:
masha68 [24]

Answer:

Explanation:

The code is written in C++:

#include <iostream>

#include <stack>

#include <math.h>

#include <iomanip>

using namespace std;

/*

* Supporting method to print contents of a stack.

*/

void print(stack<double> &s)

{

if(s.empty())

{

cout << endl;

return;

}

double x= s.top();

s.pop();

print(s);

s.push(x);

cout << x << " ";

}

int main(){

// Declaration of the stack variable

stack<double> stack;

//rray with input values

double inputs[] = {25,64,-3,6.25,36,-4.5,86,14,-12,9};

/*

* For each element in the input, if it is positive push the square root into stack

* otherwise push the square into the stack

*/

for(int i=0;i<10;i++){

if(inputs[i]>=0){

stack.push(sqrt(inputs[i]));

}else{

stack.push(pow(inputs[i],2));

}

}

//Print thye content of the stack

print(stack);

}

OUTPUT:

5     8     9     2.5     6     20.25     9.27362     3.74166     144     3

-------------------------------------------------------------------------

Process exited after 0.01643 seconds with return value 0

Press any key to continue . . . -

6 0
3 years ago
7.
lina2011 [118]

Answer:

16GB RAM

Explanation:

4 0
2 years ago
Use the drop-down menus to complete statements about the two formats for importing contacts.
oee [108]

Answer:

The PST file format can only be imported into contacts by the outlook

program.

The CSV file type can be created from a document or spreadsheets

and can be imported by multiple email programs.

Explanation:

6 0
3 years ago
Read 2 more answers
Other questions:
  • You are using Windows 10 and you have created a file with called “my text” in notepad with a .txt extension type. You need to ch
    13·1 answer
  • list six external parts or peripherals of a computer system and identify which are output and which are input devices
    8·1 answer
  • Differentiate between Software as a service, platform as a service and infrastructure as a service.
    14·1 answer
  • Each webpage is assigned a(n) ______, an address that identifies the location of the page on the Internet.
    6·1 answer
  • A computer is a multipurpose device that accepts input, processes data, stores data, and produces output, all according to a ser
    9·1 answer
  • Kathy created a video presentation of her company, which will be shown on a television show as an advertisement. Her company wan
    11·1 answer
  • What is project scope? a. Quantifiable criteria that must be met for the project to be considered a success b. Products, service
    5·1 answer
  • Given an char variable last that has been initialized to a lowercase letter, write a loop that displays all possible combination
    8·1 answer
  • How do you increase the number of tries by one?
    10·1 answer
  • What are backup storage devices of computer? Why are they necessary in the computer system?​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!