EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
8th Edition
ISBN: 9781305480537
Author: FARRELL
Publisher: CENGAGE LEARNING - CONSIGNMENT
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 stores nine integers in an array. Display the integers from first tolast, and then display the integers from last to first.
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)
In java, please read the text file as array. Then, replace the null with 0 and calculate the sum of the new students in ABC University.Example of text file: (university,year,total_students,new_students,new_staff,ABC, 2000, 3457, , ,ABC, 2001, 3675,218, ,EFG, 2000, 2389,602, ,EFG, 2001, 2785,396, 65,)
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