MIV Home - Looking Glass zy Section 8.7 - CS 172: Computer Science I zyBooks My...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
MIV Home - Looking Glass zy Section 8.7 - CS 172: Computer Science I zyBooks My library > CS 172: Computer Science I home > 8.7: LAB: File name change 8.7 LAB: File name change Instructor note: ParkPhotos.txt learn.zybooks.com There will be two Scanner objects in the program. One Scanner will be used to read file name from the keyboard (System.in). To read data from a file you need to create a FileInputStream object associated with the given file and another Scanner object for the FileInput- Stream object. Use a loop to read lines one by one from the file, replace the "photo.jpg" portion with "info.txt", and output the modified file names. and the contents of ParkPhotos.txt are: 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. Acadia2003_photo.jpg Homework Help - Q&A from Online Tutors - Course Hero 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: American Samoa1989_photo.jpg BlackCanyonoftheGunnison1983_photo.jpg What's the difference between a Premier Memb CarlsbadCaverns 2010_photo.jpg Crater Lake 1996_photo.jpg Grand Canyon 1996_photo.jpg . IndianaDunes1987 photo.jpg zyBooks catalog ? Help/FAQ Katie Ale my Home Looking Glass NM - ParkPhotos.txt =zyBooks My library > CS 172: Computer Science I home > 8.7: LAB: File name change zy Section 8.7 - CS 172: Computer Science I and the contents of ParkPhotos.txt are: Acadia2003_photo.jpg American Samoa1989_photo.jpg BlackCanyonoftheGunnison1983_photo.jpg CarlsbadCaverns 2010_photo.jpg CraterLake1996_photo.jpg Grand Canyon 1996_photo.jpg IndianaDunes1987_photo.jpg Lake Clark2009_photo.jpg Redwood1980_photo.jpg Virgin Islands 2007_photo.jpg Voyageurs2006_photo.jpg WrangellStElias1987_photo.jpg the output of the program is: Acadia2003_info.txt American Samoa1989_info.txt BlackCanyonoftheGunnison1983_info.txt Carlsbad Caverns 2010_info.txt Crater Lake 1996_info.txt Grand Canyon 1996 info.txt IndianaDunes1987_info.txt Lake Clark2009_info.txt Redwood1980_info.txt VirgiIslands 2007_info.txt Voyageurs2006_info.txt WrangellStElias1987_info.txt 423062.2712980.qx3zqy7 LAB learn.zybooks.com 871 LAB File name change Homework Help - Q&A from Online Tutors - Course Hero What's the difference between a Premier Membership... EzyBooks catalog 0 + 88 0/10 ? Help/FAQ 8 Katie Aleman Y my NM Home - Looking Glass LAB ACTIVITY EzyBooks My library > CS 172: Computer Science I home > 8.7: LAB: File name change 8.7.1: LAB: File name change Downloadable files ParkPhotos.txt zy Section 8.7 - CS 172: Computer Science I 1 import java.util.Scanner; 2 import java.io.FileInputStream; 3 import java.io.IOException; 4 } Develop mode Download Run program 5 public class LabProgram { 6 public static void main(String[] args) throws IOException { 7 Scanner scnr = new Scanner(System.in); 8 9 * Type your code here. */ 10 11 } 12 learn.zybooks.com Submit mode Enter program input (optional) If your code requires input values, provide them here. Homework Help - Q&A from Online Tutors - Course Hero LabProgram.java Input (from above) LabProgram.java (Your program) zyBooks catalog What's the difference between a Premier Membersh Run your program as often as you'd like, before submitting for grading. Below, type any needed input values in the first box, then click Run program and observe the program's output in the second box. 0/10 Output (shown below) Load default template... ? Help/FAQ 8 Katie Alema + h MIV Home - Looking Glass zy Section 8.7 - CS 172: Computer Science I zyBooks My library > CS 172: Computer Science I home > 8.7: LAB: File name change 8.7 LAB: File name change Instructor note: ParkPhotos.txt learn.zybooks.com There will be two Scanner objects in the program. One Scanner will be used to read file name from the keyboard (System.in). To read data from a file you need to create a FileInputStream object associated with the given file and another Scanner object for the FileInput- Stream object. Use a loop to read lines one by one from the file, replace the "photo.jpg" portion with "info.txt", and output the modified file names. and the contents of ParkPhotos.txt are: 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. Acadia2003_photo.jpg Homework Help - Q&A from Online Tutors - Course Hero 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: American Samoa1989_photo.jpg BlackCanyonoftheGunnison1983_photo.jpg What's the difference between a Premier Memb CarlsbadCaverns 2010_photo.jpg Crater Lake 1996_photo.jpg Grand Canyon 1996_photo.jpg . IndianaDunes1987 photo.jpg zyBooks catalog ? Help/FAQ Katie Ale MIV Home - Looking Glass zy Section 8.7 - CS 172: Computer Science I zyBooks My library > CS 172: Computer Science I home > 8.7: LAB: File name change 8.7 LAB: File name change Instructor note: ParkPhotos.txt learn.zybooks.com There will be two Scanner objects in the program. One Scanner will be used to read file name from the keyboard (System.in). To read data from a file you need to create a FileInputStream object associated with the given file and another Scanner object for the FileInput- Stream object. Use a loop to read lines one by one from the file, replace the "photo.jpg" portion with "info.txt", and output the modified file names. and the contents of ParkPhotos.txt are: 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. Acadia2003_photo.jpg Homework Help - Q&A from Online Tutors - Course Hero 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: American Samoa1989_photo.jpg BlackCanyonoftheGunnison1983_photo.jpg What's the difference between a Premier Memb CarlsbadCaverns 2010_photo.jpg Crater Lake 1996_photo.jpg Grand Canyon 1996_photo.jpg . IndianaDunes1987 photo.jpg zyBooks catalog ? Help/FAQ Katie Ale my Home Looking Glass NM - ParkPhotos.txt =zyBooks My library > CS 172: Computer Science I home > 8.7: LAB: File name change zy Section 8.7 - CS 172: Computer Science I and the contents of ParkPhotos.txt are: Acadia2003_photo.jpg American Samoa1989_photo.jpg BlackCanyonoftheGunnison1983_photo.jpg CarlsbadCaverns 2010_photo.jpg CraterLake1996_photo.jpg Grand Canyon 1996_photo.jpg IndianaDunes1987_photo.jpg Lake Clark2009_photo.jpg Redwood1980_photo.jpg Virgin Islands 2007_photo.jpg Voyageurs2006_photo.jpg WrangellStElias1987_photo.jpg the output of the program is: Acadia2003_info.txt American Samoa1989_info.txt BlackCanyonoftheGunnison1983_info.txt Carlsbad Caverns 2010_info.txt Crater Lake 1996_info.txt Grand Canyon 1996 info.txt IndianaDunes1987_info.txt Lake Clark2009_info.txt Redwood1980_info.txt VirgiIslands 2007_info.txt Voyageurs2006_info.txt WrangellStElias1987_info.txt 423062.2712980.qx3zqy7 LAB learn.zybooks.com 871 LAB File name change Homework Help - Q&A from Online Tutors - Course Hero What's the difference between a Premier Membership... EzyBooks catalog 0 + 88 0/10 ? Help/FAQ 8 Katie Aleman Y my Home Looking Glass NM - ParkPhotos.txt =zyBooks My library > CS 172: Computer Science I home > 8.7: LAB: File name change zy Section 8.7 - CS 172: Computer Science I and the contents of ParkPhotos.txt are: Acadia2003_photo.jpg American Samoa1989_photo.jpg BlackCanyonoftheGunnison1983_photo.jpg CarlsbadCaverns 2010_photo.jpg CraterLake1996_photo.jpg Grand Canyon 1996_photo.jpg IndianaDunes1987_photo.jpg Lake Clark2009_photo.jpg Redwood1980_photo.jpg Virgin Islands 2007_photo.jpg Voyageurs2006_photo.jpg WrangellStElias1987_photo.jpg the output of the program is: Acadia2003_info.txt American Samoa1989_info.txt BlackCanyonoftheGunnison1983_info.txt Carlsbad Caverns 2010_info.txt Crater Lake 1996_info.txt Grand Canyon 1996 info.txt IndianaDunes1987_info.txt Lake Clark2009_info.txt Redwood1980_info.txt VirgiIslands 2007_info.txt Voyageurs2006_info.txt WrangellStElias1987_info.txt 423062.2712980.qx3zqy7 LAB learn.zybooks.com 871 LAB File name change Homework Help - Q&A from Online Tutors - Course Hero What's the difference between a Premier Membership... EzyBooks catalog 0 + 88 0/10 ? Help/FAQ 8 Katie Aleman Y my NM Home - Looking Glass LAB ACTIVITY EzyBooks My library > CS 172: Computer Science I home > 8.7: LAB: File name change 8.7.1: LAB: File name change Downloadable files ParkPhotos.txt zy Section 8.7 - CS 172: Computer Science I 1 import java.util.Scanner; 2 import java.io.FileInputStream; 3 import java.io.IOException; 4 } Develop mode Download Run program 5 public class LabProgram { 6 public static void main(String[] args) throws IOException { 7 Scanner scnr = new Scanner(System.in); 8 9 * Type your code here. */ 10 11 } 12 learn.zybooks.com Submit mode Enter program input (optional) If your code requires input values, provide them here. Homework Help - Q&A from Online Tutors - Course Hero LabProgram.java Input (from above) LabProgram.java (Your program) zyBooks catalog What's the difference between a Premier Membersh Run your program as often as you'd like, before submitting for grading. Below, type any needed input values in the first box, then click Run program and observe the program's output in the second box. 0/10 Output (shown below) Load default template... ? Help/FAQ 8 Katie Alema + h my NM Home - Looking Glass LAB ACTIVITY EzyBooks My library > CS 172: Computer Science I home > 8.7: LAB: File name change 8.7.1: LAB: File name change Downloadable files ParkPhotos.txt zy Section 8.7 - CS 172: Computer Science I 1 import java.util.Scanner; 2 import java.io.FileInputStream; 3 import java.io.IOException; 4 } Develop mode Download Run program 5 public class LabProgram { 6 public static void main(String[] args) throws IOException { 7 Scanner scnr = new Scanner(System.in); 8 9 * Type your code here. */ 10 11 } 12 learn.zybooks.com Submit mode Enter program input (optional) If your code requires input values, provide them here. Homework Help - Q&A from Online Tutors - Course Hero LabProgram.java Input (from above) LabProgram.java (Your program) zyBooks catalog What's the difference between a Premier Membersh Run your program as often as you'd like, before submitting for grading. Below, type any needed input values in the first box, then click Run program and observe the program's output in the second box. 0/10 Output (shown below) Load default template... ? Help/FAQ 8 Katie Alema + h
Expert Answer:
Answer rating: 100% (QA)
java import javaioFileInputStream import javaioIOException import javautil... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
Design a Java class that represents a cache with a fixed size. It should support operations like add, retrieve, and remove, and it should evict the least recently used item when it reaches capacity.
-
Let A, B be sets. Define: (a) the Cartesian product (A B) (b) the set of relations R between A and B (c) the identity relation A on the set A [3 marks] Suppose S, T are relations between A and B, and...
-
People who earn a higher salary can afford more goods, including health care. However, according to Grossman, they will choose a higher desired health stock. Why is this so, according to the model?
-
What information does the strength of a correlation coefficient convey?
-
A tank containing water is in the form of a cone with vertex C. The axis is vertical and the semi-vertical angle is 60, as shown in the diagram. At time t = 0, the tank is full and the depth of water...
-
Steven Sanchez worked as a warehouse employee for Gruma Corporation. In December 2016, Sanchez was presented an arbitration agreement during a meeting with George Tate, the human resources manager...
-
A company processes a chemical, DX-1, through a pressure treatment operation. The complete process has two outputs, L and T. The January costs to process DX-1 are $50,000 for materials and $100,000...
-
Suppose the consumer has a wage of $52.00 per week to spend on Goods A, B & C. The cost per unit of each of these goods is Good A: $1.00 per unit, Good B: $2.00 per unit, Good C: $4.00 per unit. Use...
-
Identify the costs and benefits that could shape the value of the e-book for the user/reader.
-
Compare and contrast predictive (waterfall) value delivery with Agile delivery. How does the organization benefit from each of these value delivery methods? Is it possible to deliver value in...
-
Check that 1 tan(x/2) = 1 + tan a 1 and sin(x/2)= sin x 1+ tan (1/2) holds for any x (-/2,/2)\{0}. Use these relations to write a program in Python computing the fifth first decimal of T with the...
-
Compare between American management vs Japanese management. seven paragraphs in own wording, Compare/contrast the management styles of American management Compare/contrast employee work attitudes...
-
How do sociological theories such as structural functionalism, conflict theory, and symbolic interactionism help us understand and analyze various social phenomena such as deviance, social...
-
2. During January 2024, the records of the company were inadequate. You were asked to prepare the summary of the preceding transactions. To develop a quick assessment of their economic effects on...
-
Consider the following first-order ODE: dy dt = y t 0.5t 2 from t = 2 to t = 5 with y(2) = 4 (i) Solve with Eulers method using h = 1 (ii) Solve with the classical fourth-order Runge-Kutta method...
-
Graph one period of each function. y = 4 cos x
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1-6. On December 12, Irene purchased the building where her store is located. She paid...
-
Ray and Maria Gomez have been married 3 years. They live at 1610 Quince Ave., McAllen, TX 78701. Ray works for Palm Oil Corporation and Maria works for the City of McAllen. Maria's Social Security...
-
Jason and Mary Wells, friends of yours, were married on December 30, 2012. They know you are studying taxes and have come to you with a question concerning their filing status. Jason and Mary would...
-
Describe an example of resistance to change that you have observed. Why did it occur?
-
Discuss: The best organizational structure to generate innovative ideas might not be the best structure to implement those ideas.
-
You have been charged with staffing and organizing an R&D group in a new high-tech firm. What will you do to ensure that the group is innovative?
Study smarter with the SolutionInn App