的VB代碼:如何計算Visual Basic中的用戶輸入?
For 'I think this where the counter would go if I knew how to write it
If (intEmpCount < 10) Then
If decTotalTax < decGrossPay Then
decNetPay = decNetPay
boxResults.Items.Add("EMPLOYEE ID: " & dblEmpID.ToString)
boxResults.Items.Add("Gross Pay: $" & decGrossPay.ToString("N2"))
boxResults.Items.Add("Net Pay: $" & decNetPay.ToString("N2"))
boxResults.Items.Add("State Withholdings: $" & decStateTaxAmount.ToString("N2"))
boxResults.Items.Add("Federal Withholdings: $" & decFederalTaxAmount.ToString("N2"))
boxResults.Items.Add("FICA Withholdings: $" & decFICAAmount.ToString("N2"))
Else
MessageBox.Show("ERROR. THE AMOUNT OF WITHOLDINGS ($" & decTotalTax.ToString("N2") & ") EXCEEDS THE GROSS PAY.")
End If
Else
MessageBox.Show("ERROR. YOU HAVE EXCEEDED THE ALLOWABLE NUMBER OF EMPLOYEES.")
End if
的要回答的問題:我如何計算有多少EmployeeIDs已進入?
對於這項任務,我打算假設教授希望我們將員工人數限制爲10人,所以我正試圖弄清楚如何做到這一點。同樣爲了這個任務的目的,我們應該假定EmployeeID可以是長達六位或七位數字的任何數字,這取決於公司的規模。
例如:1000 10001 100001 101000等等...
將它們添加到「集合」或其他容器。 – Comintern