tsuPod
CS 2308
Test Plan Due: Wednesday 2/25/15 at the beginning of class (hard copy). (20 points)
Completed Program Due: Friday 2/27/15 at 10:00pm. (80 points)
Total: 100 points
For this
program we will be implementing the storage portion of the tsuPod
(pronounced "su Pod" - the much smaller version of the iPod). We will
be storing the following information:
- Up to 8 songs not to exceed 25MB
- For each song we will store the title (string), artist (string), and size (int) in MB
- the title and artist cannot be blank
- the size must be greater than zero
Funtionality
(You will be graded on the following functions and the test plan)
the header file that you will use
NOTE: The structure for holding the data will be global to the
tsuPod.cpp module. We will discuss the trades-off regarding this in
class.
const int NUM_SONGS = 8; //we will have 8 slots. some may be empty (signified with empty strings)
const int MEMORY_SIZE = 25; //size in MB
//Note: The data structure for this module is global to the tsuPod.cpp module, but hidden
//from the user of the module.
//We will see that this style is more similar to OOP and
//hides the implementation details from the user.
Song songs[NUM_SONGS]; //NUM_SONGS is defined in the tsuPod.cpp file
Things you should do:
- Use an array of structures
- Can be initialized with empty songs in advance.
- Use constants (global is fine) for the number of songs and the memory size in case we can afford more memory later.
- Create a function that returns the total amount of remaining memory (or used memory, up to you).
Test plan:
- Create a plan to test the above functionality.
- The test plan may include the code for a driver program and possibly an input file should you choose to use one (I would).
- You can come up with whatever format you want for that input file.
- Don't include any testing functionality in the functions listed above.
- The plan should test for all the various error conditions, e.g.
- too many songs
- using too much memory
- deleting a song that is there
- deleting a song that isn't there
- successfully adding a song
- etc.
Example Test Plan Items
Example Driver Program
NOTES:
- You may do this program as an individual or with one
partner.
- You may use whatever C++ programming environment (Eclipse, Visual
C++, Dev-C++, etc) you prefer to develop your program, but at the end you should test it works in the Linux environment by uploading it and running it in one of the servers (athena.cs.txstate.edu, zeus.cs.txstate.edu, hercules.cs.txstate.edu, eros.cs.txstate.edu).
- The
program must be modular, with significant work done by functions. Each
function should perform a single, well-defined task. When possible,
create re-usable functions. Do not write trivial functions such as a
function to read a single value from an input file.
- You must name your C++ source
files tsuPod_xxxxxx.cpp and tsuPodDriver_xxxxxx.cpp (or tsuPod_xxxxxx_yyyyyy.cpp and tsuPodDriver_xxxxxx_yyyyyy.cpp if you choose to use a partner) where xxxxxx (or yyyyyy) is your TXstate id number. Only one of the team members needs to submit the assignment.
Turn in: Hard copy of your test plan (at the beginning of the class, on Feb. 25th). If you choose to use a partner, only one copy needs to be handed in, showing both student names.
Upload: the source file(s) on TRACS, by Feb 27th, 10:00pm.
Be sure to follow the style standards for the course.
Updated 2/17/15