Question: Write a program that takes in an input of four doubles and outputs an average of those four numbers rounded to the nearest whole number.

Write a program that takes in an input of four doubles and outputs an average of those four numbers rounded to the nearest whole number. Ex) Input: 5.0 6.0 7.0 8.0 Output: 7.0 287956.1731522 LAB ACTIVITY 13.5.1: Averages and Rounding 0/4 LabProgram.java Load default template... 1 import java.util.Scanner; public class LabProgram { public static void main(String[] args) { double average; // get the four numbers from user Scanner scnr = new Scanner(System.in); double num1 = scnr.nextDouble(); double num2 - scnr.nextDouble; double num3 = scnr.nextDouble; double num4 = scr.nextDouble(); 10 11 12 12 13 14 15 16 17 18 // your code goes here // print the results. System.out.print(average)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
