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
Gnoma [55]
2 years ago
11

Write code to define a function named mymath. The function has three arguments in the following order: Boolean, Integer, and Int

eger. It returns an Integer. The function will return a value as follows: 1. If the Boolean variable is True, the function returns the sum of the two integers. 2. If the Boolean is False, then the function returns the value of the first integer - the value of the second Integer.
Computers and Technology
1 answer:
saveliy_v [14]2 years ago
7 0

Answer:

public class Main

{

public static void main(String[] args) {

Main m=new Main();

System.out.println(m.mymath(true,5,2)); // calling the function mymath

}

public int mymath(boolean a,int b,int c) // mymath function definition

{

if(a==true)

{

int d=b+c;

return d;

}

else{int e=b-c;

return e;

}

}

}

You might be interested in
One way to prepare for filing the PROFILE is to:
kozerog [31]
I think I am not sure that it is probably b
8 0
3 years ago
Read 2 more answers
The rules on the Internet for how messages are addressed and passed on are called ____ .
olganol [36]
Answer: Internet Protocal (IP)
7 0
3 years ago
When working in excel online, which of the following is considered a conditional formula?
Alika [10]
B. Because conditional statements have an IF before stating the condition
8 0
3 years ago
Read 2 more answers
What is a distinguishing feature of 5G mm Wave?
RoseWind [281]

Answer: 5G high bands (mmWave, also referred to as FR2) are found in the range of 24GHz to 40GHz. They deliver large quantities of spectrum and capacity over the shortest distances

4 0
2 years ago
_______ imaging technology defines locations in the brain where neurons are especially active using safe radioactive isotopes to
Radda [10]

Answer:

Positron Emission Tomography (PET)

Explanation:

4 0
3 years ago
Read 2 more answers
Other questions:
  • A year in the modern Gregorian Calendar consists of 365 days. In reality, the earth takes longer to rotate around the sun. To ac
    11·2 answers
  • It is generally safe to provide your social security number to
    7·2 answers
  • What authentication protocol is ticket-based and is used by windows computers that are members of an active directory domain?
    13·1 answer
  • What document type would be best to communicate sales items from a business to potential customer?
    12·1 answer
  • Malware that corrupts the target operating system in such a manner that a network defender can no longer trust the native OS is
    15·1 answer
  • When performing actions between your computer and one that is infected with a virus, which of the following offers NO risk of yo
    11·2 answers
  • What is trouble shoot​
    11·1 answer
  • Write a program to read from std_info.txt.
    11·1 answer
  • Technology has had
    10·1 answer
  • Think of some local businesses that have websites. Look online and identify two different websites for businesses or services in
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!