Question: 1.29 LAB: Simple statistics Part 1 Given 4 integers, output their product and their average using integer arithmetic. Ex It the input is: 8 10

 1.29 LAB: Simple statistics Part 1 Given 4 integers, output theirproduct and their average using integer arithmetic. Ex It the input is:

1.29 LAB: Simple statistics Part 1 Given 4 integers, output their product and their average using integer arithmetic. Ex It the input is: 8 10 5 4 the output is: 1600 6 Note: Integer division discards the fraction. Hence the average era 10 5 4 is output as 6. not 6.75. Note: The test cases include fourverv large input values whose product results in overow. You do not need to do anything special, but just observe that the output does not represent the correct product [in fact, four positive numbers yield a negative output; wow). Submit the above for grading. Your program will fail the last test cases (which is expected), until you complete part 2 below. Part 2 Also output the product and average using oatingpoint arithmetic. Output each oating-point value with three digits after the decimal point, which can be achieved as follows: System.out.printf("%.3f", yourValue); Hint: Convert the input values from int to double. Ex It the input is 8 it) 54. the output is: 1600 6 1600.000 6.750 Note that fractions aren't discarded. and that overow does not occur for the test case with large values. LAB ACTIVITY 1.29.1: LAB: Simple statistics 0 / 10 LabProgram.java Load default template... import java. util. Scanner; public class LabProgram { public static void main (String args) { Scanner scor = new Scanner (System. in) ; 6 int num1; 7 int num2; 8 int num3; int num4; 10 11 /* Type your code here. */ 12 13 14 Develop mode Submit mode When done developing your program, press the Submit for grading button below. This will submit your program for auto-grading

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 Programming Questions!