| | |
Formula for percentage?
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
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.
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.
•
•
Join Date: Jul 2007
Posts: 192
Reputation:
Solved Threads: 16
Do you let them try a second time with the original number and when they get it right the second time you still take off for that? Before you have a formula you have to have the exact rules.
Anyway, let me try to answer your question even without knowing the exact rules, you can adapt it accordingly
let's say you give them 10 questions
you have a variable called mistake. Every time they got an answer wrong you add 1 to mistake.
10 = 100% so for each mistake you take off 10%. So your formula would be
100-(mistake*10)
Anyway, let me try to answer your question even without knowing the exact rules, you can adapt it accordingly
let's say you give them 10 questions
you have a variable called mistake. Every time they got an answer wrong you add 1 to mistake.
10 = 100% so for each mistake you take off 10%. So your formula would be
100-(mistake*10)
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... Is this right?
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...
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
res2 =(success / attempt) * 100 * 10 lblresults.caption "Your accuracy is " and res2 & "%"
•
•
•
•
...When I use the program with no incorrect answers I get...
plusplus = 0
zmariow = 10
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)
![]() |
Similar Threads
- How to get the percentage..?? (MySQL)
- Format Number as percentage. (PHP)
- How can I pass values to Crystal 9 “Formulas� and “Selection Formula� with VB6 (Visual Basic 4 / 5 / 6)
- confusing formula... help? (C)
- percentage (C++)
- program (C)
- makin a table (noob, please help) (C++)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Getting numbers out of Excel via VB6
- Next Thread: Use IDM From VB
| Thread Tools | Search this Thread |
Tag cloud for Visual Basic 4 / 5 / 6
* 6 429 2007 access activex add age append application basic beginner birth bmp c++ calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sort sql sqlserver struct subroutine table tags textbox time timer urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





