Programming with Microsoft Visual Basic 2017
8th Edition
ISBN: 9781337102124
Author: Diane Zak
Publisher: Cengage Learning
expand_more
expand_more
format_list_bulleted
Concept explainers
Textbook Question
Chapter 9, Problem 1RQ
Which of the following opens the employ.txt file and allows the computer to write new data to the end of the file’s existing data?
- a. outFile = I0.File.AddText("employ.txt")
- b. outFile = I0.File.AppendText("employ.txt")
- c. outFile = I0.File.InsertText("employ.txt")
- d. outFile = I0.File.WriteText("employ.txt")
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Which of the following opens the employ.txt file and allows the computer to write new data to the end of the file’s existing data? a. outFile = IO.File.AddText("employ.txt") b. outFile = IO.File.AppendText("employ.txt") c. outFile = IO.File.InsertText("employ.txt") d. outFile = IO.File.WriteText("employ.txt")
Which of the following opens the cities.txt file and allows the computer to write new data to the end of the file’s existing data?a. outFile = IO.File.AddText("cities.txt")b. outFile = IO.File.AppendText("cities.txt")c. outFile = IO.File.InsertText("cities.txt")d. outFile = IO.File.OpenText("cities.txt")
Which of the following writes the contents of the strFirst and strLast variables on separate lines in the names.txt file? The file is associated with a StreamWriter object named outFile.a. StreamWriter.WriteLine(strFirst)StreamWriter.Write(strLast)b. outFile.WriteLine(strFirst)outFile.WriteLine(strLast)c. outFile.Write(strFirst)outFile.Write(strLast)d. outFile("names.txt").WriteLine(strFirst)outFile("names.txt").WriteLine(strLast)
Chapter 9 Solutions
Programming with Microsoft Visual Basic 2017
Ch. 9 - Which of the following opens the employ.txt file...Ch. 9 - If the file to be opened exists, which method...Ch. 9 - Which of the following reads a line of text from a...Ch. 9 - What type of object is created by the OpenText...Ch. 9 - Prob. 7RQCh. 9 - The horizontal line in a menu is called _____.
a...Ch. 9 - Prob. 9RQCh. 9 - Prob. 10RQCh. 9 - Prob. 11RQCh. 9 - Prob. 3E
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Which of the following reads a line of text from a sequential access file and assigns the line (excluding the newline character) to the strText variable? inFile.Read(strText) inFile.ReadLine(strText) strText = inFile.ReadLine strText = inFile.Read(line)arrow_forward. Which of the following options can be used to read the first line of a text file "Myfile.txt"? a. myfile = open('Myfile.txt'); print(myfile.read(line)) b. myfile = open('Myfile.txt','r'); print(myfile.read(1)) c. myfile = open('Myfile.txt'); print(myfile.readline()) d. myfile = open('Myfile.txt'); print(myfile.readlines())arrow_forwardWhich of the following is a correct opening of a file for appending new content to the file? Lütfen birini seçin: a. file = open("a", "data.txt") b. file = open("data.txt", "a") c. file = open("data.txt", "w") d. with open("a", "data.txt") with file: e. file = open("data.txt", "append") Seçimimi temizlearrow_forward
- A student wants to write into a file called myfile, without deleting its existing content. Which one of the following functions should he or she use? f = open('myfile', 'r') f = open('myfile', 'w+b') f = open('myfile', '+') f = open('myfile', 'a')arrow_forwardWhich of the following is a correct opening of a file for writing to the file? Lütfen birini seçin: a. open(data.txt, "w") b. file = open("data.txt", "write") c. file = open(data.txt, "w") d. file = open("data.txt", "w") e. file = open("data.txt", "r")arrow_forwardWhich of the following lines of code will not create a file “abc.txt”? Choose an answer A cat >abc.txt B touch abc.txt C >abc.txt D echo abc.txtarrow_forward
- Which PYTHON statement prints the last field in each row of the csv file? a. with open('my_file.csv', 'r') as f: csv_data = csv.reader(f) for r in csv_data: print(r[0:-1]) b. with open('my_file.csv', 'r') as f: csv_data = csv.reader(f[-1]) print(csv_data) c. with open('my_file.csv', 'r') as f: csv_data = csv.reader(f) print(csv_data [-1]) d. with open('my_file.csv', 'r') as f: csv_data = csv.reader(f) for r in csv_data: print(r[-1])arrow_forwardWhich of the following closes an input sequential access file named states.txt? The file is associated with a StreamReader variable named inFile.a. StreamReader(inFile).Close()b. StreamReader.Close(inFile) c. inFile.Close()d. Close(inFile)arrow_forwardWhich pattern will match all filenames containing a "b"? [!b]* *b* *b b*arrow_forward
- Which of the following reads a line of text from a sequential access file and assigns the line (excluding the newline character) to the strText variable? a. inFile.Read(strText) b. inFile.ReadLine(strText) c. strText = inFile.ReadLine d. strText = inFile.Read(line)arrow_forward1- Use the cat command to create a file. Name of this file should be file1. Type a few sentences inthis file. Save this file. Use the cat command one more time to display the content of file1.2- Use vi command to add more lines to this file so you can answer the rest of these questions thatuses regular expressions and grep command.3- Select the lines from file file1 that have exactly three characters in them.4- Select the lines from file file1 that have at least three characters in them.5- Select the lines from file file1 that have three or less characters in them.6- Select the non-blank lines from the file file1.7- Select the lines from file file1 that start with a capital letter.8- Select the lines from file file1 that end with a period.9- Select the lines from file file1 that have the string unix.10- Select the lines from file file1 that end with the string unix.11- Select the lines from file file1 that have only the string unix.12- Select the lines from file file1 that have the…arrow_forward3.Which of the following will read a string from a file with FILE* fpto char myString[81] properly (safely): fscanf(fp, "%s", myString ); fgets(myString, fp); fgets(fp, 81, myString); correct : fgets(myString, 81,fp) fscanf(fp,"%80s", myString); 4. If you issue the statement fpIn = fopen("myfile.dat", "a");and dat does not exist, the computer will: return NULLto fpIn as the file does not exist create the file in write mode, and position the file pointer at the beginning of the file create the file in write mode, close the file and return a warning open a file that most closely resembles the name 'myfile.dat'arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage LearningProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,
- New Perspectives on HTML5, CSS3, and JavaScriptComputer ScienceISBN:9781305503922Author:Patrick M. CareyPublisher:Cengage LearningCOMPREHENSIVE MICROSOFT OFFICE 365 EXCEComputer ScienceISBN:9780357392676Author:FREUND, StevenPublisher:CENGAGE L
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
New Perspectives on HTML5, CSS3, and JavaScript
Computer Science
ISBN:9781305503922
Author:Patrick M. Carey
Publisher:Cengage Learning
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:9780357392676
Author:FREUND, Steven
Publisher:CENGAGE L
Linux - Tutorial for Beginners in 13 MINUTES! [ UPDATED ]; Author: bai;https://www.youtube.com/watch?v=BMGixkvJ-6w;License: Standard YouTube License, CC-BY
What is Linux?; Author: Techquickie;https://www.youtube.com/watch?v=zA3vmx0GaO8;License: Standard YouTube License, CC-BY
Introduction to Linux and Basic Linux Commands for Beginners; Author: sakitech;https://www.youtube.com/watch?v=IVquJh3DXUA;License: Standard Youtube License