Name:     ID: 
 
    Email: 

CS104-1 Visual Basic VII

Multiple Choice
Identify the letter of the choice that best completes the statement or answers the question.
 

 1. 

You open a sequential access file for ____ when you want to read its contents.
a.
Output
b.
Input
c.
Add
d.
Append
 

 2. 

When you open an existing sequential access file for Output, Visual Basic will
a.
erase its contents after writing the new information.
b.
add the new information to the existing data.
c.
erase its contents before writing the new information.
d.
none of the above
 

 3. 

Which of the following will add the word Idaho to a list box named lstState?
a.
lstState.AddList "Idaho"
b.
lstState.ItemAdd "Idaho"
c.
lstState.Add "Idaho"
d.
lstState.AddItem "Idaho"
 

 4. 

The information in a data file is organized into ____.
a.
fields and records
b.
records and data
c.
files and records
d.
sequential fields
 

 5. 

If you want a list box to display its values when the form first appears on the screen, you will need to define the list box items in the ____.
a.
list box's Load event procedure
b.
list box's Click event procedure
c.
form's Start event procedure
d.
form's Load event procedure
 

 6. 

Which of the following tells Visual Basic to select the second item in a list box named lstName?
a.
lstName.ListIndex = 2
b.
lstName.ListIndex = 0
c.
lstName.Select = 1
d.
lstName.ListIndex = 1
 

 7. 

Assume the Sales.dat file was opened as filenumber 1.  Which of the following will write the contents of the intPerson and curSales variables to the Sales.dat file?
a.
Write intPerson, curSales to #1
b.
Write #1 intPerson, curSales
c.
Write 1, intPerson, curSales
d.
Write #1, intPerson, curSales
 

 8. 

A ____ is a group of related items that contain all of the necessary data about a specific person, place, or thing.
a.
record
b.
data file
c.
field
d.
program file
 

 9. 

Which of the following is a valid Open statement?
a.
Open "a:\test.dat" As #1
b.
Open "a:\test.dat" For Append As #1
c.
Open "a:\test.dat" For Add As #1
d.
none of the above
 

 10. 

Which of the following will stop the loop when there are no more records in the file opened as #1?
a.
Do While EOF>1
b.
Do While Not EOF(1)
c.
Do While EOF Not(1)
d.
none of the above
 



 
Submit          Reset Help