public class Julpyssel{
final int MIN = 0;
final int MAX = 1;
//deklarerar en int-array som kommer att innehålla antal timmar sömn per natt.
int[] sleepPerNight = new int[30];
int[] gamingPerWeek = new int[30];
int[] studyPerWeek = new int[30];
public void main(String[] args){
Julpyssel stats = new Julpyssel();
stats.fillArrays();
stats.userInterface();
double[] average = new double [30];
System.out.println("The group sleeps on average"+ average +" hours/night.");
int maxHours = linearSearch(gamingPerWeek, MAX);
System.out.println("The most devoted gamer played "+maxHours+" hours/day.");
userInterface();
int median = stats.getMedian(gamingPerWeek);
System.out.println("The median or gaming per week is "+median+".");
double variance = stats.getVariance(studyPerWeek);
System.out.println("The variance is "+variance+".");
}
public void userInterface(){
Julpyssel stats = new Julpyssel();
boolean running = true;
while (running == true){
double average = stats.getAverage(sleepPerNight);
fillArrays();
}//while
}//userInterface
//ska fylla arrayerna
public static void fillArrays(){
sleepPerNight[4] = 5;
sleepPerNight[5] = 7;
gamingPerWeek[10] = 1;
gamingPerWeek[11] = 21;
studyPerWeek[0] = 6;
studyPerWeek[1] = 1;
}//fillArrays
public int linearSearch(int[] input, int minMax){
return 0;
}
//Den ska returnera det värde som finns i mitten av listan.
public static int getMedian(int[] input){
return 0;
} //Julpyssel
double getVariance(int[] azad){
return 0;
}
}
--- Update ---
I get the error, "cannot find symbol" in "double average = stats.getAverge"
symbol: method getAverage(int[])
location: variable stats of type Julpyssel