JAVA PROGRAM(LL)+MINDTAP (1 TERM) V2.0
JAVA PROGRAM(LL)+MINDTAP (1 TERM) V2.0
9th Edition
ISBN: 9780357616673
Author: FARRELL
Publisher: CENGAGE L
Expert Solution & Answer
Book Icon
Chapter 8, Problem 1PE

Explanation of Solution

Program:

File name: “NineInts.java

//Import necessary header files

import java.util.Scanner;

//Define a class named NineInts

public class NineInts

{

    //Define main method

    public static void main(String[] args)

    {

        //Create an object for Scanner class

        Scanner sc= new Scanner(System.in);

        //Declare an array of integers

        int[] num = new int[9];

        //Prompt the user to enter nine integers

        System.out.print("Enter nine integers: ");

        for(int i=0;i<9;i++)

        {

    num[i]=sc.nextInt();

        }

        //Print the numbers from first to last

        System...

Blurred answer
Students have asked these similar questions
Write an application that prompts the user to enter nine integers and then store those nine integers in an array. Display the integers from first to last, and then display the integers from last to first. You do not have to sort them, just display the order entered and the reverse order entered. (In JAVA)
Java:
Can you write it in Java, add comments    Create an application containing an array that stores eight integers. Prompt the user to enter the 8 integers. The application should call five methods that in turn (1) display all the integers, (2) display all the integers in reverse order, (3) display the sum of the integers, (4) display all values less than the calculated average value, and (5) display all values that are higher than the calculated average value. Save the file as ArrayMethodDemo
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage