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
What does Falstaff do to protect himself in battle? ​
notka56 [123]
Bark bark bark bark bark bark bark bark bark bark bark bark bark bark bark bark bark bark bark bark bark bark bark
3 0
3 years ago
Form the recurrence relations (RRs) for the number of vertices and the number of edges of a hypercube of n dimensions, Hn. Solve
Rus_ich [418]
I'll write it below Step-by-step explanation: Q1 a side that has 10 sides and 10 angles is called decagon. Q2 it is nonagon Q3 it is Pentagon Q4it is heptagon
8 0
3 years ago
Which of the following is an advantage of batch processing?
alina1380 [7]

Answer:

it can balance computing resources by time

Explanation:

this this is as it involves multiprogramming

8 0
4 years ago
Which Tab contains the paragraph attributes?
alexgriva [62]

Answer:

b insert

Explanation:

7 0
3 years ago
Question
LuckyWell [14K]

Answer:

you go to the what ever you use for the stuff i thing you want

Explanation:

6 0
3 years ago
Other questions:
  • Can you think of a shortcut for calculating the network addresses of consecutive /30 subnets?
    9·1 answer
  • When you use file explorer or windows explorer to delete a file from the hard drive, where does windows put the file?
    11·1 answer
  • PLEASE HELP ON TECHNOLOGY
    8·1 answer
  • What are the four elements of game design?<br><br> Help Me!!
    9·1 answer
  • How do you answer a question on this app?!? Do you comment on the question? I need a reminder! (I haven't been on this app in a
    12·1 answer
  • . Is it conceivable to design a secure operating system for these computer systems? Give arguments for and against.
    6·1 answer
  • Use MPLAB to write an asemply program to multipy two numbers (11111001) and (11111001). Then save the product in file reisters 0
    8·1 answer
  • Stay at least _____ behind the vehicle ahead of you at all times.
    12·2 answers
  • Which sentence indicates that Jeff is mentioning the visual synopsis in his proposal while planning a media project?
    10·1 answer
  • Joining a computer to active directory involves joining the computer to a workgroup. True or false.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!