DVD Collection Organizer
A DVD collection organizer is a storage of information of DVDs you own. It allows you to keep track of your complete DVD list and gives you an easy way to access every information you need to know about your DVD. It helps you track where your DVDs are, where it came from, how much it costs, the date you bought it, the date it was released, the actors and actresses and the genre of the movie.
The creation of this DVD organizer is given as a Machine Problem for CS 11 students of the academic year 2009-2010, 2nd semester, handled by Sir Michael T. Echavez. It is an application of the concepts learned in CS 11 programming such as: ...view middle of the document...
int List(int num);
- A function that displays the complete list of DVDs by title.
- A function that deletes all DVD from File and from the list. It also resets the number of DVDs entered. It returns 1 for successfully reset DVD organizer and -1 if unsuccessful.
void sort(int num);
- A procedure that sorts DVDs by title.
int dateValid(char date);
- A functions that checks the validity of a date. The year could be any four digit number, except 0000. The month ranges from 1-12 . The day must really exist during the month – may be 28, 29, 30 & 31 (depending on the month).
int convertday(char num);
- A function that combines the one’s and ten’s digit entered in the day field into single integer.
int convertyear(char num);
- A function that combines 4 digit entered in the year field into a single integer.
int contains1(char temp, char orig);
- A function that checks if a string is a substring of the other, but before doing so, changes both strings to lowercase letters.
int cont(char temp, char orig);
- A function that similarly works like contains1, but unlike contains1 it changes both strings to capital letters.
void Tosmall(char * lower);
- A procedure that changes all capital letters in a string to small letters
void Tobig(char *upper);
- A procedure that changes all small letters in a string to capital letters
III. Summary of Algorithm used and Implementation
Soon as the user opens the program, he will be faced with options he can do with the DVD organizer. They are: A- add, S-search, V-view, T-view total, E-edit, D-delete, R-delete all and Q-exit. When one enters a letter that is not among the options, an invalid message is displayed and will go back to main menu. Every time it goes back to main, it clears the screen and opens the file NumOfDvds.bin to check the status of the total count of DVDs.
When one wishes to do something that is among the options, the program first checks the status of the variable ‘check’. As long as it has the value of one(1), the program will run. But if it encounters a problem, it returns a negative one(-1) or two (-2), the program will stop.
A. Add DVD
When one chooses to add a DVD, he will be asked to enter the title, genre, actors, actresses, date of release, date of acquisition, price, location and notes of the DVD. Every time, the user leaves a field blank, an invalid message that reminds the user that “all fields are required” is displayed.
Among the fields, only the dates check the validity of the user’s input. First, it checks the format and must follow YYYY-MM-DD. Then it checks if the year is valid and not equal to 0000. The month is then checked and must range from 1-12 only. And last the date must correspond to the number of...