Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Need Help ON This Java Problem. Here is the code for assignment 32 the code we h

ID: 3843028 • Letter: N

Question

Need Help ON This Java Problem.

Here is the code for assignment 32 the code we have to update for this assigment.

import java.lang.*;
import java.util.*;
public class ArraySample {

   public static void main(String []args){
   double ar[] = new double[10];
   double sum = 0.0;
   double average;
  
       System.out.println("Random numbers");
       for(int i =0;i<10;i++){
  
   ar[i] = Math.random()*100;
   }
   for(int j= 0;j<10;j++){
   sum = sum + ar[j];
   }
   average = sum/10;
   System.out.println("The average of numbers is "+ average);
   }}

Update your program from Assignment 32 o receive full credit programmers must apply coding conventions for code block indentation, comments describing methods/classes, white space between code blocks, and variable/method/class naming conventions. Write a program that uses an array to find the Average of 10 double values. Use Math.random in combination with a recursive method to fill the array with 10 random values. Then use a different recursive method to iterate through the array summing the total for all 10 double values. Create a third method that will return the mean average from the array. Attach Snipping photos of source code and output

Explanation / Answer

import java.lang.*;
import java.util.*;
public class ArraySample {

   public static void main(String []args){
   double sum_var;
   double average;
  
sum= recursiveSumFunction(1,0);
   average = sum/10;
   System.out.println("The average of numbers is "+ average);
   }}

public void recursiveSumFunction(int n,double sum)

{

if((n>0) && (n<=10)

{

sum = sum + Math.random()*100;

n=n+1;

return recursiveSumFunction(n,sum);

}

else

{

return sum;

}

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote