EDN Admin
Well-known member
Iam not understanding why my statement is not comming out right. I have tried to change a few things but nothing. I tried changing to total commission around but it still never change I even chane the > to a < but nothing This is my codeI have been
looking over it and I can not find what is going on. the output i get is name = allen monthly sales = 0 sales code = 1 sales person commission = 1000. which this is what my output data should look like.
Name<span> Code<span> MonthlySales<span>
Commission
Adam<span> 1<span>
<span> 500<span>
1005
Bill<span> 1<span>
2000<span>
1020
Chet<span> 2<span>
3000<span>
<span> 90
Doug<span> 3<span>
4000<span>
<span> 660
Eve<span> 4<span>
5000<span>
<span> 300
Total Monthly Sales:<span>
<span> $ 14500
Total CommissionDollars: <span> <span> $ <span>
3075
Module Module1<br/>
<br/>
Sub Main()<br/>
<br/>
<br/>
Dim salesPersonName As String<br/>
Dim monthlySales, SalesPersonCommission, salesmancode As Integer<br/>
Dim totalSales, totalCommission, commission As Integer<br/>
Console.WriteLine("Please enter your name: ")<br/>
salesPersonName = Console.ReadLine()<br/>
Do While Not (salesPersonName.Equals("Eugene"))<br/>
Console.WriteLine("Please enter a sales code: ")<br/>
salesmancode = CInt(Console.ReadLine())<br/>
<br/>
Select Case salesmancode<br/>
Case 1<br/>
SalesPersonCommission = 0.01 * monthlySales + 1000<br/>
Case 2<br/>
SalesPersonCommission = 0.03 * monthlySales<br/>
Case 3<br/>
SalesPersonCommission = 0.04 * monthlySales + 500<br/>
Case Is > 3<br/>
SalesPersonCommission = 0.02 * monthlySales + 200<br/>
<br/>
End Select<br/>
totalCommission = totalCommission + commission<br/>
Console.WriteLine("Please enter your name = " & salesPersonName)<br/>
Console.WriteLine("Monthly Sales = " & monthlySales)<br/>
Console.WriteLine("Sales Code = " & salesmancode)<br/>
Console.WriteLine("Sales Person Commission = " & SalesPersonCommission)<br/>
Console.WriteLine("Please enter your name:")<br/>
salesPersonName = Console.ReadLine()<br/>
Loop<br/>
Console.WriteLine("Total Commission Dollars= " & monthlySales + totalSales)<br/>
<br/>
<br/>
End Sub
Thanks for looking
View the full article
looking over it and I can not find what is going on. the output i get is name = allen monthly sales = 0 sales code = 1 sales person commission = 1000. which this is what my output data should look like.
Name<span> Code<span> MonthlySales<span>
Commission
Adam<span> 1<span>
<span> 500<span>
1005
Bill<span> 1<span>
2000<span>
1020
Chet<span> 2<span>
3000<span>
<span> 90
Doug<span> 3<span>
4000<span>
<span> 660
Eve<span> 4<span>
5000<span>
<span> 300
Total Monthly Sales:<span>
<span> $ 14500
Total CommissionDollars: <span> <span> $ <span>
3075
Module Module1<br/>
<br/>
Sub Main()<br/>
<br/>
<br/>
Dim salesPersonName As String<br/>
Dim monthlySales, SalesPersonCommission, salesmancode As Integer<br/>
Dim totalSales, totalCommission, commission As Integer<br/>
Console.WriteLine("Please enter your name: ")<br/>
salesPersonName = Console.ReadLine()<br/>
Do While Not (salesPersonName.Equals("Eugene"))<br/>
Console.WriteLine("Please enter a sales code: ")<br/>
salesmancode = CInt(Console.ReadLine())<br/>
<br/>
Select Case salesmancode<br/>
Case 1<br/>
SalesPersonCommission = 0.01 * monthlySales + 1000<br/>
Case 2<br/>
SalesPersonCommission = 0.03 * monthlySales<br/>
Case 3<br/>
SalesPersonCommission = 0.04 * monthlySales + 500<br/>
Case Is > 3<br/>
SalesPersonCommission = 0.02 * monthlySales + 200<br/>
<br/>
End Select<br/>
totalCommission = totalCommission + commission<br/>
Console.WriteLine("Please enter your name = " & salesPersonName)<br/>
Console.WriteLine("Monthly Sales = " & monthlySales)<br/>
Console.WriteLine("Sales Code = " & salesmancode)<br/>
Console.WriteLine("Sales Person Commission = " & SalesPersonCommission)<br/>
Console.WriteLine("Please enter your name:")<br/>
salesPersonName = Console.ReadLine()<br/>
Loop<br/>
Console.WriteLine("Total Commission Dollars= " & monthlySales + totalSales)<br/>
<br/>
<br/>
End Sub
Thanks for looking
View the full article