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
List the step in turning on a computer
kondaur [170]
On the CPU first and then then the power button if there is password access then u have to type the password
this Much only
hope it helps :)
7 0
3 years ago
Which of the following is the process of writing the step-by-step instructions that can be understood by a computer?
Aleks04 [339]

Answer:

computer programming

Explanation:

says the answer in the question

5 0
3 years ago
What do flowcharts communicate to programmers ?
ziro4ka [17]

Answer:

how data will flow through the program

Explanation:

says the answer in the question

6 0
3 years ago
•What are some conflicts between humans and machines that have arisen in the past?
slamgirl [31]
I think that people have lost their jobs because of an increase of computers. Also, a<span>utomobiles can crash and injure and kill people. </span><span>Ships can be sunk. </span><span>Poorly constructed or maintained machinery can harm the workers. </span><span>The telegraph put the pony express out of business. </span><span>Many factories pollute the water and air. </span>
7 0
3 years ago
What is the formula for determining the number of possible hosts on a network?
fredd [130]
2**(32 - netmask) - 2 = number of nodes available

The netmask is in CIDR (Common Internet Domain Routing) notation, without the slash.

One of the nodes would be needed for a router or else you can't communicate with other networks.
3 0
3 years ago
Other questions:
  • Which of the following is a Microsoft solution that runs on a Microsoft Terminal Services server but appears, to end users, as i
    10·1 answer
  • What important information is added to the TCP/IP transport layer header to ensure communication and connectivity with a remote
    13·1 answer
  • Book checkout scenario at a library: The Worker tells the System the identity of a patron who wishes to check out books. The Sys
    8·1 answer
  • You are configuring IP settings on a new network. For the external interfaces, you decide to obtain registered IP addresses from
    5·1 answer
  • Most smartphones use operating systems developed by ________. Select one: A. Symbian and Apple B. Apple and Microsoft C. Microso
    13·1 answer
  • How are logical operators used?
    14·1 answer
  • When hacking a website to test a secure connection and ensure internet safety, what is a good way to check the coding of the web
    14·1 answer
  • Match the hardware device with the "category" into which it falls. Remember to choose
    8·1 answer
  • It is manadatory to include a banner marking at the top of the page to alert the user that cui is present.
    9·2 answers
  • Write algorithm and flowchart for the following<br>a.find the sum and average of any four numbers ​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!