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
The maximum number of characters that a cell can contain is
lina2011 [118]
The answer is:

32,767
6 0
2 years ago
Read 2 more answers
What is the preferred procedure for putting customers on hold​
vesna_86 [32]

Answer/Explanation:

Explain the reason you need to put the caller on hold.

Ask for the person's phone number, in case the conversation is cut off.

Promise to return in a minute—or your best estimate of how long the hold will last. If you think the delay will be longer than a couple of minutes, ask for a number and a time when you can call back.

If, despite your best efforts, the delay is taking longer than anticipated, check in with the caller so that he doesn't feel abandoned. Again, offer to call back, "rather than keep you holding."

When you return to the phone, apologize for the inconvenience and thank the caller for his patience.

Use the caller's name frequently to add a sense of connection.

The first step you can take when putting a caller on hold and making it a satisfying experience is a systematic one. When a caller is on hold, 60 seconds seems like an eternity, so see if you can program the phone system to play music (calming classical or jaunty jazz is best) to break this perception of an interminable wait. Aside from that, however, putting someone on hold in a professional way depends on your behavior. The golden rule to keep in mind is as follows: how would you like to be treated if you were on the other end of the line?

MAKE ME THE BRAINLIEST!!!!!!!!!!!!

8 0
3 years ago
Read 2 more answers
Complete the procedure for pasting content from a Word document in a message by selecting the correct term from
motikmotik

Answer:

Ctrl + C

in the body

Explanation:

4 0
3 years ago
Read 2 more answers
what field in the ipv4 datagram header can be used to ensure that a packet is forwarded through no more than N headers
andrew-mc [135]

Answer:

Time to Live (or TTL)

Explanation:

This counter field is initially set at some value that is decremented by one each time the packet "hops." When the counter reaches zero the packet is disposed of.

5 0
1 year ago
You would like to help guide your company in choosing between valuing privacy and increasing the company's bottom line. What is
Ainat [17]

In the above case, the option that will help to guide your company in choosing between valuing privacy is a set of internal principles.

<h3>What are internal control principles?</h3>

The principles of internal control are known to be  needed in the management to set methods in place to make sure that company assets are kept.

Therefore, In the above case, the option that will help to guide your company in choosing between valuing privacy is a set of internal principles.

Learn more about internal principles from

brainly.com/question/27015769

#SPJ1

6 0
2 years ago
Other questions:
  • ___ is the branch of computer science that explores techniques for incorporating aspects of intelligence into computer systems.
    5·1 answer
  • ) The ________ displays a text box and button for users to browse, select, and upload a file. (Points : 3)
    13·1 answer
  • How do you ask someone for help?
    6·1 answer
  • If I put a short clip from a copyrighted video to Facebook and make it only viewable to friends, is that illegal?
    12·1 answer
  • The unique global address for a web page or other resource on the internet is called the ________.
    7·1 answer
  • Having friends who cause you stress can decrease your happiness, which can in turn
    13·2 answers
  • I NEED HELP ASAP
    8·1 answer
  • If an occupation is projected to decline by 7% over the next 10 years, how would you rate the job outlook? (6 points)
    14·1 answer
  • How to mark a discussion as read on canvas dashboard.
    10·1 answer
  • Question #1
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!