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
What would a world where we have 2^128 (340 undecillion) Internet connected devices look like? How could that much Internet usag
cluponka [151]

A world  have 2^128 (340 undecillion) of IPv addresses that helps to connect to the internet. IPv6 addresses can make it easier for working organizational teams connecting to the Internet, IP addresses that are created by IPv6 are 128 bits.

<h3>What is internet?</h3>

Internet is the system  uses the Internet protocol suite (TCP/IP)  and interconnected computer networks that communicate between two or more individuals.

Today, almost 20 IP addresses are taken by7 each home for each electronic device. The internet usage is so wide, that even a simple task  is not possible without it. Even a simple task can be done using internet.

Learn more about internet.

brainly.com/question/13308791

#SPJ1

5 0
2 years ago
Fitbit is an example of....
strojnjashka [21]

Answer:

a monitor of ur heartbeat sleep breathing

Explanation:

3 0
4 years ago
Read 2 more answers
The part of the computer that provides access to the internet is the-?
Rina8888 [55]
The answer is D. Modem
7 0
3 years ago
Read 2 more answers
Shortest Remaining Time First is the best preemptive scheduling algorithm that can be implemented in an Operating System.
Ierofanga [76]

Answer:

a

Explanation:

Yes, true.

Shortest Remaining Time First, also popularly referred to by the acronym SRTF, is a type of scheduling algorithm, used in operating systems. Other times it's not called by its name nor its acronym, it is called the preemptive version of SJF scheduling algorithm. The SJF scheduling algorithm is another type of scheduling algorithm.

The Shortest Remaining Time First has been touted by many to be faster than the SJF

7 0
3 years ago
Emerson needs to tell his browser how to display a web page. Which tool will he use? HTML Web viewer Operating system Translator
Aleks04 [339]
HTML Web viewer is the only one that could that
6 0
3 years ago
Other questions:
  • It's inventiveness, uncertainty futuristic ideas typically deal with science and technology.what is it?
    14·1 answer
  • What is achieved through xylography
    7·2 answers
  • Where is line-of-sight Internet common?<br> In space<br> Outdoors<br> Inside<br> In businesses
    10·1 answer
  • How can templates be made available to other users?
    15·1 answer
  • What is the name of the device that senses the current flowing, tripping the circuit, and cutting off the electricity?
    13·1 answer
  • Unicode is a world standard to represent _________________
    10·1 answer
  • You can use colors, patterns, and borders to enhance the overall appearance of a worksheet and to make it easier to read. One of
    11·1 answer
  • Word processing software, spreadsheet software, database software, and presentation software are examples of what category of co
    13·1 answer
  • The =COUNT function calculates what value?
    15·2 answers
  • By itself, the human eye cannot see anything in three dimensions. What does the passage say enables us to see the world in 3-D?
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!