I created a program, so a kid can practice there math on it. It dispenses varies math problems and the kid must input an answer. I also want it to grade the work they have done, but I can't find the best place for it to print out the grade.
I have:
if ( $response =~ m/^[q]/ ) {
$user_wants_to_quit = 1;
} else {
if ( $response == $solution ){
print "Correct!\n";
$correct = $correct + 1
} else {
print "Incorrect: $question $solution \n";
$incorrect = $incorrect + 1
}
}
}
I want to insert
print "You got $correct answers and $incorrect answers"
but I do not know how to insert it into what I already have