【发布时间】:2016-11-15 19:46:52
【问题描述】:
VB的代码:
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
要回答的问题:如何计算输入了多少个 EmployeeID?
对于这项任务,我假设教授希望我们将员工人数限制为 10 人,因此我正在尝试弄清楚如何做到这一点。此外,出于本次分配的目的,我们应该假设 EmployeeID 可以是长达六或七位数的任何数字,具体取决于公司的规模。
例如:1000 10001 100001 101000 等等……
【问题讨论】:
-
将它们添加到
Collection或其他容器中。
标签: vb.net visual-studio count counter