MYPROGRAMMINGLAB WITH PEARSON ETEXT
MYPROGRAMMINGLAB WITH PEARSON ETEXT
8th Edition
ISBN: 9780134225340
Author: Deitel
Publisher: PEARSON
Question
Book Icon
Chapter 11, Problem 11.15E
Program Plan Intro

Program plan:

  • ichar, line,ifilename,ofilename, i, choice, and x are input variables
  • rfptr, wfptr are the file pointers to write the data.

Program description:

The main purpose of the program is to read and write the entered text line using file pointers either using the standard input and output or using the input and output file. The program first displays the menu to the user to select the choice which does not allow to enter invalid choice. It then uses the standard input and output or file names to get the data and display the data according to user choice with the help of file pointer.

Blurred answer
Students have asked these similar questions
DO NOT WRITE MAIN! Only write the function.  A 50% minimum deduction will be made if main is included.  No libraries or comments should be specified.  (OP4) Write a function to prompt the user for the filename, open the file, and verify that it opened. If the file does not open, an error message should be printed and the user re-prompted. The function should use the string passed in for the prompt string. The function should not return until the file is open. The function prototype: void openInputFile( ifstream &, string ); ifstream& - the stream to be opened. string - the prompt to be written out to the user.  Use this string when prompting the user.
(PYTHON) A photographer is organizing a photo collection about the national parks in the US and would like to annotate the information about each of the photos into a separate set of files. Write a program that reads the name of a text file containing a list of photo file names. The program then reads the photo file names from the text file, replaces the "_photo.jpg" portion of the file names with "_info.txt", and outputs the modified file names. Assume the unchanged portion of the photo file names contains only letters and numbers, and the text file stores one photo file name per line. If the text file is empty, the program produces no output. Ex: If the input of the program is: ParkPhotos.txt and the contents of ParkPhotos.txt are: Acadia2003_photo.jpg AmericanSamoa1989_photo.jpg BlackCanyonoftheGunnison1983_photo.jpg CarlsbadCaverns2010_photo.jpg CraterLake1996_photo.jpg GrandCanyon1996_photo.jpg IndianaDunes1987_photo.jpg LakeClark2009_photo.jpg Redwood1980_photo.jpg…
Answer the given question with a proper explanation and step-by-step solution.  1- Write code that does the following: opens an output file with the filename number_list.txt, uses a loop to write the numbers 1 through 100 to the file, then closes the file.
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education