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
Explain the importance of signaling in the telephone network.
k0ka [10]

Answer: Please see below as the answer is self-explanatory

Explanation:

In a telephone system, we call signaling to all signals that are originated within a telephony circuit, that are not part of the conversation between the calling parties.

We include in this broad category, the signal generated by the calling party when he picks up the phone, the call tone sent to him by the switch (or the busy tone if the call can't be established due to blocking), the digits that identify the called party, the ringing signal that informs the called party that someone is trying to reach him for a call, among others like are defined in the SS7 or the different 2G/3G/4G Cellular standards.

The importance of the signalling is pretty obvious; without these signals, it will be virtually impossible to set up a connection between the two parties.

8 0
4 years ago
A company that provides finance services wants to shift to a mobile platform. What is the major advantage that the users of the
juin [17]
I think it is b but double check
6 0
3 years ago
Read 2 more answers
When you catch an Exception object, you can call ____ to display a list of methods in the call stack so you can determine the lo
KonstantinChe [14]

Answer:

printStackTrace()

Explanation:

printStackTrace() :- This method is present in Java.lang.Throwable class and it prints this Throwable it also prints other details with throwable like backtrace and class name. printStackTrace() prints a stack trace for this Throwable object on the output stream of standard error. So we conclude that the answer is printStackTrace().

3 0
4 years ago
Which will be displayed after the following process is completed?
Sergeu [11.5K]

Answer:

True

Explanation:

In this pseudocode the programmer defines 3 variables, x=1, y=2 and z=3, then he creates a conditional that states that if any of the previously defined variables has the value of 1 then a True will be displayed, on the other hand, if none of the variables has the value of 1 then a False will be displayed. In this case x=1, so it will display a True.

8 0
3 years ago
Q. 2. What will be the output of the following code?<br> //printf("Hello\n");<br> printf("Girls");
loris [4]

Answer:

Just two outputs \n a line break so:

Hello

Girls

4 0
3 years ago
Other questions:
  • What attributes a website indicates a more reliable source for information
    14·1 answer
  • Why is it critical to provide proper treatment for minor and moderate sports injuries within the first 48 hours after sustaining
    14·1 answer
  • In a digital drawing program, when an object is highlighted, boxes appear at the sides and corners. These boxes can be grabbed a
    13·1 answer
  • List five ways in which the type declaration system of a language such as Java or C differs from the data definition language us
    8·1 answer
  • Which line of code will print Python is cool! on the screen?
    9·2 answers
  • The loop body instructions in the _____ statement always are processed at least once.
    6·1 answer
  • Proofreaders' marks are:
    6·1 answer
  • How do productivity programs most benefit the way we work and live?
    12·2 answers
  • Can someone help me to write a python code to save list form python to CSV file please?​
    12·1 answer
  • Which of the following would be the most appropriate way to define a method that calculates and returns the final price, after t
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!