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
galina1969 [7]
3 years ago
11

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. If random number generated is 0, then print "there is no wind", if 1 to 6 then print "this is a breeze", if 7 to 9 "this is a gale", if 10 to 11 print "this is a storm", if 12 print "this is a hurricane!". (Hint: use range or multiple values in case statements like case {1,2,3,4,5,6})
Required:
Re-write this switch statement as one nested 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:
joja [24]3 years ago
4 0

Answer:

The equivalent if statements is:

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>The solution is straight forward.</em>

<em>All you need to do is to replace the case statements with corresponding if or else if statements as shown in the answer section</em>

You might be interested in
Session Hijacking refers to the exploitation of a valid computer session where an attacker takes over a session between two comp
noname [10]

Answer:Weak session ID generation algorithm

Explanation: Session hijacking is the hacking by disguising as the authenticated user and illegally exploit the particular computer session. IP packets are invoked by the disguised attacker into the active session between the legal computer user. It is also called session key.

It gives the hacker to use the data and services of the computer in an unauthorized manner. It arises due to the session of communication are not secure and strong,key used for session is weak etc.

5 0
3 years ago
Given the scenario, before leaving the office, you ask the CIO to provide which formal document authorizing you to perform certa
Leona [35]

Answer:4. Authorization memo

Explanation: Authorization memo is a document that gives a go ahead to perform certain activities on the network, gives you the opportunity to work on the network on behalf of the CIO, although you are as well reminded that you are only doing this on behalf of someone, therefore advised to take precautions. Authorization memo is a reminder formal document that gives you access to do something on behalf of your CIO.

4 0
3 years ago
An enterprise DBMS is automatically capable of serving as a mobile DBMS. There are no special issues raised by mobility. True Fa
pishuonlain [190]

Answer:

The answer is True.

Explanation:

The enterprise DBMS can also be used with mobile DBMS.

Enterprise DMBS is the latest version of DBMS which is used in organizations and enterprises to handle a huge amount of Data.

Enterprise Database Management System is mainly designed to do large work simultaneously. It can handle multiple queries simultaneously.  

Multiple users (about 100-10,000 users) can access data at the same time and even they can manipulate simultaneously.

The features of Enterprise DBMS is to work efficiently, multi processing, fast, accurately, and handling huge burden of data.

4 0
3 years ago
Describe ways in which an interpersonal learner prefers to learn. Write a paragraph of two to three sentences that explains your
Artyom0805 [142]
An interpersonal learner prefers to learn through interactions with other people. They learn through use of interpersonal skills and communication. They like to be coached and to coach others. So mentoring and apprenticeship is a good way. Moreover, group activities, like group study and role-play are excellent ways fro interpersonal learners to learn.
5 0
3 years ago
The _____________________ property controls the text appearing in the title bar on a Windows Form object.
Maslowich

Answer:

The correct answer to the given question is: "Text".

Explanation:

The windows form object is part of the vb.net.The term vb.net is divided into two parts (vb+.net). The term vb stands for visual basic and the .net stands for the network enable technology. It is a language that is not case sensitive. It is an object-oriented programming language like c++, java. It is used for making a wide range of Windows, Web, Mobile, and Office applications. which can be built on the .NET Framework. As we know that vb.net is used for making window applications. when we open windows form there is a two type of form first for the design and second for coding. In the designing page, there is text property. To use this property we display the text into the title bar.

So the correct answer is text.

4 0
3 years ago
Other questions:
  • Write an expression that will print "in high school" if the value of user_grade is between 9 and 12 (inclusive). Sample output w
    12·1 answer
  • Which consol was dominant in the US market between 1993 and 1998
    8·1 answer
  • Explain briefly why the discovery phase is a favorite with many developers
    5·1 answer
  • State whether true or false.
    6·1 answer
  • J. A computer on a network that acts as the central storage location for
    5·1 answer
  • Suppose that a is a one-dimensional array of ints with a length of at least 2. Which of the following code fragments successfull
    8·1 answer
  • Assume that you have an ArrayList variable named a containing 4 elements, and an object named element that is the correct type t
    9·1 answer
  • How is an interpreter different from a compiler?
    9·2 answers
  • What is pseudocode? O A way of describing a set of instructions in text form using plain english O A diagrammatic representation
    13·1 answer
  • How will you keep the buzz going post-hackathon?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!