Starting Out with Programming Logic and Design (4th Edition)
Starting Out with Programming Logic and Design (4th Edition)
4th Edition
ISBN: 9780133985078
Author: Tony Gaddis
Publisher: PEARSON
bartleby

Videos

Textbook Question
Book Icon
Chapter 10.2, Problem 10.19CP

Which of the following loops would you use to read all of the items from the file associated with myFile?

  1. a. While eof(myFile )

    Read myFile item

    End While

  2. b. While NOT eof(myFile)

    Read myFile item

    End While

Blurred answer
Students have asked these similar questions
Complete the program by filling in the code to read the file (goog.csv) and print the date and first price from each line. Compute the high and low price from the file and save the dates for the high and low price. Print them at the end.   HINT: Remember to open the file and check if that open command succeseded using the fail() method. When reading lines from a file, it makes sense to read all parts in the while condition.     infile.open(filename); while(infile >> name >> value >> theRest) {    // Process input } infile.close();       If the program files to open the file: Enter the name of the file to be analyzed:amzn.csvFile amzn.csv cannot be opened. code: #include <iostream>#include <limits>#include <fstream> using namespace std; //Todo: declare your functions here.int main(){ifstream infile;char fileName[256];cout <<"Enter the name of the file to be analyzed:";cin >> fileName; // TODO: Open the filename and test that it was…
Allow the user the choice of displaying either a random line or a random word from a file they specify. Your menu should allow them to choose these options either from the number of the option or from the capitalized letter. For example, 1) display random Word 2) display random Line 3) Quit Should allow the user to select a random line display by either entering the number 2 or by entering a letter L (lower or upper case!).
# Write your code below each prompt# Create a function called ex2() which:# 1. Prompts the user for their name# 2. Writes the text entry to the file tmp1.txt# 3. Reads the value from the file# 4. Print the value read from the file# 5. Invoke ex2() to print results

Chapter 10 Solutions

Starting Out with Programming Logic and Design (4th Edition)

Ch. 10.1 - Prob. 10.11CPCh. 10.1 - Prob. 10.12CPCh. 10.1 - What is a files read position? Initially, where is...Ch. 10.1 - In what mode do you open a file if you want to...Ch. 10.2 - Prob. 10.15CPCh. 10.2 - What is the purpose of the eof function?Ch. 10.2 - Is it acceptable for a program to attempt to read...Ch. 10.2 - Prob. 10.18CPCh. 10.2 - Which of the following loops would you use to read...Ch. 10.4 - Prob. 10.20CPCh. 10.4 - Prob. 10.21CPCh. 10.4 - Prob. 10.22CPCh. 10 - A file that data is written to is known as a(n) a....Ch. 10 - A file that data is read from is known as a(n) a....Ch. 10 - Before a file can be used by a program, it must be...Ch. 10 - When a program is finished using a file, it should...Ch. 10 - The contents of this type of file can be viewed in...Ch. 10 - This type of file contains data that has not been...Ch. 10 - When working with this type of file, you access...Ch. 10 - When working with this type of file, you can jump...Ch. 10 - This is a small holding section in memory that...Ch. 10 - Prob. 10MCCh. 10 - This is a character or set of characters that...Ch. 10 - This marks the location of the next item that will...Ch. 10 - When a file is opened in this mode, data will be...Ch. 10 - The expression NOT eof (myFi1e) is equivalent to...Ch. 10 - This is a single piece of data within a record. a....Ch. 10 - When working with a sequential access file, you...Ch. 10 - In most languages, when you open an output file...Ch. 10 - The process of opening a file is only necessary...Ch. 10 - Prob. 4TFCh. 10 - Prob. 5TFCh. 10 - When a file that already exists is opened in...Ch. 10 - In control break logic, the program performs some...Ch. 10 - Describe the three steps that must be taken when a...Ch. 10 - Why should a program close a file when its...Ch. 10 - What is a files read position? Where is the read...Ch. 10 - If an existing file is opened in append mode, what...Ch. 10 - In most languages, if a file does not exist and a...Ch. 10 - What is the purpose of the eof function that was...Ch. 10 - What is control break logic?Ch. 10 - Design a program that opens an output file with...Ch. 10 - Design a program that opens the my_name.dat file...Ch. 10 - Prob. 3AWCh. 10 - Design an algorithm that does the following: opens...Ch. 10 - Modify the algorithm that you designed in question...Ch. 10 - Write pseudocode that opens an output file with...Ch. 10 - Prob. 7AWCh. 10 - A file exists on the disk named students.dat. The...Ch. 10 - Why doesn't the following pseudocode module work...Ch. 10 - File Display Assume that a file containing a...Ch. 10 - Item Counter Assume that a file containing a...Ch. 10 - Sum of Numbers Assume that a file containing a...Ch. 10 - Average of Numbers Assume that a file containing a...Ch. 10 - Largest Number Assume that a file containing a...Ch. 10 - Golf Scores The Springfork Amateur Golf Club has a...Ch. 10 - Sales Report Brewster's Used Cars, Inc. employs...

Additional Engineering Textbook Solutions

Find more solutions based on key concepts
Knowledge Booster
Background pattern image
Computer Science
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
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:9780357392676
Author:FREUND, Steven
Publisher:CENGAGE L
C - File I/O; Author: Tutorials Point (India) Ltd.;https://www.youtube.com/watch?v=cEfuwpbGi1k;License: Standard YouTube License, CC-BY
file handling functions in c | fprintf, fscanf, fread, fwrite |; Author: Education 4u;https://www.youtube.com/watch?v=aqeXS1bJihA;License: Standard Youtube License