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
In statistics the mode of a set of values is the value that occurs most often. Write a program that determines how many pieces o
Feliz [49]

Answer:

  see below

Explanation:

The program of interest is the function "findMode[x, n]" in the attached. It is written the Wolfram Language of Mathematica.

The basic idea is that the data in the array is sorted. The sorted array is partitioned into sets of identical elements, and the number in each of those sets is counted. The maximum of those counts is the mode. The location of the maximum count corresponds to the location of the set having that count. We use that location information to pull out the mode value(s).

If there is more than one mode, all are reported.

__

An example data array is provided, along with the program output.

6 0
3 years ago
Send the memes whoever is the best will get that crown thing lol
shutvik [7]
I have to type 20 characters here so...

4 0
3 years ago
Read 2 more answers
Managers can use __ software to discuss financial performance with the help of slides and charts
Natali5045456 [20]

Answer:

presentation

Explanation:

Software like Google Slides and Microsoft Powerpoint can be utilized to present financial performances through the use of slides and charts.

6 0
3 years ago
I've been stuck on these two basic javascript assignments for an embarrassingly long time. The teacher refuses to help me and th
user100 [1]

Answer:

it is 29 0ver 30

Explanation:

i took the quiz

5 0
3 years ago
Whate are some creatures/animals that the robot rex imitates?
Rzqust [24]

<span>The Rex robot imitates the dinosaur perfectly. In terms of its structure, the robot looks like a dinosaur, and this is seen in the robot’s serrated teeth. To some extent, the robot imitates the cheetah due to its speed ability.</span>

3 0
3 years ago
Other questions:
  • This question involves the implementation of the PasswordGenerator class, which generates strings containing initial passwords f
    5·1 answer
  • What is a bus master?
    14·1 answer
  • Which option is referred to by the Animals tag?
    5·1 answer
  • According to Holpp and Kelly's approaches to developing vision, the benchmarking approach is more internally focused, whereas th
    6·1 answer
  • PLEASE HELP I WILL GIVE YOU BRAINLILY
    15·2 answers
  • Which type of film would typically require the least amount of input from a screenwriter?
    10·1 answer
  • Where is the best place to self learn c++ or c# that is free?
    6·2 answers
  • You can fit more RAW files on a memory card than JPEG files. true or false
    10·1 answer
  • What are TWO examples of soft skills?
    11·1 answer
  • You have implemented an access control method that only allows users who are managers to access specific data. Which type of acc
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!