You are on page 1of 2

Problem 1

I.

Problem
Write a program that will calculate the wage of an employee working for the company
and enter the sample data to test your solutions.

II. Flowchart
Start

Let W1 = Week 1
W2 = Week 2
W3 = Week 3
W4 = Week 4

Enter W1, W2, W3, W4

Sales = W1 + W2 + W3 + W4

Is (Sales > 10000)


And Sales <= 5000?
Is Sales > 50000?

Is Sales <= 10000?


No

No

Yes
com = 1000

Yes
com = Sales * 15%

End

III. Source Code


Private Sub cmdCpt_Click()
Dim N As String

Yes
com = 7500

Dim Sum As Double


Dim Wage As Double
W1 = Val(txtW1.Text)
W2 = Val(txtW2.Text)
W3 = Val(txtW3.Text)
W4 = Val(txtW4.Text)
Sales = W1 + W2 + W3 + W4
If (Sales <= 10000) Then
com = 1000
Else
If (Sales > 10000 And Sales <= 50000) Then
com = 0.15 * Sales
Else
If (Sales > 50000) Then
com = 7500
Else
End If
End If
End If
lblSal.Caption = "$ " & Sales
lblCom.Caption = "$ " & Format(com, "#,##0.00")
End Sub
IV. Screen Shot

txtName

txtW1
txtW2
txtW3
txtW4
lblSal
lblCom
cmdCpt

You might also like