Question: you must use file tsupod_memory.dat Objective: Learn how to use objects, data storage in binary format, sorting. Specifications: General design: The code must be designed
you must use file tsupod_memory.dat
Objective: Learn how to use objects, data storage in binary format, sorting. Specifications:
General design: The code must be designed to allow the storage of the following data:
up to 25 songs not to exceed 100MB
for each song we will store the title (char[256]), artist (char[256]), and size (int) in MB.
the title and artist cannot be blank the size of each song must be greater than zero
when you remove a song other than the last song shift all remaining songs up so there is no empty space in between songs.
when you print your song list, you should have no "empty" slots Code design: You are going to have five files: Song.cpp, Song.h, tsuPod.h, tsuPod.cpp, test_tsuPod.cpp in your project.
the number of MB of memory should be set when the tsuPod is "constructed"
o Your tsuPod class constructor must be design in a way to accept maximum memory size and maximum number of songs that can be stored in tsuPod.
o When you create your tsuPod object in the test_tsuPod.cpp file set the maximum memory size to up to 100MB and maximum allowed number of songs to up to 25.
o Please note that you are not allowed to use an array of Song objects to implement tsuPod memory portion - you must use file tsupod_memory.dat to stYou should work with file tsupod_memory.dat using binary mode with file open for input/output and using advanced file operation instructions as discussed in slides in class, e.g., read, write, seekg, seekp, etc. create classes for TsuPod and Song with appropriate header files each class with have it corresponding specification portion (*.h) and the implementation portion (*.cpp). Specification portion contains class declaration with function prototypes and the implementation portion contains function definitions implement methods in the TsuPod class to: o addSong(Song s) o removeSong(Song s) o shuffle() o clearSongList() o showSongList() o sortSongList() o getTotalMemory() o getRemainingMemory() implement methods in the Song class to: o set and get all instance variables inside of the Song class o overload ==, <,and > operators (used in sorting) o for < and > use title, then artist, then size Testing (very similar to the previous tsuPod project): Create file test_tsuPod.cpp where you are going to test the functionality of the tsuPod program Following storage functionalities have to be tested to receive full grade:
o Initialization with storage size of X MB, and Y maximum songs.
o Successful song addition o Unsuccessful song addition any sort of failure (one case is enough)
o Successful song removal
o Unsuccessful song removal any sort of failure (one case is enough)
o Clearing of the song list
o Showing song list
o Sorting song list (songs should be sorted by title first alphabetical, then artist alphabetical, then size)
o Showing total memory
o Showing remaining memory
o Shuffle functionality In your test_tsuPod.cpp explain you what exactly you are testing with each block of code.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
