Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Goals for This Project: More about class and OOP Using pointers and dynamic memory; focusing on dynamic arrays. Using memory leak detection tool Problem You

Goals for This Project:

More about class and OOP Using pointers and dynamic memory; focusing on dynamic arrays. Using memory leak detection tool

Problem You Need to Solve for This Project (Same as Project 2)

You are asked to write an app to keep track of a relatively small music library. The app should load song information from a data file once the app is started. It should allow user to view, add, remove, and search for songs. The app should save the data back to the same data file when the program exits.

What Your Program Should Do (Same as Project 2) Write an interactive text based menu interface (using a loop) that will allow the user to

Enter information for a new song Display information for all the songs in the database with index for each song Remove a song by index Search for songs by a certain artist Search for songs by a certain album Quit

For each song, you need to keep track of: title artist duration album Allow the program to keep looping until user wants to quit. When the program starts, it should load the tasks from external file ("songs.txt") into memory. When user enters information about the new song, the program needs to read them in, save them in memory and eventually write them to the external data file ("songs.txt"). The file format could look like:

Stereo Hearts;Gym Class Heroes;3;34;The Papercut Chronicles II Counting Stars;OneRepulic;4;17;Native

The ';' is used as a delimiter or field separator. Each record ends with a new line character. Also the above sample data came from my teen son, not a reflection of your instructors music taste

Some Implementation Requirements: (Different from Project 2!!!)

1. Use structs or class named Song to model song. You really should think about changing the struct to class if you have not done so in Lab 2. 2. Use class named SongList to model the collection of songs. 3. Use dynamic array of Song to implement SongList. 4. Use dynamic character array to model the strings in Song, such as title and artist. The character array should be the exact size as needed, e.g "CS162" should use a character array of size 6 including '\0'. 5. Use destructor to deallocate the dynamic memory for the object. 6. Make sure your program is "memory-leak-free" by using valgrind

valgrind --tool=memcheck --leak-check=full executable- file

7. When using class, please make sure you encapsulate the data which means make all the instance data member private and provide accessor methods and mutator methods to access and manipulate the data. 8. For submission, your data file should contain a sufficient set of test data. It should have test cases for same artist with multiple songs and same album with multiple songs in it. ou are required to have

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

Select Healthcare Classification Systems And Databases

Authors: Katherine S. Rowell, Ann Cutrell

1st Edition

0615909760, 978-0615909769

More Books

Students also viewed these Databases questions

Question

what are the provisions in the absence of Partnership Deed?

Answered: 1 week ago

Question

1. What is called precipitation?

Answered: 1 week ago

Question

1.what is dew ?

Answered: 1 week ago