Quote:
i dont know how to calculate the percentage of the correct answer
You need to learn percentages and fractions. Both are elementary school mathemarics.
The bad news is that while programming, you will have to deal continuously with such things or similar ones.
https://en.wikipedia.org/wiki/Percentage[
^]
https://en.wikipedia.org/wiki/Fraction_%28mathematics%29[
^]
[Update]
Quote:
i dont know how to add function to count the total number of correct answer from the answered question.
I fear you already have it with variable
correctAnswers
.
Advice: you should study the code you found on internet before asking for help.