CIS 230 Practice Final Exam

Part I

TRUE/FALSE

1 In the expression intValues(5) the 5 digit is referred to as a subscript.
2 A Type statement ends with the Type End statement.
3 VB requires you to close all data files before a project ends.
4 It is possible to open a random access file for reading AND writing.
5 Records must be of equal size in a sequential access file.

Part II

Write a code segment that performs the following tasks. Follow the precise directions and do not add prefixes to specified identifiers.

1. Write a statement that declares a two-dimensional array of integers named intValues that contains 3 rows and 5 columns. Make sure that the row and column subscripts begin at 1.

2. Define a user-defined data type named Book. It should contain fields that specify the book's title, the number of pages, and the author's last name. Use logical variable names and reasonable data types and sizes.

3. Write a statement that declares an array of books (from Exercise #2) named udtBestseller that will hold information for exactly 5 books.

4. Write a statement that assigns the name "Twain" to the third record of the array declared in Exercise #3.

5. Write a loop that will initialize the number of pages for each book in the array udtBestseller (Exercise #3) to the value 10.

6. Write a statement that opens a random access file with the pathname "A:\income.txt" so that you can read data from the file later in the program.


CIS 230 Home PageExam Information