Computer science java programming

I need an explanation for this Java question to help me study.

3. The following program reads three integers and prints the average. Fill in the blanks so that it will work correctly.

import java.util.Scanner;

public class Average

{

public static void main(String[] args)

{

int val1, val2, val3;

double average;

Scanner scan = new Scanner(System.in);

val1 = scan.nextInt(); // get three values from user

val2 = scan.nextInt();

val3 = scan.nextInt();

System.out.println(“Please enter three integers and ” +

“I will compute their average”);

average = (val1 + val2 + val3) / 3; //compute the average

System.out.println(“Average is ” + average); //print the average

}

}

Quite Quote

QUICK QUOTE

Approximately 250 words

custom essy

Order an essay from experts and get an A+

Address: 679 Dola Mine Road Raleigh
Email: support@academic-research-pro.com
Website: www.academic-research-pro.com
Toll Free: +1800-672-9816

Disclaimer

All Papers produced are meant for reference purposes only. Academic Research Pro does not give the consent and authority to copy and reproduce the papers.

Terms and Conditions | Privacy Policy 

Banner of payment methods of cheap essay writing service