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
Fiesta28 [93]
3 years ago
15

Can you structure this code in if-statements?

Computers and Technology
1 answer:
Naddika [18.5K]3 years ago
3 0
Not sure what quizScore1-5 is, but here it is. Also, I'm not entirely sure what language you're working with here, but null can't be returned as an integer. If it were a string, for example, it'd be possible as string is an object reference type.

public int getData(int dataNumber)
{
    if (dataNumber == 1)
        return quizScore1;
    else if (dataNumber == 2)
        return quizScore2;
    else if (dataNumber == 3)
        return quizScore3;
    else if (dataNumber == 4)
        return quizScore4;
    else if (dataNumber == 5)
        return quizScore5;
    else
        return 0;
}
You might be interested in
What type of socket should be used with an air impact wrench
Vikentia [17]
<span>Black sockets should be used, but the color is not the reason why. Chrome sockets will cause splits to form in the socket walls pretty quickly, after only a few uses. But the black sockets are that color because they have gone through a process called Parkerizing that coats the surface of the socket in order to provide more resistance when being used and protect the socket against corrosion.</span>
3 0
3 years ago
Tuesday
4vir4ik [10]

Answer:

?

Explanation:

these are instructions to a question?

7 0
3 years ago
What dose a bios system do?
ANTONII [103]
BIOS instructs the computer on how to preform basic functions such as booting and keyboard control. It is also used to identify and configure the hardware in a computer
4 0
3 years ago
Read 2 more answers
Which group on the Note Master tab contains the command to add footers to the notes pages?
nasty-shy [4]

Answer:

Place Holders

Explanation:

5 0
3 years ago
A data visualization tool that updates in real time and gives multiple outputs is called
strojnjashka [21]

Answer:

A data dashboard

Explanation:

3 0
3 years ago
Other questions:
  • Differentiate among web apps, mobile apps, and mobile web apps.
    14·2 answers
  • What is the difference, if any, between secure HTTP and firewalls?
    13·1 answer
  • Which of the following methods for learning to use new software includes tips for using the product, updates to download, and in
    7·2 answers
  • How to find out what windows version i have?
    10·1 answer
  • Drag each label to the correct location on the image. Match the movie qualities with the right period of movies.
    8·1 answer
  • Select the correct answer. Which input device uses optical technology?
    5·1 answer
  • what could a company do if it was using a commercial wan and a vulnerability appered thst allowed attackers
    11·1 answer
  • A brick has a weight of 23N. The brick is flat and smooth on the side in contact with the floor having measurements ( height= 5c
    13·1 answer
  • Most portable devices, and some computer monitors have a special steel bracket security slot built into the case, which can be u
    13·1 answer
  • Which is true for comments? Group of answer choices The compiler does not generate machine code for comments. The compiler conve
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!