I am making a program that can take judge scores and give an average and one of my variables I think I did wrong. I get the error message:
non-static variable difficulty cannot be referenced from a static context
difficulty = keyboard.nextDouble;
I have tried moving it above the main method as well as also adding "static" to it but it still seems to give me problems. Is there something else that I can do? Here is part of the code for it
import java.util.Scanner;
public class CH6PA
{
private double difficulty;
private int score;
private double[] average;
public static void main(String[]args)
{
Scanner keyboard = new Scanner (System.in);
do
{
System.out.println("Enter the level of difficulty (1.2-3.8)");
difficulty = keyboard.nextDouble;
}
while (difficulty>1.2 || difficulty<3.8);
int judge = new int[7];
for(int i = 0; i<judge.length; i++)
{