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
vovikov84 [41]
3 years ago
9

Write a main program that prompts users for 5 integers. Use two separate functions to return (NOT print) the highest and lowest

value of the 5 integers. From main, display all five numbers entered and the results.
Computers and Technology
1 answer:
Soloha48 [4]3 years ago
6 0

Answer:

import java.util.Arrays;

import java.util.Scanner;

public class LatinHire {

   public static void main(String[] args) {

       Scanner in = new Scanner (System.in);

       System.out.println("Enter Five integers");

       int num1 = in.nextInt();

       int num2 = in.nextInt();

       int num3 = in.nextInt();

       int num4 = in.nextInt();

       int num5 = in.nextInt();

       int [] intArray = {num1,num2,num3,num4,num5};

       System.out.println(Arrays.toString(intArray));

       System.out.println("The Maximum is "+returnMax(intArray));

       System.out.println("The Minimum is "+returnMin(intArray));

   }

   public static int returnMax(int []array){

       int max = array[0];

       for(int i=0; i<array.length; i++){

           if(max<array[i]){

               max= array[i];

           }

       }

       return max;

   }

   public static int returnMin(int []array){

       int min = array[0];

       for(int i=0; i<array.length; i++){

           if(min>array[i]){

               min= array[i];

           }

       }

       return min;

   }

}

Explanation:

  1. This is implemented in Java Programming Language
  2. Two Methods are created returnMax(Returns the Maximum Value of the five numbers) and returnMin(Returns the minimum of the five numbers)
  3. In the Main method, the user is prompted to enter five numbers
  4. The five numbers are saved into an array of integers
  5. The returnMax and returnMin methods are called and passed the array as parameter.
  6. The entire array of numbers inputted by the user as well the Max and Min are printed

You might be interested in
If an interest inventory reveals that you are highly interested in solitary, introverted work, what might be the best type of ca
Deffense [45]
A writer maybe, because you can work by yourself, even at home.
6 0
3 years ago
Read 2 more answers
How do you do this question?
elena55 [62]

Answer:

for (scores.Entry<String, Integer> entry : scores.entrySet()) {

          int value=0; String key="Rambo";

          String k = entry.getKey();

           int v = entry.getValue();

           if (v>value)

           {

               value =v;

           }

           else

           {

               value=value;

           }  

       }

       for( scores.Entry<String, Integer> entry : scores.entrySet())

      {

        if( entry.getValue()==value)            

        System.out.println("Key = " + entry.getKey() + ", Value = " + entry.getValue());

      }

Explanation:

The above scores are an object of Map type.  And this is a parameter of findUopStudent function. So scores is a Map, and entry is an item. And we get its key and value. Now we compare each value using senteniel method and find the maximum value. Now we iterate through the scores using for the look and check the value of each entry against the maximum value found, and we print out the entry with maximum value. And that is the top student, which is required.  

4 0
3 years ago
Full from of tmc computer
Butoxors [25]

Answer:

Traffic Message Channel,

7 0
3 years ago
Read 2 more answers
What is analog computer? where is it used​
hichkok12 [17]

Explanation:

analogue computer is in computer which is used to process analogue data.

Analogue computer were widely used in scientific and industrial application

3 0
3 years ago
Read 2 more answers
0.0% complete question a forensics analyst is attempting a live acquisition of the contents of the memory of a running linux dev
Sonja [21]

Based on the question, the  Recommendation of  a framework that will enable the analyst to install a kernel driver is said to be Volatility.

<h3>What is the Volatility framework?</h3>

Volatility is said to be a kind of an open source framework that is known to be used in times of memory forensics as well as digital investigations.

Note that The framework is one that tends to inspects and take out the memory artifacts that pertains to 32-bit and 64-bit systems. The framework has aided for all kinds of Linux, Windows, and others.

Hence, Based on the question, the  Recommendation of  a framework that will enable the analyst to install a kernel driver is said to be Volatility.

Learn more about Volatility from

brainly.com/question/27993482

#SPJ1

8 0
2 years ago
Other questions:
  • Text, numbers,graphics, sounds entered into a computer's memory during input operations are referred to as
    11·1 answer
  • Casting is one of the oldest known manufacturing processes. <br> True or false
    6·2 answers
  • Which of the following is the main consideration when choosing an appropriate outlet box?
    7·2 answers
  • What steps might a company or organization need take in order to keep its digital data secure online?
    8·1 answer
  • The IP protocol (and UDP) are called "connectionless" and "unreliable." Describe what those two words mean in the context of dat
    8·1 answer
  • What is the difference between a switch and a hub?
    8·1 answer
  • When creating a shape in Word, what are some available options? Check all that apply. adding text to the shape changing the size
    6·1 answer
  • PLS HURRY<br> Look at the image below
    8·1 answer
  • How would you write this using Java: Use a TextField's setText method to set value 0 or 1 as a string?
    5·1 answer
  • Array bounds checking should be directly coded into a system rather than assumed.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!