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 (5, 0, 0);
must result in

x being assigned the value 4
x being assigned the value 8
x being assigned the value 5
x being assigned the value 2
x being assigned the value 10

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 06:30, jayjay5246
Which option correctly describes a dbms application? a. software used to manage databases b. software used to organize files and folders c. software used to develop specialized images d. software used to create effective presentations
Answers: 1
image
Computers and Technology, 23.06.2019 09:30, ranmmm
The place where the extended axis of the earth would touch the celestial sphere is called the celestial
Answers: 1
image
Computers and Technology, 23.06.2019 16:00, natasniebow
Kenny works with an it company. his company is about to launch new software in the market. he has to ensure that this new software is functional and meets all of the quality standards set up at the planning stage. which job profile is kenny likely to have? kenny is likely to have the job profile of a blank .
Answers: 2
image
Computers and Technology, 24.06.2019 04:10, kris1920
Write a program that reads a set of floating-point values. ask the user to enter the values, then print • the average of the values. • the smallest of the values. • the largest of the values. • the range, that is the difference between the smallest and largest. of course, you may only prompt for the values once.
Answers: 3
You know the right answer?
Consider the method total below.
public static int total (int result, int a, int b)
{

Questions in other subjects:

Konu
Mathematics, 23.04.2021 05:40
Konu
Biology, 23.04.2021 05:40
Questions on the website: 13722359