hey all. the program is for Chapter 8 Lesson C in the Visual Basic 2005
below is code where i have to create a program that allows the user to enter a 4-digit number that identifies whether the salesperson is full or part time.
"Each salesperson at BobCat Motors is assigned an ID number, which consists of four characters. The first character is either the letter F or the letter P. The letter F indicates that the salesperson is a full-time employee. The letter P indicates that he or she is a part-time employee. The middle two characters are the salesperson's initials, and the last character is either a 1 or a 2. A 1 indicates that the salesperson sells new cars, and a 2 indicates that the salesperson sells used cars.
Private Sub xCalcButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles xCalcButton.Click
'variables
Dim strInput As String = ""
Dim str1stCharacter As String = ""
Dim strlstCharacter As String
Dim strOutput As String = ""
Dim fullt As Integer = 0
Dim partt As Integer = 0
Dim newsellcar As Integer = 0
Dim usesellcar As Integer = 0
strInput = Me.xIdTextBox.Text
' changes the id number case to upper
strInput = Me.xIdTextBox.Text.ToUpper()
' sets the focus
Me.xIdTextBox.Focus()
str1stCharacter = Microsoft.VisualBasic.Left(strInput, 1)
strlstCharacter = Microsoft.VisualBasic.Left(strInput, 4)
If str1stCharacter = "F" And strlstCharacter = "1" Then
'salesperson is fulltime and sells new cars
Me.xFulltimeLabel.Text =
Me.xNewCarsLabel.Text = CStr(newsellcar)
ElseIf str1stCharacter = "F" And strlstCharacter = "2" Then
'salesperson is fulltime and sells used cars
Me.xFulltimeLabel.Text =
Me.xUsedCarsLabel.Text =
ElseIf str1stCharacter = "P" And strlstCharacter = "1" Then
'salesperson is part-time and sells new cars
Me.xParttimeLabel.Text =
Me.xNewCarsLabel.Text =
ElseIf str1stCharacter = "P" And strlstCharacter = "2" Then
'salesperson is part-time and sells used cars
Me.xParttimeLabel.Text =
Me.xUsedCarsLabel.Text =
End If
End Sub
I know what I want to do...just kinda stuck on making it happen. I'm thinking I may need a Do While structure for the F and P but iono.
Help?