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
diamong [38]
2 years ago
10

Write a method maxMagnitude() with two integer input parameters that returns the largest magnitude value. Use the method in a pr

ogram that takes two integer inputs, and outputs the largest magnitude value.
Computers and Technology
1 answer:
antoniya [11.8K]2 years ago
7 0

Answer:

   public static int maxMagnitude(int a, int b){

       int max;

       if (a>b){

           max = a;

       }

       else{

           max = b;

       }

       return max;

   }

The complete program calling the method is given in the explanation section

Explanation:

import java.util.Scanner;

public class ANot {

   public static void main(String[] args) {

     Scanner in = new Scanner(System.in);

       System.out.println("Please Enter two numbers");

       int num1= in.nextInt();

       int num2 = in.nextInt();

       System.out.println("The largest magnitude number is: "+maxMagnitude(num1,num2));

   }

   public static int maxMagnitude(int a, int b){

       int max;

       if (a>b){

           max = a;

       }

       else{

           max = b;

       }

       return max;

   }

}

The maxMagnitude() method uses if/else statement to compare two ints and return the larger one

You might be interested in
What is Service Operations in ITIL​
Nostrana [21]

Explanation:

the objective of ITIL service operations is to make sure that IT services are delivered effectively and efficiently. the service operation life cycle stage includes the fulfilling of user requests, resolving service failure fixing problems and also carrying out routine operational tasks

7 0
3 years ago
Types of network model​
dexar [7]

Answer:

OSI Model and TCP/IP Model

Explanation:

4 0
2 years ago
It is a function that removes an existing file from the server.
kondaur [170]

Answer: A) remove()

Explanation:

 The remove() function removes an existing file from the server but it does not affect the existing directory and file. We can also ease and remove files in the file handling by using the remove() function. And it is built-in function that removes any type of the data from the function by taking values in the parameter whose values are equal with the passing value in the parameter.

7 0
3 years ago
Hello,
tekilochka [14]
I think you should get used input
5 0
3 years ago
Write three guidelines to help you keep track of your behavior as you use different apps with
Gala2k [10]

Answer:

A basic guideline plan to help me track my behavior consist of the following:

How much time do I use each element?

Have I experienced anxiety after using them?

Have I experienced anxiety while using them?

Have I changed my day to day routine by using them?

Explanation:

The reasons to back my answer are the following. First of all, dependency can be measured in time spent and anxiety developed after the use of the element. Thus, we need to explore if the source of media has originated anxiety while using it or after using t to spot if we are suffering an addictive pattern. Also, generally addictive elements create anxiety while using it and it increases after stop using them. Therefore, if we find that we have experienced both types of anxiety we are in an addictive cycle.

4 0
3 years ago
Other questions:
  • Knowledge flows from the information that has been generated. Which of the following does not necessarily flow from information
    15·1 answer
  • The opening of the throttle plate can be delayed as long as
    13·1 answer
  • The it department is reporting that a company web server is receiving an abnormally high number of web page requests from differ
    13·1 answer
  • Pictures that you can click on to tell your computer what to do.
    12·2 answers
  • Let's go! About to hit 40k!!! Glad to help on Brainly®!!!
    11·1 answer
  • Attackers need a certain amount of information before launching their attack. One common place to find information is to go thro
    11·1 answer
  • (asking again because point-hogs exist)
    11·1 answer
  • Refund please, this has not helped at all.
    6·2 answers
  • A computer on a network that is not the server​
    15·1 answer
  • A DSS8440 server is equipped with one power supply that is failing and requires replacement. What is the correct sequence of ste
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!