What is wrong with the following program segment if jims


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

Request for Solution File

Ask an Expert for Answer!!
Visual Basic Programming: What is wrong with the following program segment if jims
Reference No:- TGS01009250

Expected delivery within 24 Hours