Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

12.9 LAB: File name change A photographer is organizing a photo collection about the national parks in the US and would like to annotate the

image text in transcribed
image text in transcribed
12.9 LAB: File name change 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: Acadi a2003 photo. jpg Americansapoal 1989 photo. Jpg BlackCanyonoftheGunnison 1983 photo. Jpg CarlabadCaverna2010 photo.jpg Craterlake 1996 photo. 1pg GrandCanyon1996 photo +jpg Indianabunen 1987 photo.jpg Lakeclark2009 photo.jpg Redvood 980 nhoto. Jpg Virginidlands2007 pheto. JPQ Voyageura2006 photo. Ipg Yranged15tEliag1987 photo. Ipg the output of the program is: Acadia2003_info.txt Americansamoal989_info.txt BlackCanyonoftheGunnison1983_info.txt CarlsbadCaverns2010_info.txt CraterLake1996_info.txt GrandCanyon1996_info.txt IndianaDunes1987_info.txt LakeClark2009_info.txt Redwoodi980_info.txt Virginislands2007_info.txt Voyageurs2006_info.txt Wrangellstelias1987_info.txt Load defaut tomplate

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Heikki Topi, Jeffrey A Hoffer, Ramesh Venkataraman

13th Edition

0134773659, 978-0134773650

More Books

Students also viewed these Databases questions