he subsequent processing, “no author listed” should not be rearranged. Here is a very abbreviated list of the titles and authors 1. Adagio “MoonLight” Sonata - Ludwig Van Beethoven 2. An Alexis - F.H. Hummel and J.N. Hummel 3. A La Bien Aimee - Ben Schutt 4. At Sunset - E. MacDowell

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

There is a CD available for purchase that contains .jpeg and .gif images of music that is in the public domain. The CD includes a file consisting of lines containing the names, then composers of that title, one per line. The name of the piece is first, then zero or more spaces then a dash (-) character,then one or more spaces, then the composer’s name. The composer name maybe only the last name, an initial and one name, two names (first and last), or three names (first, middle, and last). There are a few tunes with “no author listed” as author. In the subsequent processing, “no author listed” should not be rearranged. Here is a very abbreviated list of the titles and authors

1. Adagio “MoonLight” Sonata - Ludwig Van Beethoven
2. An Alexis - F.H. Hummel and J.N. Hummel
3. A La Bien Aimee - Ben Schutt
4. At Sunset - E. MacDowell
5. Angelus - J. Massenet
6. Anitra’s Dance - Edward Grieg
7. Ase’s Death - Edward Grieg
8. Au Matin- Benj. - Godard

The ultimate task is to produce an alphabetized list of composers followed by a list
of pieces by them alphabetized on the title within composer. This exercise is easier
if it is broken into pieces:

Write code to do the following:
a. Remove the lead numbers, any periods, and any spaces so that the first word of
the title is the first word of the line.
b. Replace any multiple spaces with a single space.
c. A few titles may have several - characters, for example,
20. Ba- Be- Bi- Bo- Bu - no author listed
Replace all dash - characters on any line before the end of the line by a space except
the last one.
d. The last word in the title may have the - character with no space between it and
the = character. Put the space in.
e. When alphabetizing the title, you do not want to consider an initial “A”, “An”,
or “The” in the title. Write code to move such initial words to just before the
- character. A comma after the last word in the title is not required, but that
would be a nice touch. This can be done after the composers’ names are moved
to the front, but obviously the code will be different.
f. Move the composers’ names to the beginning of the line, followed by the character, followed by the composition title.
g. Move any first initial, or first and second names of the composer to after the
composer’s last name. If the composer is “no author listed” this should not be
rearranged, so test for this combination.
h. Alphabetize by composer using any sort routine you know. You may ignore any
duplicate composer’s last name, such as CPE Bach and JS Bach, but sorting
by composer’s second name would be a nice touch. You may use the insertion
sort, or selection sort, or bubble sort, or other sorting algorithm.
i. If you have not already done so, move “A”, “An”, or “The” that may begin a
title to the end of the title. Then alphabetize within each composer by composition title. 

**LANGUAGE C++***

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Random Class and its operations
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.
Similar questions
  • SEE MORE QUESTIONS
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