I am fairly new to programming. . .
I am getting an error with the following code :
public class Main {
public static void main(String[] args) {
int highScore = calculateScore(true, 800, 5, 100);
System.out.println("Your final score was " + highScore);
highScore = calculateScore(true, 10000, 8, 200);
System.out.println("Your final score was " + highScore);
displayHighScore(Jack, 3);
}
public static int calculateScore(boolean gameOver, int score, int levelCompleted, int bonus) {
if (gameOver) {
int finalScore = score + (levelCompleted * bonus);
finalScore += 2000;
return finalScore;
}
return -1;
}
public static void displayHighScore(String playersName, int position){
System.out.println(playersName + " managed to get to position " + position);
} }