Explain program segment is wrong

Assignment Help Visual Basic Programming
Reference no: EM13756088

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

Reference no: EM13756088

Questions Cloud

Why did the pilgrims and puritans leave europe fore americas : Why did the pilgrims and puritans leave europe fore the americas?
Steps in completing the accounting cycle : What are the steps in completing the accounting cycle? Discuss the relationship between the amounts on the Adjusted Trial Balance for an account and its ledger?
What type of foreign policy did us adopt after world war i : What type of foreign policy did united states adopt after world war I?
Purpose of preparing a trial balance : When is the trial balance prepared? What is the purpose of preparing a trial balance? What does the trial balance tell you? What does the trial balance not tell you?
Explain program segment is wrong : What is wrong with the following program segment. If Jim's name and number are the last two entries in the file, they will not be processed by the If statement
Basis of accounting : Which basis of accounting do most companies use, cash or accrual? Why? Which method is approved by GAAP? Why?
What does title medici: godfathers of renaissance suggest : What does the title The Medici: Godfathers of the Renaissance suggest about the series and the family?
What is wrong with the program segment : Which format statement should be used when you want to output your results in tabular format with the first column 10 characters wide, the second 5, and the third 10
Different users of accounting information : Who are the different users of accounting information? What are the differences between managerial and financial accounting? What is the role of the CPA and how does it differ from other accountants?

Reviews

Write a Review

Visual Basic Programming Questions & Answers

  Data storage & "exception error trapping"

Discussion on Data Storage and  "Exception Error Trapping".

  Why is the theory of charisma described as a double-edge

why is the theory of charisma described as a double-edge sword? please identify a leader that used charisma in a

  Need help building a vwd website

Need help building a VWD website. This website may not go live. I have little progress as a family tragedy has impeded my time for school.

  Write a visual basic program to create an invoice

Write a Visual Basic program to create an invoice form for an order. (See the diagram below.) After the data on the left side of the form are entered, the user can display an invoice in a list box by pressing the Process Order button.

  Main objectives of the assessmentnbspthe aim of the

main objectives of the assessmentnbspthe aim of the assessment is to develop a visual basic console application that

  Create an application in which a user can enter a phone book

Create an application in which a user can enter a phone book entry, including the following elements: First Name, Last Name, Phone Number, email address

  Visual basic programming discussiondecision logic please

visual basic programming discussiondecision logic please respond to the followingthe use of decision logic is one of

  Salary survey application i created an application in

i created an application in visual basics for a salary survey but i can3939t seem to get the application to work.

  Program in basic which prompts user to input two integers

Write down the program by using Small Basic which prompts the user to input two integers: firstNum and secondNum (firstNum must be less than secondNum).

  Write the code to play a number guessing game

Write the code to play a number guessing game. Allow the user to select a lower and upper range to guess between. Ask the user how many guesses they want to guess the number. (Can be accomplished by a text box or a numeric up/down control).

  Create an application user to enter the following employee

Create an application that allows the user to enter the following employee data: First Name, Middle Name, Last Name, Employee Number, Department, Telephone Number, Telephone Extension, and E- mail Address. The valid selections for depart-ment are Acc..

  Prepare a vb application for the subsequent math application

Prepare a VB application for the subsequent Math Application - The problems displayed for the students into two levels.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd