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]
2 years ago
15

Can you structure this code in if-statements?

Computers and Technology
1 answer:
Naddika [18.5K]2 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
When you sort a cell range using a to z or z to a, what is rearranged?
kvv77 [185]
Only those cells names. Most common mistake in excel. If you want to sort rows make sure you highlight everything and then use sort function on column
5 0
3 years ago
BIE, but plz help me on this ASAP!!! GIVING A BRAINLIEST... For this activity, imagine that you have been asked to teach a frien
WITCHER [35]

Answer:

DM me I have an answer set up but it won't let me here because it's "too long" hope to here back from you! (sorry about this Brainly has been acting up on me lately!!!!!)

Explanation:

3 0
3 years ago
What is the best scenerio for
Stels [109]

Answer:

the teacher said a (dash) reads pages on website pls answer me now i have to write it now

5 0
2 years ago
Read 2 more answers
Para que se utiliza openoffice en la vida cotidiana?
Mama L [17]
OpenOffice se utiliza para organizar y presentar los datos o la información de otra manera.

espero y te ayude! : )
3 0
3 years ago
Read 2 more answers
When using bits to represent fractions of a number, can you create all possible fractions? Why or why not?
kumpel [21]

Answer:

The essence including its issue is listed in the interpretation subsection below.

Explanation:

  • Representing means the practice of someone using abstract, tangible as well as pictorial symbols as well as phrases and related circumstances to discuss ideas and express comprehension.
  • Representing fractions could indeed be overcome in almost the same manner as the positive factors of twice represented integers are using the negative factors of two to summarize to essentially fractional amounts.
4 0
3 years ago
Other questions:
  • What were the first microblogs known as
    12·2 answers
  • Which cisco ios command is used to display the current ospf neighbors and their rids?
    11·1 answer
  • It is a function that ends the connection to the database.
    9·2 answers
  • The function below takes a string argument sentence. Complete the function to return the second word of the sentence. You can as
    5·1 answer
  • Leah wants to add an image to her updated presentation, so she wants to access the Help interface. What should
    11·2 answers
  • Rob creates a Course_Details table that has four columns: Course _ID, Course_Name, Semester and Credits. A course may have 0.5 c
    6·2 answers
  • When you are working in Performance Monitor, in the "Add Counters" dialog box, and need more information about a particular coun
    8·1 answer
  • Can you help me, please
    10·1 answer
  • HURRRY WILLL GIVE BRAINLIST!!!!!!
    12·1 answer
  • What dictionary operation can you use to remove all the keys within the dictionary-named contacts?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!