Formula for percentage?
Hi, this is a mathematical question, but I'm doing it in VB so I thought I'd post it here...
A person is shown a total of 10 numbers. When a number appears on the screen they have to type that number into a text box and if they get it correct another number appears. If they do not get it correct they get another chance at getting the original number correct.
I'm trying to work out the accuracy of the values they input (and then I display that accuracy as a percentage when the program has finished.) For example, if they input 11 values (i.e. 1 of them is not the correct number) then I'm guessing the accuracy is approximately 90%. But what is the formula to obtain this figure/percentage?
Thanks.
Prozeen
Junior Poster in Training
52 posts since Jun 2007
Reputation Points: 10
Solved Threads: 4
Skill Endorsements: 0
You need to have 2 numbers to compute the accuracy:
- Number of successful attempts (call it s)
- Number of total attempts (call it t)
And here's the formula: accuracy = (s / t) * 100
Cheers :)
zmariow
Junior Poster in Training
71 posts since Aug 2007
Reputation Points: 14
Solved Threads: 1
Skill Endorsements: 0
Thanks for the help guys. Okay, I tried running the program, using both the formulas you supplied at the same time. When I use the program with no incorrect answers I get...
plusplus = 0
zmariow = 10
And when I have one incorrect answer (i.e. 11 attempts for 10 numbers)...
plusplus = -10
zmariow = 9.090909
From what I can work out plusplus is close to the mark (probably due to my ambiguity) but it's not as accurate as zmariow. So, because I want to show it as a percentage, here's what I came up with...
res2 =(success / attempt) * 100 * 10
lblresults.caption "Your accuracy is " and res2 & "%"
Is this right?
Prozeen
Junior Poster in Training
52 posts since Jun 2007
Reputation Points: 10
Solved Threads: 4
Skill Endorsements: 0
...When I use the program with no incorrect answers I get...
plusplus = 0
zmariow = 10
Since you're getting 10 using my formula I assume you're doing something wrong when counting the number of mistakes and the total number.
This is because you should have s and t both equal to 10 and the formula should give you: 100... that is 10/10 * 100 = 100...
Can you show us what are the values of s and t??? (or whatever names you're using for those variables)
zmariow
Junior Poster in Training
71 posts since Aug 2007
Reputation Points: 14
Solved Threads: 1
Skill Endorsements: 0
Okay, to cut a long story short, I finally got it. For some reason I had to declare "success" in the general declarations section. I don't know how, but it fixed the problem and now I'm using the exact code you provided zmariow. Thanks for that!
Prozeen
Junior Poster in Training
52 posts since Jun 2007
Reputation Points: 10
Solved Threads: 4
Skill Endorsements: 0
Question Answered as of 5 Years Ago by
zmariow
and
plusplus You're welcome :)
I also advice you to investigate this declarations issue in order to avoid more problems later on.
Cheers:)
zmariow
Junior Poster in Training
71 posts since Aug 2007
Reputation Points: 14
Solved Threads: 1
Skill Endorsements: 0