I am struggling to properly output the elements of an array in java. I know I should use a for loop to print out the array, but I am not sure exactly where to start in order to make sure all the values are printed after the function call in main. Any advice would be appreciated. Thank you!
/*
1 creator shares with 3 friends
1 minute = 3 shares/ friend
what does it look like after 10 mins
*/
public int[] shares(int minutes, int people){
int[] array = new int [20];
for(int i = 1; i <= minutes; i++){
people += Math.pow(3, people);
array[i] = people;
}
return array;
}
public static void main(String args[]){
Prc test = new Prc();
System.out.println(test.shares(10, 1));
}