![]() |
|
#1
|
|||
|
|||
Totally confused on assigment using linked listsI am currently enrolled in a c++ course and have been given an assignment to complete a project that includes using a linked list. I do not know how to do this and I am having trouble contacting my instructor. It's an online course here are the direction for the assignment.
Graded Project 4: Catalog Your CD Collection Create a program that allows users to enter information about a music CD collection and save that information so it can be retrieved later. • Your program should have a menu system that allows you to enter information about a new CD, save the list to a file on your hard drive, load a list from the hard drive, or print your list to the screen. • Create a CD class to store information about the CDs. Store the CD Name, Artist Name, and Year Released. These should be private members. Use Class functions to modify the data • You should use dynamic data to store CDs. Store the information in an array and dynamically create a new CD entry every time the user wants to enter new CD information. • If the user wants to save the file, ask them what they want the name of the file to be and save the file to the hard drive. • If the user wants to load a file, ask them the name of the file they want to load from the hard drive and let them know if it doesn’t exist. • If the user selects to print the list, the system should print out a list of all the CDs in the collection. When you are finished: • Submit the .cpp source file, .exe file and code file to your instructor in a zipped folder. • Put your name in a comment at the top of the file, followed by the name of the program. Evaluation Criteria 1. The program compiles/builds successfully, runs normally (no runtime errors or unnecessary delays), and exits normally. 2. The program uses a menu with the following choices: enter information about a new CD, save the list to a file on the hard drive, load a list from the hard drive, or print the list to the screen. 3. The program goes into Enter New Data mode at the user’s command. It performs the following Jobs (in the order that they are given) and then goes to the main menu. Job A. display the following text on the screen: CD Name: Job B. receive input Job C. display the following text on the screen: Artist Name: Job D. receive input Job E. display the following text on the screen: Year Released: Job F. receive input 4. The program goes into Save to File mode at the user’s command. It performs the following Jobs (in the order that they are given) and then goes to the main menu. Job G. ask the user to enter a name for the new file Job H. receive input Job I. place a new file on the hard drive Job J. use the information from Job H to name the file Job K. write the entire CD list to the file Job L. close the file 5. The program goes into Load From File mode at the user’s command. Before it can load a file, it must first go into Attempt to Open File mode. If the attempt is not successful, the program informs the user that the file does not exist and goes to the main menu. If the attempt is successful, the program goes to the main menu after performing the following Jobs (in the order that they are given): Job P. input the entire CD list from the file Job Q. close the file 6. The program goes into Attempt to Open File mode from Load From File mode. It performs the following Jobs (in the order that they are given) and then returns to Load From File mode. Job M. ask the user to enter the name of the file Job N. receive input Job O. try to open a file for reading, using the information from Job N 7. The program goes into Print the List mode at the user’s command. It performs the following Jobs (in the order that they are given) for each CD and then goes to the main menu. Job R. on a separate line, display “CD Name: ”, followed by the current CD’s Job B information Job S. on a separate line, display “Artist Name: ”, followed by the current CD’s Job D information Job T. on a separate line, display “Year Released: ”, followed by the current CD’s Job F information Job U. separate this CD’s information from the next CD’s information (to assist the user/reader) by displaying a blank line or by other means 8. The program uses a CD class to store information about each CD. The class stores the CD Name, Artist Name, and Year Released in private members. Class functions are used to modify the data. 9. The program dynamically creates a new CD entry every time keyboard/file input is received for a new CD 10. The program is easy to use. 11. The program does not perform unnecessary tasks. 12. The source code is contained in one file and is not unnecessarily long. 13. The source code utilizes whitespace properly and consistently to enhance legibility. 14. The variable/function/struct/class/object names are chosen and typed/written in a way that clearly explains their purposes. The naming style is consistent throughout the whole program. 15. The source contains effective, consistent comments, especially near any complex or obscure sections of code. This contains all the information to put it together but I'm stumped on how to create a linked list for this program. Help and examples are appreciated. |
|
#2
|
|||
|
|||
Re: Totally confused on assigment using linked listsAh!, the "self-referential structure" , as K&R prefers to call them .
I know that there are several excellent threads on "linked lists" on the C forum, probably here on c++ too. Use the search at top of either forum's listings. There are many different ways of implementing a linked list. It is a series of dynamically allocated structure objects in which each "knows" (contains) the address('s) that the next (or previous, or both) is stored. You start with one, allocate new ones as needed, and search up or down the "chain" to use. Start by playing with a small practice example. Then decide how to implement in your assignment. Loads of fun. |
|
#3
|
|||
|
|||
Re: Totally confused on assigment using linked listsQuote:
I didn't see in the requirements a specific requirement to use a linked list. Are you sure that that is a hard requirement? An STL collection sounds like a much simpler choice. :davis: |
Recent GIDBlog
Toyota - 2008 July Promotion by Nihal
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| triangle (polygon), drawing, sizing, and rotation programme using linked lists... | promsan | C Programming Language | 12 | 14-May-2007 14:03 |
| Doubly linked lists in C++ | sweeeeeeetlipss | CPP / C++ Forum | 1 | 23-Oct-2006 23:27 |
| Linked Lists | DCOM | C Programming Language | 4 | 27-Mar-2005 00:00 |
| help on linked lists any1????? | nick4 | C Programming Language | 1 | 17-May-2004 09:32 |
| linked lists, newbie needs help | moltarim | C Programming Language | 4 | 06-May-2004 11:32 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The