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
ankoles [38]
3 years ago
5

Brainiest To Best Answer!! Java coding help, can you tell me what Switch and Case does using the example below?

Computers and Technology
1 answer:
fiasKO [112]3 years ago
4 0
The switch statement is an n-way branch. An n-way branch can branch to any of an arbitrary number ( n ) of branches. An if statement can branch two ways, whether the condition is true or false.

The example you gave is a great example of how how code is written can make the code make sense or not.

public void setQuiz( int quiz, int grade )
{
  switch( quiz )
  {
    case 1: // if quiz == 1
      grade1 = grade; //where was grade1 declared?
      break;  // otherwise execution will continue through the next case block
    case 2: // if quiz == 2
      grade2 = grade;
      break;
  }
}

The variable named in the switch statement is tested against each case statement and whichever case statement's value matches, the rest of the switch statement's code is executed. (That's why the break statements are needed) Usually switch statements are written with a default case at the end as a "catchall".
You might be interested in
what will be the Trade discount and Invoice Amount if the List Price is $400.00 and the Trade Discount Rate is 85%
V125BC [204]

Answer:

$340

Explanation:

you have to multiply $400 bu 85% to get $340

4 0
3 years ago
What are two types of organizational structures designed to help an organization achieve its goals and objectives?
Fittoniya [83]

The answer is entrepreneurial and bureaucratic. Organizations that are large and small can achieve higher sales and other profit by properly matching their needs with the structure they use to operate.   the structure of an organization can help or hinder its progress toward accomplishing these goals and This are specific set up of organizations and ways to accomplish different goals. 

4 0
3 years ago
Read 2 more answers
Determina la cilindrada total Vt en un motor de 4 cilindres de 83,6 mm de diàmetre per 91 mm de cursa.
insens350 [35]

Answer:

La cilindrada total del motor es de 1997,025 centímetros cúbicos.

Explanation:

Para determinar la cilindrada total Vt en un motor de 4 cilindros de 83,6 mm de diámetro por 91 mm de carrera se debe realizar el siguiente cálculo, sabiendo que para calcular la cilindrada de un motor se debe utilizar la fórmula ((Pi x Diámetro^2)/4) x Carrera x Número de cilindros = X:

((3.14 x 83.6^2)/4) x 91 x 4 = X

((3.14 x 6,988.96)/4) x 364 = X

(21,945.3344 / 4) x 364 = X

5,486.3336 x 364 = X

1,997,025.4304 = X

1 milímetro cúbico = 0.001 centímetro cúbico

1,997,025.4304 milímetros cúbicos = 1997.0254304000005 centímetros cúbicos

Por lo tanto, la cilindrada total del motor es de 1997,025 centímetros cúbicos.

3 0
3 years ago
Explain the characteristics of 1st generation computers​
levacccp [35]

Explanation:

i hope this is the right answer

!st generation computers were more big and bulky and you for sure could not bring them around everywhere.

8 0
3 years ago
What is the legal right granted to all authors and artists that gives them sole ownership and use of their words, software, pict
ICE Princess25 [194]

Answer:

copyright

Explanation:

3 0
3 years ago
Other questions:
  • A size of a jumbo candy bar with rectangular shape is l x w x h. Due to rising costs of cocoa, the volume of the candy bar is to
    9·1 answer
  • Which connector is most commonly used to connect printers to desktop pc systems?
    10·1 answer
  • What key combination in excel takes you back to the first cell
    7·1 answer
  • Given four values representing counts of quarters, dimes, nickels and pennies, output the total amount as dollars and cents. Out
    10·1 answer
  • Bit rate is a measure of how many bits of data are transmitted per second. Compared to videos with a higher bit rate, the same v
    13·1 answer
  • What is online school like 6 sentences
    12·1 answer
  • Over the past year alone, more than _________ have been stolen from Target.
    10·2 answers
  • On what menu in Microsoft Word can you locate the Macro feature?
    10·1 answer
  • A fast way to add up a column of numbers is to click in the cell below the numbers and then: Click Subtotals on the Data menu. V
    6·2 answers
  • 1.Which of the serves as the basis for determining whether an object has moved or not?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!