## Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

### Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today. # Why does the user's score on this quiz always end up at 0?

Regardless of whether or not I put in the correct answer, I always end up with a score of 0 and no crown.

```var score = 0;

var answer1 = prompt("What is 1 + 1?");
var answer2 = prompt("What is 3 + 6?");
var answer3 = prompt("What is 2 + 2?");
var answer4 = prompt("What is 10 + 10?");
var answer5 = prompt("What is 5 + 9?");

score += 1;
}
score += 1;
}
score += 1;
}
score += 1;
}
score += 1;
}

document.write("<p>Out of 5 questions, you got <strong>" + score + "</strong> correct.</p>")

if(score === 5){
document.write("<p>Congratulations! You get the gold crown.</p>");
} else if (score === 4 || score === 3){
document.write("<p>Nice. You get the silver crown.</p>");
} else if (score === 2 || score === 1){
document.write("<p>Okay. You got the bronze crown.</p>");
} else {
document.write("<p>No crown for you!</p>");
}
``` And, of course, I managed to figure it out as soon as I posted this question! That's how it works, I suppose.

This is the code I should have been using to determine the score:

```if(parseInt(answer1) === 2){
score += 1;
}
score += 1;
}