Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. (TCO 13) A VCR tape’s methodology for accessing a single recorded show is ana

ID: 3668580 • Letter: 1

Question

1. (TCO 13) A VCR tape’s methodology for accessing a single recorded show is analogous to _____.

       a sequential file
       a VSAM file
       an object-oriented database
       a relational database

Question 2. 2. (TCO 13) If a programmer needs to save data input by a user for later use, a _____ is often used.

       streamlined data set
       sequential access file
       sorted data stream
       stored program code

Question 3. 3. (TCO 13) When a program "appends" data to a file, we know that the program is _____.

       adding data to the top of the file
       searching for a matching position in the file and adding data there
       inserting data at the end of the file
       All of the above

Question 4. 4. (TCO 13) To add data to a new file, you would _____.

       read and write a file
       append a file
       update a file
       create a file

Question 5. 5. (TCO 13) To complete an update to a sequential file, you should _____.

       exit from it
       append to it
       output it
       close it

Question 6. 6. (TCO 13) When reading data from a sequential file, the data will be read _____.

       in alphabetical order
       sorted from smallest to largest
       in key field order
       in the order in which it was written

Question 7. 7. (TCO 13) After we create a sequential file using one of our Visual Basic programs, the best Windows program(s) to use to analyze its contents would be _____.

       Windows Notepad
       Microsoft OneNote
       Microsoft Word
       Windows Wordpad
       All of the above

Question 8. 8. (TCO 13) How can we utilize the Peek function to help us accurately find the end of a sequential file?

       The Peek function allows us to examine the next character of a sequential file to see if it’s the last.
       The Peek function allows us to jump to the end of a file.
       The Peek function returns the total number of characters in a sequential file.
       The Peek function returns the total number of lines in a sequential file.

Question 9. 9. (TCO 13) Select the example statement below that would open a sequential file for appending data.

       Dim writer As IO.StreamWriter = IO.File.AppendText("ADDRESSES.TXT")
       Dim reader As IO.StreamReader = IO.File.AppendText("ADDRESSES.TXT")
       Dim reader As IO.StreamReader = IO.File.OpenText("ADDRESSES.TXT")
       Dim writer As IO.StreamWriter = IO.File.CreateText("ADDRESSES.TXT")

Question 10. 10. (TCO 13) Assume the file MONTHS.TXT contains 12 records, the names of all calendar months in ascending order. What is stored in OUTPUT.TXT after the following code is executed?

Dim letter As String
Dim sr As IO.StreamReader = IO.File.OpenText("MONTHS.TXT")
Do While sr.Peek -1
    Dim sw As IO.StreamWriter = IO.File.CreateText("OUTPUT.TXT")
    letter = sr.ReadLine
    sw.WriteLine(letter)
    sw.Close()
Loop
sr.Close()

       All the month names in descending order
       All the month names in ascending order
       December
       January

Question 11. 11. (TCO 13) Give a description of the method CreateText(). Make sure to include the following:

I. The purpose of the method (in other words, what it does)
II. An appropriate situation when you would use it in code
III. Sample code showing the syntax of how it is used in Visual Basic programs

1. (TCO 13) A VCR tape’s methodology for accessing a single recorded show is analogous to _____.

       a sequential file
       a VSAM file
       an object-oriented database
       a relational database

Explanation / Answer

1. A sequential file.

2. Sequential access file.

3. Inserting data at the end of the file.

4. create a file.

5.append it.

6. in the order which it was written.

7.Windows notepad

8. The Peek function allows us to examine the next character of a sequential file to see if it’s the last.

9. Dim writer As IO.StreamWriter = IO.File.AppendText("ADDRESSES.TXT")

10. name of months in asending order

11. The method CreateText() Creates or opens a file for writing UTF-8 encoded text.The syntax of CreateText() method is as follows:-

Parameters that can be used with it - path Type: System.String

The path of the file to be opened for writing

Example Code of Visual Basic program

The situation where it can be used are as follow:-

If the file specified bypath does not exist, it is created. If the file does exist, its contents are overwritten.

The path parameter is permitted to specify relative or absolute path information. Relative path information is interpreted as relative to the current working directory.