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]
2 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]2 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
Your friend Amy calls you asking for help with her new LCD monitor. She says the monitor isn't showing the whole picture. What i
swat32

Answer:     probably 1080p (which is HD)

Explanation:    Lcd monitors mainly support 1080p.

3 0
2 years ago
Develop a script to demonstrate an understanding of the overload (overwrite) methods of using Python operators. This lesson will
MrRa [10]

hsjshekejeoehejeoejebenwkwuwbnwlwjdvrbrnfnfjkddjddmdmdndnfndmdkdjdjdjdjjdjdjdjdkdkdkdkdfkkdjdjdjdyremssjyehsmmamaajbshsjsbdbsksidhdbdbddddddddododododkdkdkdjdjdhddhhdvxbxbbxbxbxjdiegebeodhe

8 0
2 years ago
Is Flip book drawings, frame by frame (need great drawing skills).
lyudmila [28]
I would say traditional animation
7 0
3 years ago
Which folder(s) are commonly used in the Navigation Pane of Outlook? Check all that apply.
tensa zangetsu [6.8K]

The Navigation Pane in Outlook is used to switch between the different areas of Outlook,such as Mail, Calendar, Contacts, Tasks, and Notes., the Navigation Pane displays the folders within the view you are working with. The following folders are commonly used in the Navigation Pane in Outlook:

Inbox

Sent Items

Deleted Items

They are most commonly included in the Favorites.

6 0
3 years ago
A photograph is taken by letting light fall on a light-sensitive medium, which then records the image onto that medium.
Andru [333]
True. At least that's how it is for camera's that print photos. Not digital cameras
4 0
3 years ago
Read 2 more answers
Other questions:
  • Which online text source would include a review of a new TV show?
    9·2 answers
  • Which of the following statements is true?
    6·1 answer
  • Print "Censored" if userInput contains the word "darn", else print userInput. End with newline. Ex: If userInput is "That darn c
    5·1 answer
  • A relational database is different from a simple database because it has more than one _____.
    13·1 answer
  • A prime number is an integer greater than 1 that is evenly divisible by only 1 and itself. For example, the number 5 is prime be
    11·1 answer
  • Which type of password would be considered secure
    5·2 answers
  • Pig Latin is ______ and fits very naturally in the pipeline paradigm while SQL is instead declarative.
    7·1 answer
  • How is a UDP socket fully identified? What about a TCP socket? What is the difference between the full identification of both so
    9·1 answer
  • Select the correct answer..
    6·1 answer
  • What are 2 ways to send a message to your client when signed in as an accountant user?.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!