(C Language)  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. Assume also the maximum number of characters of all file names is 100.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

(C Language) 

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. Assume also the maximum number of characters of all file names is 100.

ile ParkPhotos- Notepad
File Edit Format View Help
Acadia2003_photo.jpg
1
or American Samoa1989_photo.jpg
BlackCanyonoftheGunnison1983_photo.jpg
CarlsbadCaverns 2010_photo.jpg
Crater Lake1996_photo.jpg
Grand Canyon1996_photo.jpg
IndianaDunes1987_photo.jpg
LakeClark2009_photo.jpg
Redwood1980_photo.jpg
Virgin Islands 2007_photo.jpg
Voyageurs 2006_photo.jpg
WrangellstElias 1987_photo.jpg
Transcribed Image Text:ile ParkPhotos- Notepad File Edit Format View Help Acadia2003_photo.jpg 1 or American Samoa1989_photo.jpg BlackCanyonoftheGunnison1983_photo.jpg CarlsbadCaverns 2010_photo.jpg Crater Lake1996_photo.jpg Grand Canyon1996_photo.jpg IndianaDunes1987_photo.jpg LakeClark2009_photo.jpg Redwood1980_photo.jpg Virgin Islands 2007_photo.jpg Voyageurs 2006_photo.jpg WrangellstElias 1987_photo.jpg
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. Assume also the maximum number of characters of all file names is 100.
Ex: If the input of the program is:
ParkPhotos.txt
and the contents of ParkPhotos.txt are:
Acadia2003_photo.jpg
American Samoa1989_photo.jpg
BlackCanyonoftheGunnison1983_photo.jpg
CarlsbadCaverns2010_photo.jpg
CraterLake1996_photo.jpg
Grand Canyon1996_photo.jpg
IndianaDunes 1987_photo.jpg
LakeClark2009_photo.jpg
Redwood1980_photo.jpg
Virgin Islands 2007 photo.jpg
Voyageurs2006_photo.jpg
WrangellStElias 1987_photo.jpg
the output of the program is:
Acadia2003_info.txt
American Samoa1989_info.txt
BlackCanyonoftheGunnison1983_info.txt
CarlsbadCaverns2010_info.txt
CraterLake 1996_info.txt
Grand Canyon1996_info.txt
IndianaDunes1987_info.txt
Lake Clark2009_info.txt
Redwood1980_info.txt
Virgin Islands 2007_info.txt
Voyageurs2006_info.txt
WrangellStElias1987_info.txt
1 # include <stdio.h>
2 #include <string.h>
3
4
456789
int main(void) {
9}
10
/* Type your code here. */
return 0;
Transcribed Image Text: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. Assume also the maximum number of characters of all file names is 100. Ex: If the input of the program is: ParkPhotos.txt and the contents of ParkPhotos.txt are: Acadia2003_photo.jpg American Samoa1989_photo.jpg BlackCanyonoftheGunnison1983_photo.jpg CarlsbadCaverns2010_photo.jpg CraterLake1996_photo.jpg Grand Canyon1996_photo.jpg IndianaDunes 1987_photo.jpg LakeClark2009_photo.jpg Redwood1980_photo.jpg Virgin Islands 2007 photo.jpg Voyageurs2006_photo.jpg WrangellStElias 1987_photo.jpg the output of the program is: Acadia2003_info.txt American Samoa1989_info.txt BlackCanyonoftheGunnison1983_info.txt CarlsbadCaverns2010_info.txt CraterLake 1996_info.txt Grand Canyon1996_info.txt IndianaDunes1987_info.txt Lake Clark2009_info.txt Redwood1980_info.txt Virgin Islands 2007_info.txt Voyageurs2006_info.txt WrangellStElias1987_info.txt 1 # include <stdio.h> 2 #include <string.h> 3 4 456789 int main(void) { 9} 10 /* Type your code here. */ return 0;
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY