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 does it mean to say that a graph is complete?
melisa1 [442]

Explanation:

The statement which says that a graph is complete means an undirected graph whose every pair of vertices is connected by an particular edge or unique edge.

An undirected graph is a graph whose edges soea not contain any direction means to which vertex they are directed.

A complete graph has an edge between every pair of vertices that exist in that graph.

3 0
3 years ago
Write the definition of a function named swapints that is passed two int reference parameters. The function returns nothing but
Alja [10]

Answer:

void swapints(int *j,int *k)//Function definition.

{

   *j=*j+*k-(*k=*j); //value swapping.

}

swapints(&j,&k);//call the function.

Explanation:

  • The above function definition takes the address of j and k variables which is stored on the pointer variable j and k.
  • Then the pointer variable uses the j and k value for the above expression, and the user does not need to return the value of j and k.
  • But when the user prints the value of the j and k variable, then he gets the swapping value of the j and k variable.
  • The user needs to know that the "int j" is a normal variable, but "int *j" is a pointer variable that is used to take the address of j variable.
3 0
3 years ago
JAVA
marshall27 [118]

Answer:

Answer is in the provided screenshot!

Explanation:

Steps required to solve this problem:

1 - define what characters are "vowels" by assigning them to an array.

2 - create a variable to record the amount of vowels there are in the string.

3 -  convert the input string into a character array and iterate through each character

4 - for each of the character of the string we go through, check if it matches any of the vowels

5 - return true if the vowel count is greater than 1

Alternative methods using the Java Stream API have also been wrote, please respond if you require them.

7 0
3 years ago
ASAP help me I dont have enough time
umka21 [38]

Answer:third stage of parent-infant attachment

Explanation:

7 0
2 years ago
7d2b:00a9:a0c4:0000:a772:00fd:a523:0358
motikmotik

Answer:

yh3iuskjldnsjfhbcgfihekwfhei3wh8hfefbgp

Explanation:

6 0
3 years ago
Other questions:
  • Problem 1 Calculating the tip when you go to a restaurant is not difficult, but your restaurant wants to suggest a tip according
    6·1 answer
  • Which of the following is the best example of a manager with a delegator leadership style
    10·2 answers
  • How do computers find servers, requests information from the server, and receives it?
    12·1 answer
  • It is illegal to have __________ emergency lights on your vehicle.
    6·2 answers
  • 1. How has ESPN handled the rise of Twitter? How has it incorporated Twitter into Sports Center?
    7·2 answers
  • What is the main feature of Ethernet over Power?
    9·1 answer
  • 1) Using the density equation d=m/V: What is the density of a piece of metal with a mass o
    10·1 answer
  • The most important hardware device for connecting supercomputers over a wide area
    10·1 answer
  • What are the primary IP addresses for DNS servers hosted on the x128bit, iskytap and cloudparadox domains
    8·1 answer
  • The _____ constraint assigns a value to an attribute when a new row is added to a table
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!