Statistics are often calculated with varying amounts of input data. Write a program that takes any number of non-negative integers as input, and outputs the max and average. A negative integer ends...


Statistics are often calculated with varying amounts of input data. Write a program that takes any number of non-negative integers as input,<br>and outputs the max and average. A negative integer ends the input and is not included in the statistics. Assume the input contains at least<br>one non-negative integer.<br>Output the average with two digits after the decimal point followed by a newline, which can be achieved as follows:<br>System.out.printf(

Extracted text: Statistics are often calculated with varying amounts of input data. Write a program that takes any number of non-negative integers as input, and outputs the max and average. A negative integer ends the input and is not included in the statistics. Assume the input contains at least one non-negative integer. Output the average with two digits after the decimal point followed by a newline, which can be achieved as follows: System.out.printf("%.2f\n", average); Ex: When the input is: 15 20 0 3 -1 the output is: 20 9.50 365076.2342078.qx3zgy7 LAB 20.15.1: LAB: Varied amount of input data 0/ 10 АCTIVITY LabProgram.java Load default template... 1 import java.util.Scanner; 2 3 public class LabProgram { public static void main(String] args) { /* Type your code here. */ } 5 7 } 8

Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here