Rachkir
2008-11-04 20:00:33
um, I know this isnt a very good place for this subject, but I know a lot of you are smart with computer languages. It did say software development under description....
FOR THE RECORD, MSDN FORUMS ARE A PEICE OF SHIT AND SO IS MSDN LIBRARY AND SO IS THIS SOFTWARE LANGUAGE AND SO IS USING INPUT BOXES FOR DATA
heres my code, well, not what I want, this is simple test code trying to get shit to work right.
' double variables to store values entered in input boxes
Dim dblHours, dblPayRate, dblState, dblFed, dblFICA As Double
dblHours = InputBox("Please Enter Hours Worked")
dblPayRate = InputBox("Please Enter Rate of Pay")
dblState = InputBox("Enter Percent of State Income Tax to Withhold")
dblFed = InputBox("Enter Percent of Federal Income Tax to Withhold")
dblFICA = InputBox("Enter Percent of FICA Income Tax to Withhold")
Dim dblGrossPay, dblNetPay, dblPercentState, dblPercentFed, _
dblPercentFICA As Double
Dim strPercentState, strPercentFed, strPercentFICA As String
' data conversions to change value stored from input box into a percentage
strPercentState = dblState.ToString("p")
strPercentFed = dblFed.ToString("P")
strPercentFICA = dblFICA.ToString("p")
' Main Computation
dblGrossPay = CDbl(dblHours * dblPayRate)
dblPercentState = CDbl(dblGrossPay * strPercentState)
dblPercentFed = CDbl(dblGrossPay * strPercentFed)
dblPercentFICA = CDbl(dblGrossPay * strPercentFICA)
dblNetPay = CDbl(dblGrossPay - dblPercentFed _
- dblPercentState - dblPercentFICA)
I keep getting errors stating the string cannot convert to data type double, mind you this says it regardless of the data type variable used to store the math. it stops on the 2nd line of math : dblPercentState = CDbl(dblGrossPay * strPercentState)
I havent found a way to convert the value stored from the InputBox to a percentage unless I use the .ToString method. which is annoying becuase it only works sending a value to a string. And I really dont want to use double data types for my InputBox variables because then I cannot test for empty string input.
Of course this is lacking the code to display the data on the design form. Its going to on in a list box because my assignment tells me to. I shouldve picked the easier one....but then you dont learn anything. I need to do this for 4 employees and figure out how to show 4 employees data in one list box. Not to hard considering Ive done showed information in list boxes, making it look like excel spreadsheets. Pain in da butt.
Ive tried many ways, and my book is a peice of shit and my teacher does not respond.
FOR THE RECORD, MSDN FORUMS ARE A PEICE OF SHIT AND SO IS MSDN LIBRARY AND SO IS THIS SOFTWARE LANGUAGE AND SO IS USING INPUT BOXES FOR DATA
heres my code, well, not what I want, this is simple test code trying to get shit to work right.
' double variables to store values entered in input boxes
Dim dblHours, dblPayRate, dblState, dblFed, dblFICA As Double
dblHours = InputBox("Please Enter Hours Worked")
dblPayRate = InputBox("Please Enter Rate of Pay")
dblState = InputBox("Enter Percent of State Income Tax to Withhold")
dblFed = InputBox("Enter Percent of Federal Income Tax to Withhold")
dblFICA = InputBox("Enter Percent of FICA Income Tax to Withhold")
Dim dblGrossPay, dblNetPay, dblPercentState, dblPercentFed, _
dblPercentFICA As Double
Dim strPercentState, strPercentFed, strPercentFICA As String
' data conversions to change value stored from input box into a percentage
strPercentState = dblState.ToString("p")
strPercentFed = dblFed.ToString("P")
strPercentFICA = dblFICA.ToString("p")
' Main Computation
dblGrossPay = CDbl(dblHours * dblPayRate)
dblPercentState = CDbl(dblGrossPay * strPercentState)
dblPercentFed = CDbl(dblGrossPay * strPercentFed)
dblPercentFICA = CDbl(dblGrossPay * strPercentFICA)
dblNetPay = CDbl(dblGrossPay - dblPercentFed _
- dblPercentState - dblPercentFICA)
I keep getting errors stating the string cannot convert to data type double, mind you this says it regardless of the data type variable used to store the math. it stops on the 2nd line of math : dblPercentState = CDbl(dblGrossPay * strPercentState)
I havent found a way to convert the value stored from the InputBox to a percentage unless I use the .ToString method. which is annoying becuase it only works sending a value to a string. And I really dont want to use double data types for my InputBox variables because then I cannot test for empty string input.
Of course this is lacking the code to display the data on the design form. Its going to on in a list box because my assignment tells me to. I shouldve picked the easier one....but then you dont learn anything. I need to do this for 4 employees and figure out how to show 4 employees data in one list box. Not to hard considering Ive done showed information in list boxes, making it look like excel spreadsheets. Pain in da butt.
Ive tried many ways, and my book is a peice of shit and my teacher does not respond.