You started working for a talent agency.  Your supervisor gave you a job to rename 50 files saved in a photographer's folder and the filenames start with dsc001.jpg thru dsc050.jpg.  The photographer used a list on a printout of the firstnames of the talents in alphabetical order and he said the JPEG files are numbered by the alphabetical order that the talents were called for the photos. You were given a file of all the talents that were in the photoshoot (also 50 names).  The names are not in alphabetical order. It is easy to rename files by typing this command as an example:  ren dsc001.jpg Adam.jpg Manually doing so is prone to mistakes and your supervisor does not want to show the wrong picture in the web site. Because you just finished learning C++ programming, you are confident to write a new program that will do the following: 1.  Read the names.txt file and save each name in string array. 2.  Sort the array in alphabetical order. Choose a sorting algorithm that you have learned in class.  You can use either the bubble sort or the selection sort.  Remember that you need a swap function for sorting.   3.  After the string array is sorted, use cout to send an output to the console of the rename command for each file. Example:  If Jenny is the 7th talent in the list, the output should be "ren dsc007.jpg Jenny.jpg" here is the textfile  name.txt

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

You started working for a talent agency.  Your supervisor gave you a job to rename 50 files saved in a photographer's folder and the filenames start with dsc001.jpg thru dsc050.jpg.  The photographer used a list on a printout of the firstnames of the talents in alphabetical order and he said the JPEG files are numbered by the alphabetical order that the talents were called for the photos.

You were given a file of all the talents that were in the photoshoot (also 50 names).  The names are not in alphabetical order.

It is easy to rename files by typing this command as an example:  ren dsc001.jpg Adam.jpg
Manually doing so is prone to mistakes and your supervisor does not want to show the wrong picture in the web site.

Because you just finished learning C++ programming, you are confident to write a new program that will do the following:

1.  Read the names.txt file and save each name in string array.
2.  Sort the array in alphabetical order. Choose a sorting algorithm that you have learned in class.  You can use either the bubble sort or the selection sort.  Remember that you need a swap function for sorting.  
3.  After the string array is sorted, use cout to send an output to the console of the rename command for each file.
Example:  If Jenny is the 7th talent in the list, the output should be "ren dsc007.jpg Jenny.jpg"

here is the textfile  name.txt

Marilou
Anna
Thelma
Benjamin
Cindy
Tommy
Dativo
Donald
Fatima
Faye
Zack
Colin
Eugenia
Shanade
Miyu
Sonia
Milen
Nancy
Marilen
Angela
Lourdes
Sylvia
James
Tyson
Carlito
Kouram
Chingyee
Contesta
Viet
Noah
Gabriel
Hutu
Conway
Courtney
Keanu
Rolly
Celina
Joseph
Everest
Contessa
Adam
Sade
Holly
Kurt
Robert
Michael
Eve
Steven
Transcribed Image Text:Marilou Anna Thelma Benjamin Cindy Tommy Dativo Donald Fatima Faye Zack Colin Eugenia Shanade Miyu Sonia Milen Nancy Marilen Angela Lourdes Sylvia James Tyson Carlito Kouram Chingyee Contesta Viet Noah Gabriel Hutu Conway Courtney Keanu Rolly Celina Joseph Everest Contessa Adam Sade Holly Kurt Robert Michael Eve Steven
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Header Files
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education