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

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 22:00
Technician a says engine assemblies can be mounted longitudinally in a chassis. technician b says engine assemblies can be mounted transversely in a chassis. who is correct?
Answers: 2
question
Computers and Technology, 24.06.2019 16:00
"gps interaction and cognitive process" respond to the following: imagine that you have been asked to design a gps product that will have voice recognition and bluetooth capability. discuss and conceptualize a user interaction model. predict two (2) problems that may arise in gps products with voice recognition and bluetooth capability. recommend solutions for each of these issues. attention is one of the six cognition processes. when attention is applied to a design, the goal is to make it easier for the end user to quickly locate where he / she should type information on the computer or mobile device screen. compare and contrast how the google search engine and the microsoft bing search engine employ the attention cognition process. provide your opinion as to which search engine better employs the attention cognition process and explain why.
Answers: 3
question
Computers and Technology, 25.06.2019 05:10
Write a program that asks for 'name' from the user and then asks for a number and stores the two in a dictionary (called 'the_dict') as key-value pair. the program then asks if the user wants to enter more data (more data (y/n)? ) and depending on user choice, either asks for another name-number pair or exits and stores the dictionary key, values in a list of tuples and prints the list. note: ignore the case where the name is already in the dictionary. example: name: pranshu number: 517-244-2426 more data (y/n)? y name: rich number: 517-842-5425 more data (y/n)? y name: alireza number: 517-432-5224 more data (y/n)? n [('alireza', '517-432-5224'), ('pranshu', '517-244-2426'), ('rich', '517-842-5425')]
Answers: 3
question
Computers and Technology, 25.06.2019 17:20
Athird of the sum of a number and ten is thirty
Answers: 1
You know the right answer?
Consider the method total below.
public static int total (int result, int a, int b)
{
Questions
question
Chemistry, 20.01.2021 09:00
question
Arts, 20.01.2021 09:00
Questions on the website: 13722363