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)
It seems like youve provided the instructions and template for a Java program that needs to read a l... 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
-
Three wires sit at the corners of a square, all carrying currents of 2 amps into the page as shown in Figure 12.8. Calculate the magnitude of the magnetic field at the other corner of the square,...
-
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?
-
Would you hypothesize that unit pricing would be an effective strategy for decreasing the amount of land filled garbage in poor countries? Explain the reasoning behind your hypothesis, and what you...
-
The following data were extracted from the accounting records of Sacajawea Mercantile Co. for the year ended June 30, 20Y4: a. Journalize the June 30, 20Y4, adjusting entry for estimated sales...
-
Ivan's Diner received the following bills for December 2018 utilities: - Electricity: \(\$ 850\) on December 29, 2018 - Telephone: \(\$ 475\) on January 5, 2019 Both bills were paid on January 10,...
-
Examine the systems given below. Which system is more reliable, a or b? c or d? Now calculate the reliability of each system. Were your perceptions correct? If it costs $1000 for each 90% reliable...
-
McKenzie Corporations Capital Budgeting Sam McKenzie is the founder and CEO of McKenzie Restaurants, Inc., a regional company. Sam is considering opening several new restaurants. Sally Thornton, the...
-
Imagine that Creamy Ice is a large manufacturer of tasty ice cream and other frozen dessert products and has been in business for decades. Further imagine that the organization's manufacturing...
-
Information about our refrigerator: Model: 570504 MB Arelik Liquid cooler: R134-a Temperature inside: 4C 25C outside temperature Hours of operation: 24 hours A) The Process for Estimating COP i....
-
The City of Coyote mailed property tax bills for 2011 to its citizens during August 2010. Payments could be made early to receive a discount. The levy becomes legally enforceable on February 15,...
-
If a company increases its selling price per unit for Product \(A\), then the new breakeven point will a. Increase b. Decrease c. Remain the same
-
If Telluride Railway's fixed costs total \(\$ 50,000\) per month, the variable cost per passenger is \(\$ 36\), and tickets sell for \(\$ 60\), how much revenue must the Railway have to earn \(\$...
-
Suppose Telluride Railway's total revenues are \(\$ 3\) million, its variable costs are \(\$ 1.8\) million, and its fixed costs are \(\mathrm{S} 0.6\) million. Compute the breakeven point in dollars....
-
On December 30, 2010, the City of Coyote borrowed \($20,000\) for the General Fund on a 60-day note. In that fund, both Cash and Other Financing Sources were recorded. In the general information, a...
-
- Cost Management Example: Brightmore Corporation manufactures three styles of lighting fixtures using five sequential operations. Within each operation, regardless of the style of fixture produced,...
-
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...
-
What are the components of the long-term liability of the balance sheet? (See pp. 480481.)
-
Bonds usually pay interest a. only at the due date of the bond. b. monthly. c. either annually or semiannually. d. at the time of issuance.
-
The account Discount on Bonds Payable should be considered what type of account? a. current liability b. asset c. deferred revenue d. contra-liability
Study smarter with the SolutionInn App