okay heres the question
A method called printResult() that takes an integer representing the final score at a computer game, and a boolean indicating whether the player won or not. If the player won, the method should display the line:
Player wins with <score> points. Otherwise it should display the line:
Computer wins with <score> points. where <score> is the value of the integer parameter.
and heres my code ive done so far
String printResult(int score, boolean win) {
if (win = true) {
return "Player wins with" + score + "points.";
}
else {
return "Computer wins with" + score + "points.";
}
}
can you see why this is wrong?
thanks