Using arrays and methods do the following problem:? Update : recursive equation for an arithmetic sequence a(n)=a(n-1)+d given the following data 3,7,11,15,19, A) determine the data for a1 to a30 and display in array form B) multiply the values by pi and display in an array form. here what i have but keep getting error import java.util.*; public class RecursiveEquationSequence{ public static void main(String[] args) { int intArray = new int[]; // define other variabes int d=4; // incerement // initaize the firt array by storing first value intArray[0]=3; // start a loop to store values in array for ( int i=1; i<=30; i++) { intArray[i]=intArray[i-1]+d; } // Print the Array values for ( int i=0; i<=30; i++) { System.out.println("Sequence "+i+" Array VAlue "+intArray[i]); } // print the array value by multiplying with PI. for ( int i=0; i<=30; i++) { System.out.println("Sequence "+i+" Array VAlue multiplied by PI "+intArray[i]*Math.PI); } // Extra work // Change Array value by multiplying with PI for ( int i=0; i<=30; i++) { intArray[i]=intArray[i]*Math.PI; } // Prinit the changed value for ( int i=0; i<=30; i++) { System.out.println("Sequence "+i+" Array VAlue "+intArray[i]); } } }
What did you try so far? Where did you have trouble?
Did you start the problem?
Join our real-time social learning platform and learn together with your friends!