Computer Science > EXAM > Comp 230 Quiz Week 6 (GRADED A) Questions and And Answer solutions | ALL CORRECT (All)
Comp 230 Quiz Week 6 1. Question : (TCO 6) What WSH object is used for VBScript File I/O? Student Answer: Scripting.FileSystemObject FileSystemObject Scripting.FileSystem WScript.FileSystem... Object Instructor Explanation: Instructor Explanation: See Chapter 12, Doc Sharing files, and the Week 6 Lecture Points Received: 0 of 2 Comments: Question 2 Question : . (TCO 6) What file attribute value in VBScript indicates that the file is ReadOnly? Student Answer: 0 1 2 4 Instructor Explanation: Instructor Explanation: See Chapter 12, Doc Sharing files, and the Week 6 Lecture Points Received: 2 of 2 Comments: Question 3 Question : . (TCO 6) To move the file C:\Data\CustData.txt to C:\BackUp\CustData.txt in VBScript, use the following command (assuming fso is a Scripting.FileSystemObject) . Student Answer: fso.MoveFile(“C:\Data\CustData.txt”,”C:\BackUp\CustData.txt”) fso.MoveFile(”C:\BackUp\CustData.txt”, “C:\Data\CustData.txt”) fso.FileMove(“C:\Data\CustData.txt”,”C:\BackUp\CustData.txt”) fso.FileMove(”C:\BackUp\CustData.txt”, “C:\Data\CustData.txt”) Instructor Explanation: Instructor Explanation: See Chapter 12, Doc Sharing files, and the Week 6 Lecture Points Received: 2 of 2 Comments: Question 4 Question : . (TCO 6) To delete a file in VBScript, use the following command (assuming fso is a Scripting.FileSystemObject) . Student Answer: fso.FileDelete(Exists(“C:\Data\CustData.txt”) fso.DeleteFile(Exists(“C:\Data\CustData.txt”) fso.EraseFile(Exists(“C:\Data\CustData.txt”) fso.FileErase(Exists(“C:\Data\CustData.txt”) Instructor Explanation: Instructor Explanation: See Chapter 12, Doc Sharing files, and the Week 6 Lecture Points Received: 2 of 2 Comments: Question 5 Question : . (TCO 6) The following command opens a text file in VBScript. Set file = fso.OpenTextFile(“C:\Data\CustData.txt”, ?, ??, ???) To create a new file if it doesn’t exist, the value of ?? must be . Student Answer: the value of ?? must be 1 the value of ?? must be 2 the value of ?? must be false the value of ?? must be true Instructor Explanation: Instructor Explanation: See Chapter 12, Doc Sharing files, and the Week 6 Lecture Points Received: 2 of 2 Comments: Question 6 Question : . (TCO 6) The following command opens a text file in VBScript. Set file = fso.OpenTextFile(“C:\Data\CustData.txt”, ?, ??, ???) To open a file for writing, the value of ? must be . Student Answer: the value of ? must be 1 the value of ? must be 2 the value of ? must be true the value of ? must be false Instructor Explanation: Instructor Explanation: See Chapter 12, Doc Sharing files, and the Week 6 Lecture Points Received: 2 of 2 Comments: Question 7 Question : . (TCO 6) The following command opens a text file in VBScript. Set file = fso.OpenTextFile(“C:\Data\CustData.txt”, ?, ??, ???) To ensure that the file is formatted as ASCII instead of Unicode, the value of ??? must be . Student Answer: the value of ??? must be 0 the value of ??? must be -1 the value of ??? must be 2 the value of ??? must be -2 Instructor Instructor Explanation: See Chapter 12, Doc Sharing files, and the Week Explanation: 6 Lecture Points Received: 2 of 2 Comments: Question 8 Question : . (TCO 6) To complete the Read, Write, or Append operation in VBScript, use the following method (assuming fileObj is a file object created with CreateTextFile( ) or OpenTextFile) . Student Answer: fileObj.Exit fileObj.End fileObj.Next fileObj.Close Instructor Explanation: Instructor Explanation: See Chapter 12, Doc Sharing files, and the Week 6 Lecture Points Received: 2 of 2 Comments: Question 9 Question : . (TCO 6) To test to see if a directory (or folder) exists before you write data to it in VBScript, use the following command (assuming fso is a Scripting.FileSystemObject) . Student Answer: If fso.FolderCreated(folderName) Then If fso.FolderExists(folderName) Then If fso.FolderNotFound(folderName) Then If fso.FolderFound(folderName) Then Instructor Explanation: Instructor Explanation: See Chapter 12, Doc Sharing files, and the Week 6 Lecture Points Received: 2 of 2 Comments: Question 10 Question : . (TCO 6) To delete a folder in VBScript, use the following command (assuming fso is a Scripting.FileSystemObject) . Student Answer: fso.FolderDelete(folderName) fso.DeleteFolder(folderName) fso.EraseFolder(folderName ) fso.FolderErase(folderName) Instructor Explanation: Instructor Explanation: See Chapter 12, Doc Sharing files, and the Week 6 Lecture Points Received: 2 of 2 Comments: [Show More]
Last updated: 2 years ago
Preview 1 out of 5 pages
Buy this document to get the full access instantly
Instant Download Access after purchase
Buy NowInstant download
We Accept:
Can't find what you want? Try our AI powered Search
Connected school, study & course
About the document
Uploaded On
May 05, 2022
Number of pages
5
Written in
This document has been written for:
Uploaded
May 05, 2022
Downloads
0
Views
93
In Scholarfriends, a student can earn by offering help to other student. Students can help other students with materials by upploading their notes and earn money.
We're available through e-mail, Twitter, Facebook, and live chat.
FAQ
Questions? Leave a message!
Copyright © Scholarfriends · High quality services·