Answer the following questions:
1. Which of the following procedures can be used to read information from a sequential access file? ALL OF THEM?
- AppendText
- CreateText
- OpenText
2. Which of the following reads a line of text from the file associated with the inFile variable and assigns the line of text (excluding the newline character) to the msg variable? MY ANSWER: msg = inFile.ReadLine
- msg = inFile.Read
- msg = inFile.ReadLine
- inFile.ReadLine(msg)
3. Write the statement required to close the file associated with the inFile variable.
inFile.Close()
4. If a sequential access file contains another character to read, what does the Peek method return?
The Peek method returns the character
5. If a sequential access file does not contain another character to read, what does the Peek method return?
it will return the number -1 (negative 1)
No comments:
Post a Comment