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
Which job qualifications are typical for someone who wants to work in Information Support and Services?
trapecia [35]

Answer:

The Answer Is A.) math skills, communication skills, time management skills

Explanation:

Information Support and Services Qualifications

Common qualifications include:

• problem-solving, math, logic, and critical-thinking skills for reasoning through problems.

• time-management and organizational skills for planning, scheduling, and prioritizing

projects.

• the ability to break down large projects into small pieces and tasks.

• creativity for coming up with ideas and designs and flexibility for adjusting to changes.

• knowledge of computers, software, and related tools and equipment.

• teamwork and communication skills for coordinating with, teaching, and listening to

others.

• leadership skills for supervising others and stress-management skills for handling

responsibility.

• independence for staying focused when working alone and for making decisions.

• the ability to learn quickly and to keep knowledge and skills current with new technologies

4 0
2 years ago
Read 2 more answers
How long will twenty percent of battery life last me?
Ghella [55]
About one or two hours.
5 0
3 years ago
Read 2 more answers
How to get on website?
Nitella [24]

Answer:

You are probably blocked from that website or your schools program blocks that website from your device

Explanation:

4 0
3 years ago
Which avenue may utilize video streaming, audio narration, print designs and animation?
Shtirlitz [24]

Answer:

Multimedia avenue.

Explanation:

A file type is the standard used to store data such as pictures, texts, videos, and audios. All file types have unique file extension that determine which program to use to open a particular file and to access its data e.g pictures (jpeg, png), texts (txt, docx, rtf), videos (mp4, 3gp, avi), audios (mp3, acc).

Sometimes, computer users make the mistake of opening files with the wrong software application or program, this often leads to an error due to the incompatibility of the software application with the particular file.

Basically, all software applications are designed and developed for use with specific file extensions or formats and as such, when used to open a file it isn't developed for, it result in an error.

A multimedia avenue refers to a channel that is designed and developed to accept, utilize and combine various file formats such as audio, video, text, animation effects, etc. A common example of a multimedia avenue is Microsoft PowerPoint software.

Hence, the multimedia avenue may utilize video streaming, audio narration, print designs and animation.

8 0
3 years ago
Please describe the role of games in modern society!
ohaa [14]
It is to Entertainment.
5 0
2 years ago
Read 2 more answers
Other questions:
  • Which type of hypervisor does not run on an underlying operating system?
    13·1 answer
  • This is not homework but how do you fix this I’ve tried everything
    9·1 answer
  • Which technique helps you look confident as a speaker?
    15·1 answer
  • A(n ____ is used to describe the characteristics of data used in a database or other type of computer system.
    12·2 answers
  • What kind of app or technology would you like to create?  Why ? <br><br><br>​
    11·1 answer
  • What is human data,
    8·1 answer
  • (I WILL GIVE BRAINLIEST) Which steps will delete an appointment?
    8·1 answer
  • Add me on blizzard none of my friends play ow<br> NADERJABER#2530
    8·1 answer
  • Which function category is not in Excel 2016?
    12·2 answers
  • Miley met up with a bunch of her college friends after several years. She told them that she works for the sound department of a
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!