Exam 10: Structures and Sequential Access Files
Exam 1: An Introduction to Visual Basic 201560 Questions
Exam 2: Designing Applications60 Questions
Exam 3: Using Variables and Constants60 Questions
Exam 4: The Selection Structure59 Questions
Exam 5: More on the Selection Structure60 Questions
Exam 6: The Repetition Structure60 Questions
Exam 7: Sub and Function Procedures60 Questions
Exam 8: String Manipulation60 Questions
Exam 9: Arrays60 Questions
Exam 10: Structures and Sequential Access Files60 Questions
Exam 11: Classes and Objects60 Questions
Exam 12: Web Applications60 Questions
Exam 13: Working With Access Databases and Linq60 Questions
Exam 14: Access Databases and Sql60 Questions
Select questions type
An application contains the Structure statement shown below:
Structure Furniture
Public strStyle As String
Public decPrice As Decimal
End Structure
Write a Dim statement that declares a Furniture variable named sofas . Then, write assignment statements that assign the value "Sectional" to the strStyle member, and assign the number 1895.99 to the decPrice member.
(Essay)
4.9/5
(36)
An application contains the Structure statement shown below:
Structure SalonInfo
Public strService As String
Public intRate As integer
End Structure
Write a Dim statement that declares an eight-element one-dimensional array of SalonInfo variables. Name the array mySalonInfo . Write the code to store the following data in the array:


(Essay)
4.7/5
(30)
Case-Based Critical Thinking Questions Case 1 - Frames Unlimited
Frames Unlimited is a wholesale picture and poster frame business. Frame data is stored in sequential access files that contain four columns: item number, item name, size, and price.
An application uses the posterFrame.txt sequential access file to display all of the poster frames in a list box. You need to use the list box to select and remove any poster frames that are 16x20. Which of the following statements determines if a line is selected in the list box?
(Multiple Choice)
4.7/5
(37)
Which of the following statements will close the sequential access file associated with the outFile variable?
(Multiple Choice)
4.9/5
(27)
Which of the following statements will read data from a sequential access file?
(Multiple Choice)
4.9/5
(39)
Write the statement that would write two columns of text to an output file named outFile . The first column, which contains the data for the strStudentID variable, must contain nine characters. The second column contains the data for the strLastName variable.
(Essay)
4.8/5
(30)
Write a Structure statement that defines a structure named Order. The structure contains four member variables named strItemNum , strItemDesc , decPrice , and intQuantity . Then write the Dim statement that declares an Order variable named furniture .
(Essay)
4.9/5
(39)
Programmers use structure variables to store related items in an array, even when the items have different data types.
(True/False)
4.8/5
(31)
After opening a file for input, you can use the ____ to read the file's contents, one line at a time.
(Multiple Choice)
5.0/5
(31)
You can use the Strings.Space method to include a specific number of space characters in a string.
(True/False)
4.8/5
(44)
When you pass a structure variable to a Sub or Function procedure, its member variables are not automatically passed.
(True/False)
4.8/5
(28)
Case-Based Critical Thinking Questions Case 1 - Frames Unlimited
Frames Unlimited is a wholesale picture and poster frame business. Frame data is stored in sequential access files that contain four columns: item number, item name, size, and price.
You should ____ the pictureFrame.txt file as soon as you have finished using it.
(Multiple Choice)
4.9/5
(41)
After declaring a StreamReader variable, you can use the ____ to open a sequential access file for input; doing this automatically creates a StreamReader object.
(Multiple Choice)
4.9/5
(43)
Write the statement that would remove the item "RGT12985" from the lstPartNumber control.
(Essay)
4.7/5
(32)
In the syntax for the PadLeft method, ____ is an integer that represents the total number of characters you want the string to contain.
(Multiple Choice)
4.8/5
(33)
Case-Based Critical Thinking Questions Case 1 - Frames Unlimited
Frames Unlimited is a wholesale picture and poster frame business. Frame data is stored in sequential access files that contain four columns: item number, item name, size, and price.
Which of the following statements removes the selected line in the list box?
(Multiple Choice)
4.9/5
(39)
You can use the ____ to open a sequential access file for output.
(Multiple Choice)
4.8/5
(31)
Write an If clause that determines whether the sequential access file named contacts.txt exists. If the file exists, open the file. If the file does not exist, display the message "File not found" in a message box. The application is named "View Contacts".
(Essay)
4.8/5
(25)
Problems - Correcting Logic and Code Errors
The following sample of code contains errors. Rewrite the incorrect statements to correct all errors.
Structure ExamGrades
Public decExam1 As Decimal
Public decExam2 As Decimal
Public decExam3 As Decimal
End Structure
--------------------------- Private Function CalcAverage(ByVal grades As Decimal) As Decimal
' calculates and returns the average grade
Dim decSum As Decimal
decSum = grades.Exam1 + grades.Exam2 +
grades.Exam3
Return decSum * 3
End Function ---------------------------
Private Sub btnAverage_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnAverage.Click
' display the average exam grade
Dim threeGrades As ExamGrades
Dim decAverage As Decimal
Decimal.TryParse(txtGrade1.Text, decExam1)
Decimal.TryParse(txtGrade2.Text, decExam2)
Decimal.TryParse(txtGrade3.Text, decExam3)
decAverage = CalcAverage(threeGrades)
lblResult.Text = decAverage.ToString("N1")
End Sub
(Essay)
5.0/5
(31)
Showing 41 - 60 of 60
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)