This program is to calculate commission and this is the pseudo I wrote for it. Tell me if I'm right.
1 Declare variables
2 get sales
3 calculate
if sale < 1500 Then
commision= sale * 0,02
else
commision= sale * 0,04
4 Dispaly commision

Recommended Answers

All 9 Replies

Seems right.

Private Sub Display_Click(ByVal sender As Object ByVal e As System.EvenArg)
Dim Sale As Integer, Result As Single, Commition As Single
Sale = Val(InputBox("please enter sale", "sale")
If Sale < 1500 Then
    Result= Sale*0.02
Else
    Result= Sale*0,04
End If
Me.ResultLabel.Text = Result
End Sub

This is how I wrote my vb code for it

Seems OK, only on line 9 you are setting a string equal to a Single.

Look at line 7:
Result= Sale*0,04
It must be :
Result= Sale*0.04

Also Commition variable is not used. Just remove it.

commented: Fine eye! +14

Thanks guys @ ddanbe how shoud I code line 9 or Jx Man you're right the commiton is not used and should be removed.

Something like Me.ResultLabel.Text = Result.ToString()

Thanks guys @ ddanbe how shoud I code line 9 or Jx Man you're right the commiton is not used and should be removed.

Thanks mate! I have more questions stay tuned.

Thanks mate! I have more questions stay tuned.

Don't forget to mark this thread as Solved.

More question? Just make new thread :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.