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
MULTI SELECTION
GaryK [48]

Answer:

A. Click on the Print icon at the top of the screen

Explanation:

8 0
3 years ago
Full from of tmc computer
Butoxors [25]

Answer:

Traffic Message Channel,

7 0
3 years ago
Read 2 more answers
An ipv4 address in the range 169.254.0.1 through 169.254.255.254 indicates a problem with what type of service
DENIUS [597]

Dynamic Host Configuration Protocol, also known as DHCP.

3 0
3 years ago
Which type of network attack uses a fake IP address to send data packets from an unauthorized user to a network?
liq [111]
D. DoS. DoS is a way to potentially lag or even crash different types of servers ranging from as small as a simple website to bigger websites and video games servers.
6 0
3 years ago
Read 2 more answers
The default _____ color is set when you type text.
Elenna [48]
The default hyperlink color is automatically set when you type
5 0
3 years ago
Other questions:
  • Define the acronym WAECUP and its components
    15·1 answer
  • Software that instructs the computer how to run applications and controls the display/keyboard is know as the
    8·1 answer
  • Under what circumstances are composite primary keys appropriate?
    5·1 answer
  • Fill in the blank.
    7·1 answer
  • Which statement describes borders and shading ?
    13·1 answer
  • A variation of pronounce is a. Proclaim c. Produce b. Profound d. Pronunciation Please select the best answer from the choices p
    11·1 answer
  • Who all likes fortnite
    15·2 answers
  • Josephine is in the process of creating ads within her Standard Display campaign. She finds that there are two main ad formats t
    5·1 answer
  • Write a piece of codes that asks the user to enter a month (an integer), a day (another integer), and a two-digit year. The prog
    8·1 answer
  • and assuming main memory is initially unloaded, show the page faulting behavior using the following page replacement policies. h
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!