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]
3 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]3 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
When you use the keyboard to scroll to a different position in the document, the ____ automatically moves when you press the des
FrozenT [24]

Answer:

Option C i.e., insertion point is the correct option.

Explanation:

if any user or person scrolls the following contents by using the keyboard from one position to another position in the document of the user then, the insertion point moves automatically without any implementation when the user presses any key they want. If the user clicks on the arrow keys then, it also works like that. So, that's why the following option is correct.

8 0
3 years ago
The most commonly used traffic control devices used in road construction and maintenance work areas are
svet-max [94.6K]
The answer that best completes the statement above is this: <span>signs, barricades, drums, cones, tubes, flashing arrow panels, and flag individuals. The main purpose of these traffic control devices is to signal the drivers to stop or to slow down and to change lanes most especially in areas that are undergoing construction.</span>
3 0
3 years ago
Given a list of twenty number count the numbers among the list
Finger [1]

Answer:

Thank you for the points<33

7 0
2 years ago
Why does my internet keep disconnecting and reconnecting.
3241004551 [841]

Answer:

Hmm maybe because its failing?

Explanation:

i actually dont know but it happens to me sometimes

6 0
2 years ago
Fill in the blank question. Suppose U.S. nominal GDP was $14.9 trillion in 2011 and $15.6 trillion in 2012. The growth rate of n
Juliette [100K]

The growth rate of nominal GDP in the U.S between 2011 to 2012 is 4.7%

<h3>Equation</h3>

An equation is an expression that shows the relationship between two or more variables and numbers.

From the question:

Growth rate = [(15.6 trillion - 14.9 trillion) / (14.9 trillion)] * 100% = 4.7%

The growth rate of nominal GDP in the U.S between 2011 to 2012 is 4.7%

Find out more on Equation at: brainly.com/question/2972832

7 0
2 years ago
Other questions:
  • Write a loop that sets newScores to oldScores shifted once left, with element 0 copied to the end. Ex: If oldScores = {10, 20, 3
    15·1 answer
  • Ben chang noticed that his store was lagging in sales . He realized that his staff was not experienced enough . As the store man
    13·2 answers
  • Which of the following is NOT true of input validation?
    7·1 answer
  • What does the hexadecimal number 2D represent in the binary system?
    9·1 answer
  • What is the purpose of a destructor? (g) What is the purpose of an accessor?
    7·1 answer
  • 4. Write an interactive program CountOddDigits that accepts an integer as its inputs and prints the number of even-valued digits
    10·1 answer
  • PLS HELP IMEDIATELY!!!!!
    15·2 answers
  • What happens when a user clicks Accept on a meeting request?
    9·2 answers
  • Which term describes the surrounding area of this image?
    10·1 answer
  • A constructor must have a return statement.<br><br> True<br><br> False
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!