Question
Which of the following loops would you use to read all of the items from the file associated with myPile?a. While eof (mypile) Read myrile item End Whileb. While NOT eof (myFile) Read myFile item End While
Step 1
The function "eof" returns true if we have reached the end of the file. So, we need to loop until we have NOT reached the end of the file. Show more…
Show all steps
Your feedback will help us improve your experience
Foster Wisusik and 73 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Which of the following commands can be used to read the entire contents of a file as a string using the file object tmpfile? a. tmpfile.read b. tmpfile.readlines c. tmpfile.readline() d. tmpfile.read()
Which class allows you to use the Read( ) and ReadLine( ) methods to retrieve data from a text file? a. TextReader b. FileReader c. BinaryReader d. StreamReader e. File
What method in the StreamReader class retrieves a full line of text—up until the newline character is encountered? a. Flush( ) b. ReadBlock( ) c. Retrieve( ) d. ReadLine( ) e. Peek( )
Transcript
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD