Visual Basic - PHONEDIR.TXT
What is wrong with the following program segment?
Dim name, number As String
Dim sr As IO.StreamReader = IO.File.OpenText("PHONEDIR.TXT")
name = sr.ReadLine
number = sr.ReadLine
Do While sr.Peek <> -1
If name = "Jim" Then
txtBox.Text = "Jim's number is " & number
End If
name = sr.ReadLine
number = sr.ReadLine
Loop
sr.Close()
a. number should be a numeric variable
b. If Jim’s name and number are the last two entries in the file, they will not be processed by the If statement
c. The Do While loop should have been replaced by a Do…Until loop
d. There is nothing wrong with the program segment
11 years ago
2
Answer(0)
Bids(0)
other Questions(10)
- EPA Case
- below are the spanish questions
- Help with nutrition Home work
- Communicating and Collaborating: Family Involvement PowerPoint
- How are the program requirements for vans versus passenger cars different?
- Health question 2 questions
- Motivation
- Relocation
- he user experience framework can help designers constrain and scope the user experience of a given system. The user...
- for brianwigi only