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
shepuryov [24]
2 years ago
13

Rewrite this if/else if code segment into a switch statement int num = 0; int a = 10, b = 20, c = 20, d = 30, x = 40; if (num &g

t; 101 && num <= 105) { a += 1; } else if (num == 208) { b += 1; x = 8; } else if (num > 208 && num < 210) { c = c * 3; } else { d += 1004; }
Computers and Technology
1 answer:
Tanya [424]2 years ago
3 0

Answer:

public class SwitchCase {

   public static void main(String[] args) {

       int num = 0;

       int a = 10, b = 20, c = 20, d = 30, x = 40;

       switch (num){

           case 102: a += 1;

           case 103: a += 1;

           case 104: a += 1;

           case 105: a += 1;

           break;

           case 208: b += 1; x = 8;

           break;

           case 209: c = c * 3;

           case 210: c = c * 3;

           break;

           default: d += 1004;

       }

   }

}

Explanation:

  • Given above is the equivalent code using Switch case in Java
  • The switch case test multiple levels of conditions and can easily replace the uses of several if....elseif.....else statements.
  • When using a switch, each condition is treated as a separate case followed by a full colon and the the statement to execute if the case is true.
  • The default statement handles the final else when all the other coditions are false
You might be interested in
 A programming paradigm is a method used to program a computer that guides the solving of a problem or performing of a task. Whi
kaheart [24]

The one that best describes the procedural or imperative, programming paradigm as it uses a linear, top-down approach to solving problems. The correct option is D.

<h3>What is a linear approach?</h3>

It describes a method of programming where an application is created by first defining at a high level what it should be able to accomplish, then breaking that down into smaller and smaller sections.

Without going into specifics about any of the system's components, the top-down model presents an overview of the whole. The definition is then progressively improved, detailing each element in more detail until it is complete enough to validate the model.

Therefore, the correct option is D. It uses a linear, top-down approach to solving problems.

To learn more about programming paradigm, refer to the link:

brainly.com/question/17150647

#SPJ1

8 0
1 year ago
Describe the advantages of this trend from the point of view of the patient or the healthcare provider.
dmitriy555 [2]

Answer:incomplete question

Complete question:

Describe the advantages of this trend of electronic health records from the point of view of the patient or the healthcare provider.

Answers:

1. Better health care system

2. Better Clinical decision making

3. Improved health efficiency and lower health care cost.

Explanation:

Better health care by improving all aspects of patient care, including safety, effectiveness, communication, education, timeliness and equity.

Improved efficiencies and lower health care costs by promoting preventative medicine and improved organization of health care services, as well as by reducing waste and unproductive tests.

8 0
2 years ago
Can Any body Define what is search engine in a simple language quick please​
Komok [63]

Answer:

It is the SQL of WWW. Or in other words, it is the web tool that helps the users in locating the required information on the WWW. Various top search engines are like Google, MSN, and Yahoo. And the information that is gathered by the spider is used for creating the searchable index for the content on the web. This spider crawls according to the search engine algorithm and that is known as web crawling.

Explanation:

Please check the answer section.

6 0
3 years ago
Complete the following Programming Assignment using Recursion. Use good programming style and all the concepts previously covere
Likurg_2 [28]

Answer:

Explanation:

public class Ackermann {

   public static int ackermann's(int m, int n) {

       if (m == 0) {

           return n + 1;

       } else if (n == 0) {

           return ackermann's(m-1, 1);

       } else {

           return ackermann(m - 1, ackermann(m, n - 1));

       }

   }

   public static void main(String[] args) {

       System.out.println(ackermann(0, 0));

       System.out.println(ackermann(0, 1));

       System.out.println(ackermann(1, 1));

       System.out.println(ackermann(1, 2));

       System.out.println(ackermann(1, 3));

       System.out.println(ackermann(2, 2));

       System.out.println(ackermann(3, 2));

   }

}

1

2

3

4

5

6

7

29

Process finished with exit code 0

6 0
3 years ago
How bridges are built over water
Black_prince [1.1K]
It’s all depending on what method
4 0
2 years ago
Other questions:
  • Damion recently did an update to his computer and added a new video card. After the update, Damion decided that he would like to
    13·1 answer
  • Which individual of the following would be most likely to be directly concerned with web security?
    14·2 answers
  • Which of these can be considered data?<br> A:facts<br> B:information<br> C:belief<br> D:all of these
    9·1 answer
  • Use a one-dimensional array to solve the following problem: A company pays its salespeople on a commission basis. The salespeopl
    6·1 answer
  • What are the advantages of repeating a header row? check all that apply
    14·1 answer
  • What would you use to compare two date ranges in a report?
    9·1 answer
  • Two technicians are discussing a resistance measurement. Technician A states that components being measured should be removed or
    10·1 answer
  • What was the first fully computer animated feature film?
    13·1 answer
  • The loss of privacy data has implications:
    5·1 answer
  • All of the following are examples of service learning opportunities exept
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!