I am having problems in getting my program to return an array that contains counters to my main method.
I have four methods: main, countBase, findMost, and computeAvg.
For findMost and computeAvg method I checked to see if my programs were counting the amount of elements in array correctly by just individual return the count variable. They were. But when I put the count variable into array and then tried returning the array or when I messed with the array in the other method and asked to place the position in a number so I return the position as a number value, it only displayed weird junk.
//in main //for findMost, return int value of position; for computeAvg return array with avg amount of count of element in the array int valueMost = findMost(arrayDNA1); //Sends the first array to the findMost method System.out.println("The position returned: " + valueMost); int[] valueAvg = findMost(arrayDNA1); for( int s = 0; s < valueAvg.length; s++) System.out.println(valueAvg); //in findMost, after the count of element that needs to be counted is done int[] valueCount = {countA, countT, countG, countC}; //I look for the position for the largest value which was done correctly return largeIndex; //in computeAvg, for each count double avgA = (double)countA / arrayLength; . . double[] avgSeq = {avgA, avgT, avgG, avgC}; return avgSeq;
Please help I have no idea what I am doing wrong.