subject

Consider the method total below: public static int total (int result, int a, int b) {     if (a == 0)    {      if (b == 0)      {         return result * 2;      }      return result / 2;       }    else    {      return result * 3;    } }           The assignment statement x = total (6, 0, 0); must result in x being assigned the value 8

2) 
x being assigned the value 4

3) 
x being assigned the value 5

4) 
x being assigned the value 12

5) 
x being assigned the value 10

Consider the following definitions:
public boolean someMethod (int[] list, int value)
{
   int counter;
   boolean flag = false;
   for (counter = 0; counter < list. length; counter++)
   {
     flag = (list[counter] != value);
   }
   return flag;
}
Under which of the following conditions must the method above return true?

1) 
Under all conditions

2) 
Under the condition that value == list[list. length − 1]

3) 
Under the condition that value != list[list. length − 1]

4) 
Under the condition that value != list[i] for all i such that 0 <= i < list. length

5) 
Under no conditions

What is the output of the program shown below? (1 point)
public class SomeClass
{
   private int x, y;
       public SomeClass (int xValue, int yValue)
   {
     x = xValue;
     y = yValue;
   }            
   public void m1()
   {
     x = 30;
     System. out. print((y + 1) + " ");
   }
   public void m2()
   {
     m1();
     System. out. print(x + " ");
   }
}
public class SomeTester
{
   public static void main (String[] args)
   {
     int x = 20;
     int y = 10;
     SomeClass z = new SomeClass(x, y);
     z. m2();
     z. m1();
   }
}

21 10 21

2) 
21 30 21

3) 
11 30 11

4) 
1 10 11

5) 
11 30 21

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 20:00
What statement best describes operating systems? it’s possible for modern computers to function without operating systems. most operating systems are free or very inexpensive. operating systems are managed by the computer’s microprocessor (cpu). operating systems manage the computer’s random access memory (ram).
Answers: 1
question
Computers and Technology, 23.06.2019 11:00
What are the possible consequences of computer hacking? what is computer piracy? describe some examples. what are the effects of computer piracy? what are the possible consequences of computer piracy? what is intentional virus setting? describe some examples. what are the effects of intentional virus setting? what are the possible consequences of intentional virus setting? what is invasion of privacy? describe some examples. what are the effects of invasion of privacy? what are the possible consequences of invasion of privacy? what is an acceptable use policy and what is the purpose of the acceptable use policy what is intellectual property and how can you use it?
Answers: 1
question
Computers and Technology, 23.06.2019 20:30
What are some settings you can control when formatting columns?
Answers: 1
question
Computers and Technology, 23.06.2019 21:00
Uget brainliest if accurate mary has been given the responsibility of hiring a person for the position of a software testing officer. which management function would mary achieve this responsibility?
Answers: 1
You know the right answer?
Consider the method total below: public static int total (int result, int a, int b) {     if (a == 0...
Questions
question
Social Studies, 24.10.2019 04:50
question
Mathematics, 24.10.2019 04:50
question
Mathematics, 24.10.2019 04:50
question
Mathematics, 24.10.2019 04:50
question
Mathematics, 24.10.2019 04:50
Questions on the website: 13722367