Question: Write a program that reads three integers and prints their average. With inputs 3 4 5 your output should look like: Enter three integers: 3

Write a program that reads three integers and prints their average. With inputs 3 4 5 your output should look like: Enter three integers: 3 4 5 The average of 3, 4 and 5 is 4

This is what I am given.

import java.util.Scanner; public class AverageOfThree {

//************************************************************** // Read three integers and output their average //************************************************************** public static void main(String[] args) { int num1, num2, num3; double average; Scanner scan = new Scanner (System.in); // input three integers // Compute the average of the numbers // Display the numbers and their respective average } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!