Answer to Question #52901 in Visual Basic for Kliff

Question #52901
Write a project in visual basic to design a suitable form to allow the uses
to enter name of sales representative and sales amount and then calculate
and display commission. Commission is 7% of sales amount if sales
amount exceed Ringgits 60000 otherwise it is 5% tax @ 1% is to be
deducted on commission obtained
1
Expert's answer
2015-06-05T04:32:30-0400
Public Class mainForm
    ''' <summary>
    ''' Calculate button
    ''' </summary>
    ''' <param name="sender"></param>
    ''' <param name="e"></param>
    ''' <remarks></remarks>
    Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculate.Click
        Try
            'Commission is 7% of sales amount if sales amount exceed Ringgits 60000
            Dim SalesAmount As Double = Double.Parse(txtSalesAmount.Text)
            Dim Commission As Double
            If (SalesAmount > 60000) Then
                Commission = SalesAmount * 0.07
            Else
                '5% tax @ 1% is to be deducted on commission obtained
                Commission = SalesAmount * 0.05
                Commission -= Commission * 0.01
            End If
            txtCommission.Text = "$" + Commission.ToString()
        Catch ex As Exception
        End Try
       
    End Sub
End Class

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS