Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

VISUAL BASIC EXAM 2 QUESTIONS AND ANSWERS 100% PASS

Rating
-
Sold
-
Pages
28
Grade
A+
Uploaded on
12-05-2025
Written in
2024/2025

VISUAL BASIC EXAM 2 QUESTIONS AND ANSWERS 100% PASS To retain data between different times that the program runs, an application must have a way of the data in a file. a. Adding b. Encrypting c. Saving d. Deleting - ANS c.Saving A file is like a stream of data that must be read from its beginning to its end. a. direct access b. binary format c. sequential access d. direct format - ANS ntial access The method is used to write data to a file and then writes a newline character immediately after the data. a. PrintLine b. WriteLine c. WriteNewLine d. PrintNewLine - ANS B ©THESTAR 2025 ALL RIGHTS RESERVED 4. Assume the file contains the following lines: Bob Johnson Somewhere USA Which of the following code segments will read the data from the file and put the data into two variables named strName, and strCity. a. Dim addressFile As System.IO.StreamReader addressFile = addressFile.OpenText("") strName = addressFile.ReadLine() strCity = addressFile.ReadLine() addressFile.Close() CS2453 - Exam 3 Review Page 2 of 14 b. Dim addressFile As System.IO.StreamReader addressFile = System.IO.File.OpenText("") strName = addressFile.ReadLine() strCity = addressFile.ReadLine() addressFile.Close() c. Dim addressFile As System.IO.StreamReader addressFile = OpenText("") strName = addressFile.ReadLine() strCity = addressFile.ReadLine() Close() d. Dim addressFile As System.IO.StreamReader addressFile = System.IO.File.OpenText("") strName = addressFile.Input () strCity = addressFile. - ANS B 5. When opening a file you should use this method to determine whether a file exists ©THESTAR 2025 ALL RIGHTS RESERVED before you attempt to open it a. File.Exists b. IO.Exists c. System.IO.Exists d. System.File.Exists - ANS A 6. This control can display a standard Windows Open dialog box. a. OpenDialog b. OpenFileDialog c. OpenWindow d. OpenWindowDialog - ANS B 7. Which of the following statements does the following? Formats a line of text to have the word "Name" in the first column, which is 20 characters wide, and have the word "Address" in the second column, which is also 20 characters wide. a. String.Format("{0, 20}{1, 20}", "Name", "Address") b. String.Format("{ 20}{ 20}", "Name", "Address") c. String.Format(20, 20, "Name", "Address") d. String.Format(20, 40, "Name", "Address") CS2453 - Exam 3 Review Page 3 of 14 - ANS A 8. To left justify the columns in the String.Format method you would use preceding the numbers for the column width. a. a + sign b. an & symbol c. a - sign

Show more Read less
Institution
VISUAL BASIC
Course
VISUAL BASIC

Content preview

©THESTAR 2025 ALL RIGHTS RESERVED




VISUAL BASIC EXAM 2 QUESTIONS
AND ANSWERS 100% PASS


To retain data between different times that the program runs, an application must have
a way of the data in a file.
a. Adding
b. Encrypting
c. Saving

d. Deleting - ANS c.Saving


A file is like a stream of data that must be read from its beginning to its end.
a. direct access
b. binary format
c. sequential access

d. direct format - ANS c.sequential access


The method is used to write data to a file and then writes a newline character
immediately after the data.
a. PrintLine
b. WriteLine
c. WriteNewLine

d. PrintNewLine - ANS B

, ©THESTAR 2025 ALL RIGHTS RESERVED

4. Assume the file address.txt contains the following lines:
Bob Johnson
Somewhere USA
Which of the following code segments will read the data from the file and put the data
into two variables named strName, and strCity.
a. Dim addressFile As System.IO.StreamReader
addressFile = addressFile.OpenText("address.txt")
strName = addressFile.ReadLine()
strCity = addressFile.ReadLine()
addressFile.Close()
CS2453 - Exam 3 Review Page 2 of 14
b. Dim addressFile As System.IO.StreamReader
addressFile = System.IO.File.OpenText("address.txt")
strName = addressFile.ReadLine()
strCity = addressFile.ReadLine()
addressFile.Close()
c. Dim addressFile As System.IO.StreamReader
addressFile = OpenText("address.txt")
strName = addressFile.ReadLine()
strCity = addressFile.ReadLine()
Close()
d. Dim addressFile As System.IO.StreamReader
addressFile = System.IO.File.OpenText("address.txt")
strName = addressFile.Input ()

strCity = addressFile. - ANS B


5. When opening a file you should use this method to determine whether a file exists

, ©THESTAR 2025 ALL RIGHTS RESERVED

before you attempt to open it
a. File.Exists
b. IO.Exists
c. System.IO.Exists

d. System.File.Exists - ANS A


6. This control can display a standard Windows Open dialog box.
a. OpenDialog
b. OpenFileDialog
c. OpenWindow

d. OpenWindowDialog - ANS B


7. Which of the following statements does the following?
Formats a line of text to have the word "Name" in the first column, which is 20
characters wide, and have the word "Address" in the second column, which is
also 20 characters wide.
a. String.Format("{0, 20}{1, 20}", "Name", "Address")
b. String.Format("{ 20}{ 20}", "Name", "Address")
c. String.Format(20, 20, "Name", "Address")
d. String.Format(20, 40, "Name", "Address")

CS2453 - Exam 3 Review Page 3 of 14 - ANS A


8. To left justify the columns in the String.Format method you would use
preceding the numbers for the column width.
a. a + sign
b. an & symbol
c. a - sign

Written for

Institution
VISUAL BASIC
Course
VISUAL BASIC

Document information

Uploaded on
May 12, 2025
Number of pages
28
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$13.99
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
TheStar Florida State University
View profile
Follow You need to be logged in order to follow users or courses
Sold
699
Member since
2 year
Number of followers
178
Documents
26237
Last sold
18 hours ago
Stuvia Prodigy

Tested, Verified and Updated Study Materials with 100% Guaranteed Success.

3.8

136 reviews

5
60
4
25
3
27
2
5
1
19

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions