So I want to start and say I am new to Java programming. Here is my problem. I want to create a program that in essence cycles through an array of arrays. The arrays need to be variable lengths.
My first step is I start out with array of scores. Each array is connected to a specific users. These arrays will be of differing lengths depending on the user.
My second step is to group these user arrays into a larger array with the individual arguments being the user arrays from step 1. This array should be variable length, depending on the number of users.
My final step, is to run this larger array through a series of mathematical operations. I knwo how to create the calculations. This is a main method doing the calculations
import java.lang.Math;
public class Advisor_Score {
public static void main(String[] args)
{
double review_sum[]={5,5,5,5,5,5,5,5,5,5};
//Every time a user answers a question, they will be rated. This is the array holds these ratings.
//A given user will have ten advisor scores, one for each category.
double sum = 0;
{
for(int x=0;x<review_sum.length;x++)
//All scores less than 0 or more than 5 are thrown out
{
if (review_sum[x]<0 || review_sum[x]>5)
{
sum+=0;
}
else
sum+=review_sum[x];
}
double raw_advisor=(sum-(3*review_sum.length))/4;
System.out.println(raw_advisor);
double advisor_score_scaled= 2.5*(1-Math.pow(Math.E, -.5*raw_advisor));
double advisor_score = 2.5 + advisor_score_scaled;
System.out.println(advisor_score);
}
}
}
Eventually I want to loop through the larger array, running each argument in the larger array through this set of computations. I am not wedded to arrays, as I have been told that list might work better. I am just unschooled as to how to use lists. Thanks in advance!