Question: Please answer me ASPS The following program is supposed to display the average of five command-line integer arguments, but it doesn't display the correct value.

Please answer me ASPSPlease answer me ASPS The following program is supposed to display the

The following program is supposed to display the average of five command-line integer arguments, but it doesn't display the correct value. public static void main (String[] args) { int sum = Integer.parseInt(args[0]); sum += Integer.parseInt(args[1]); sum += Integer.parseInt(args[2]); sum += Integer.parseInt(args (3]); sum += Integer.parseInt(args [4]); double average = sum/5; System.out.println(average); } Answer the following questions: (1) What is the problem with this program? (2) How to fix this code in order for it to display the average of the five command line integer arguments

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!