5.25 Clone of PRACTICE: Arrays**: Binary to decimal conversion I need help with this lab.
5.26 Clone of PRACTICE: Arrays**: Min, max, average Given 10 input integers, output the minimum, maximum, and average of those integers. If the input is 1111133333, the output is: 1 3 2.0 If the input is 9876543210, the output is: 0 9 4.5 Hints: Use a single for loop and update variables minval, maxval, and sumvals on each iteration. (You could use three loops instead). Initialize variables minval and maxVal each to the first integer, NOT to 0. 0 is wrong because integers could be negative. Then update those values if a smaller or larger integer is seen (respectively). Don't forget to use floating-point division, not integer division, when computing the average (use /10.0, not /10).
3670562576146 x 37
LAB ACTIVITY 5.26.1: Clone of PRACTICE: Arrays**: Min, max, average 0/3 Main.java Load default template.
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scnr = new Scanner(System.in);
int[] userValues = new int[10];
int i;
for (i = 0; i < 10; ++i) {
userValues[i] = scnr.nextInt();
}
/* Type your code here. */
}
Develop mode Submit mode Run your program as often as you'd like before submitting for grading. Below, type any needed input values in the first box, then click Run program and observe the program's output in the second box. Enter program input (optional) If your code requires input values, provide them here. Run program Input (from above) - Main.java (Your program) Output (shown below) Program output displayed here