Sunteți pe pagina 1din 6

Visual Basic.

Net

Your Name: Ronald Hsu


CIS 1
Days, Time TR, 2:00-3:20PM
Semester Spring
Date 3/22/2011
Instructor Name: Earl T. Wylie, Ph.D.
Assignment: Lesson Number 5-1 Page 120
Lab 5

Problem – write a vb. program that determines whether an


applicant’s qualifications for the job, and also groups the
applicant into either a desirable candidate, a possible
candidate, or an unacceptable candidate.

Analysis IPO.

Data Requirements:

Constants: (NONE)

Inputs: input name as well as make a selection in each of the


five categories on the form.

Outputs: program will tally the total point values in which your
selections are worth and determine your eligibility
for the job position.

Variables: The three groups (Desirable, Possible, &


Unacceptable) of candidates based off the
accumulated scores from each category.

Formulas: decValue = decValue1 + decValue2 + decValue3 +


decValue4 + decValue5

Design

Algorithm

1. Form-name-frmjobscreening, text-job applicant


screening, size-fill the screen, backcolor-control,
startposition-center of screen
2. button1-name-btncompute, text-&compute,
backcolor-control, fontcolor-black, fontsize-10,
location-bottom left corner of form
3. button2-name-btnreset, text-&reset form,
backcolor-control, fontcolor-black, fontsize-10,
location-bottom center of form
4. button3-name-btnexit, text-e&xit, backcolor-
control, fontcolor-black, fontsize-10, location-bottom
right corner of form
5. groupbox1-name-grpeducationlevel, text-education
level, backcolor-control, fontcolor-blue, fontsize-8,
location-top center of the form.
6. groupbox2-name-grpeducationfield, text-education
field, backcolor-control, fontcolor-blue, fontsize-8,
location-top right of the form.
7. groupbox3-name-grpexperienceyears, text-
experience in years, backcolor-control, fontcolor-blue,
fontsize-8, location-middle left of the form.
8. groupbox4-name-grpexperiencefield, text-experience
in field, backcolor-control, fontcolor-blue, fontsize-8,
location-middle center of the form.
9. groupbox5-name-grpcomputerexperience, text-
computer experience, backcolor-control, fontcolor-
blue, fontsize-8, location-middle right of the form.
10. groupbox6-name-grpresults, text-results,
backcolor-control, fontcolor-blue, fontsize-8, location-
bottom of the form.
11. label1-name-label1, text-job applicant screening,
backcolor-control, fontcolor-black, fontstyle-bold,
fontsize-24, location-top of the form.
12. label2-name-label2, text-enter name, backcolor-
control, fontcolor-black, fontstyle-bold, fontsize-10,
location-top left of the form.
13. label3-name-lblname, text-(blank), backcolor-
control, fontcolor-black, fontstyle-bold, fontsize-14,
location-left side in grpresults.
14. label4-name-lblratings, text-(blank), backcolor-
control, fontcolor-black, fontstyle-bold, fontsize-14,
location-center in grpresults.
15. label5-name-lbltotalpoints, text-(blank), backcolor-
control, fontcolor-black, fontstyle-bold, fontsize-14,
location-right side in grpresults.
16. radiobutton1-name-radfouryears, text-4 years of
college, backcolor-control, fontcolor-black, fontsize-8,
location-top in grpeducationlevel
17. radiobutton2-name-radtwoyears, text-2 years of
college, backcolor-control, fontcolor-black, fontsize-8,
location-top middle in grpeducationlevel
18. radiobutton3-name-radhighgrad, text-high school
grad, backcolor-control, fontcolor-black, fontsize-8,
location-bottom middle in grpeducationlevel
19. radiobutton4-name-radnograd, text-not high
school grad, backcolor-control, fontcolor-black,
fontsize-8, location-bottom in grpeducationlevel
20. radiobutton5-name-radengineering, text-
engineering, backcolor-control, fontcolor-black,
fontsize-8, location-top in grpeducationfield
21. radiobutton6-name-radbusiness, text-business,
backcolor-control, fontcolor-black, fontsize-8, location-
bottom middle in grpeducationfield
22. radiobutton7-name-radothereducation, text-other,
backcolor-control, fontcolor-black, fontsize-8, location-
bottom bottom in grpeducationfield
23. radiobutton8-name-radmorethanfive, text-more
than 5 years, backcolor-control, fontcolor-black,
fontsize-8, location-top in grpexperienceyears
24. radiobutton9-name-radthreetofive, text-3 to 5
years, backcolor-control, fontcolor-black, fontsize-8,
location-middle in grpexperienceyears
25. radiobutton10-name-radlessthanthree, text-less
than 3 years, backcolor-control, fontcolor-black,
fontsize-8, location-bottom in grpexperienceyears
26. radiobutton11-name-radmanufacturing, text-
manufacturing, backcolor-control, fontcolor-black,
fontsize-8, location-top in grpexperiencefield
27. radiobutton12-name-radsales, text-sales,
backcolor-control, fontcolor-black, fontsize-8, location-
middle in grpexperiencefield
28. radiobutton13-name-radotherexperience, text-
other, backcolor-control, fontcolor-black, fontsize-8,
location-bottom in grpexperiencefield
29. radiobutton14-name-radyes, text-yes, backcolor-
control, fontcolor-black, fontsize-8, location-top in
grpcomputerexperience
30. radiobutton1-5name-radno, text-no, backcolor-
control, fontcolor-black, fontsize-8, location-bottom in
grpcomputerexperience
31. textbox1-name-txtname, text-enter name,
backcolor-control, fontcolor-black, fontstyle-bold,
fontsize-10, location-top left of the form.

Implementation – Public Class frmJobScreening

Private Sub btnExit_Click(ByVal sender As Object, ByVal e As


System.EventArgs) Handles btnExit.Click
Me.Close()
End Sub

Private Sub btnClear_Click(ByVal sender As Object, ByVal e As


System.EventArgs) Handles btnReset.Click

txtName.Text = ""
lblTotalPoints.Text = ""
lblName.Text = ""
lblRatings.Text = ""

radFourYears.Checked = True
radTwoYears.Checked = False
radHighGrad.Checked = False
radNotGrad.Checked = False

radEngineering.Checked = True
radBusiness.Checked = False
radOtherEducation.Checked = False

radMoreThanFive.Checked = True
radThreetoFive.Checked = False
radLessThanThree.Checked = False

radManufacturing.Checked = True
radSales.Checked = False
radOtherExperience.Checked = False

radYes.Checked = True
radNo.Checked = False
End Sub

Private Sub btnCompute_Click(ByVal sender As Object, ByVal e As


System.EventArgs) Handles btnCompute.Click

Dim decValue As Decimal


Dim decValue1 As Decimal
Dim decValue2 As Decimal
Dim decValue3 As Decimal
Dim decValue4 As Decimal
Dim decValue5 As Decimal

If radFourYears.Checked = True Then


decValue1 = 5
ElseIf radTwoYears.Checked = True Then
decValue1 = 3
ElseIf radHighGrad.Checked = True Then
decValue1 = 1
Else
decValue1 = 0
End If

If radEngineering.Checked = True Then


decValue2 = 5
ElseIf radBusiness.Checked = True Then
decValue2 = 3
Else
decValue2 = 1
End If

If radMoreThanFive.Checked = True Then


decValue3 = 5
ElseIf radThreetoFive.Checked = True Then
decValue3 = 3
Else
decValue3 = 1
End If

If radManufacturing.Checked = True Then


decValue4 = 5
ElseIf radSales.Checked = True Then
decValue4 = 3
Else
decValue4 = 1
End If

If radYes.Checked = True Then


decValue5 = 5
Else
decValue5 = 0
End If

decValue = decValue1 + decValue2 + decValue3 + decValue4 +


decValue5
lblTotalPoints.Text = " with a Total Score of " &
decValue.ToString("n0") & " out of 25"

lblName.Text = txtName.Text & " is "

If decValue > 20 = True Then


lblRatings.Text = "a Desirable candidate"
ElseIf decValue < 10 = True Then
lblRatings.Text = "an Unacceptable candidate"
Else
lblRatings.Text = "a Possible candidate"
End If

End Sub
End Class

Output:
Flow Chart:

Start

Is
applicant
qualified
for the
job?

Value >20 Value <=20 & >=10 Value <10

Value<=20 but >=10

Desirable Possible Unacceptable

Exit

S-ar putea să vă placă și