Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I am trying to write this program in c++ and would love any help regarding this program. The following program will have the following files

I am trying to write this program in c++ and would love any help regarding this program. The following program will have the following files and info. For this program I am trying to create a CD Collection. The CD list is stored in memory using several structs with the ability to search by a particular artist and find their CDs and to sort the list based on the album title. The collection of CDs is read in from a file size could vary, so the code needs to be able to resize if necessary.

The program should create multiple files to allow the program to create individual CDs by parsing the text file supplied as a command line argument. The file containing the sample data is titled CD.txt and its format is described in detail below. I assume that the sample file and the file I will use follow the same formatting.

The files should include:

First,

* Song.h

* Song* createSong (string title, string length);

* void displaySong (Song* s);

* void destroySong (Song* s);

* Song.cpp

* Song.cpp will contain all of the code necessary to implement the functions that are prototyped in Song.h

Second Struct,

* CD.h

* CD* createCD (string artist, string title, int year, int rate, int numSongs);

* void displayCD (CD* c);

* void destroyCD (CD* c);

* void addSong (CD* cd, string title, string length);

* CD.cpp

Third,

*CDs.h

CDs.h will include an include guard, a struct named, appropriately enough, CDs and the functional prototypes required to create, display and destroy CDs.

* CDs are made up of the following information:

* An array of individual CD (CD** cdArray)

* The maximum size of the CD array

* The current size of the CD array

* The functions that are necessary for this program are namely:

* CDs* createCDs (const char* filename);

* void displayCDs (CDs* c);

* void destroyCDs (CDs* c);

* CDs* findCDs (CDs* cds, string artist);

* CDs* sortCDs (CDs* cds);

* findCDs will search the CDs struct for albums for the artist the user has asked for. It will return a pointer to a new CDs struct containing all of the individual CD structs by that artist

* CDs.cpp (CDs.cpp will contain all of the code necessary to implement the functions that are prototyped in CDs.h)

Lastly,

* CDDriver.cpp

* Your CDDriver should control all interaction with the user and call the functions in CDs.cpp to return the desired results. It should not call any functions in CD.cpp or Song.cpp directly.

Sample Output:

C:\CSC1300\Program4> CDDriver.exe CDs.txt Welcome to the CD's Enter your selection below : 1. Find the CDs by an artist 2. Sort the CD listing 3. Exit Enter your choice: 1

-------------------------------------------------------------------------------------------------------------------------------------------------

Sample Output

Enter an artist to obtain their CDs in the collection: Insomnium Artist: Insomnium Title: Across the Dark Year: 2009 Rating: 10 1 Equivalence 3:18 2 Down With The Sun 4:23 3 Where The Last Wave Broke 5:03 4 The Harrowing Years 6:39 5 Against The Stream 6:11 6 The Lay Of Autumn 9:08 7 Into The Woods 5:08 8 Weighted Down With Sorrow 5:51 9 The New Beginning 7:15

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

Database Processing

Authors: David M. Kroenke, David Auer

11th Edition

B003Y7CIBU, 978-0132302678

More Books

Students also viewed these Databases questions

Question

What is wrong with this statement? H0 : r = 0.

Answered: 1 week ago

Question

What is the Definition for Third Normal Form?

Answered: 1 week ago

Question

Provide two examples of a One-To-Many relationship.

Answered: 1 week ago