Prog 2 Midterm
Prog 2 Midterm
Midterm
payroll
If else
End Sub
End Class
Private Sub textb1_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles textb1.TextChanged
If Val(textb1.Text) >= 0 Then
lbl1.Text = "positive number!"
Else
lbl1.Text = "negative number!"
End If
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
grades.Show()
End Sub
End Class
Private Sub Textb1_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Textb1.TextChanged
If Val(Textb1.Text) >= 90 and val(textb1.Text)<=100 Then
lbl1.Text = "A"
ElseIf Val(Textb1.Text) >= 80 And Val(Textb1.Text) <= 89 Then
lbl1.Text = "B"
ElseIf Val(Textb1.Text) >= 70 And Val(Textb1.Text) <= 79 Then
lbl1.Text = "C"
ElseIf Val(Textb1.Text) >= 60 And Val(Textb1.Text) <= 69 Then
lbl1.Text = "D"
ElseIf Val(Textb1.Text) < 60 Then
lbl1.Text = "F"
Else
lbl1.Text = "invalid entry!"
End If
End Sub
End Class
Health assessment
CT-Scan
Head=12000
Upper Limbs=10000
Lower Limbs=9000
Mouth=5000
X-Ray
Head=600
Upper Limbs=450
Lower Limbs=300
Mouth=150
Physical Exam
Head=300
Upper Limbs=250
Lower Limbs=250
Mouth=200
COMPUTE BUTTON
If rbCT.Checked = True And cbHead.CheckState = 1 Then
txtBill.Text = Val(txtBill.Text) + 12000
End If
If rbCT.Checked = True And cbLow.CheckState = 1 Then
txtBill.Text = Val(txtBill.Text) + 9000
End If
If rbCT.Checked = True And cbUp.CheckState = 1 Then
txtBill.Text = Val(txtBill.Text) + 10000
End If
If rbCT.Checked = True And cbMouth.CheckState = 1 Then
txtBill.Text = Val(txtBill.Text) + 5000
End If
If rbX.Checked = True And cbHead.CheckState = 1 Then
txtBill.Text = Val(txtBill.Text) + 600
End If
If rbX.Checked = True And cbLow.CheckState = 1 Then
txtBill.Text = Val(txtBill.Text) + 300
End If
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
g.Text = Double.Parse(r.Text) * (dp.Text)
If g.Text >= 10000 Then
t.Text = Double.Parse(g.Text) * 0.12
Else
t.Text = Double.Parse(g.Text) * 0.07
End If
If g.Text >= 15000 Then
s.Text = 1750
ElseIf g.Text >= 10000 And g.Text < 15000 Then
s.Text = 1150
ElseIf g.Text >= 5000 And g.Text < 10000 Then
s.Text = 750
Else
s.Text = 350
End If
n.Text = Double.Parse(g.Text) - (Double.Parse(s.Text) + Double.Parse(p.Text) +
Double.Parse(de.Text) + Double.Parse(t.Text))
End Sub
End Class
Case