View the step-by-step solution to:

COMP3000: Assignment 5 Due : 12/04/2015 at 11:59 PM Points possible: 100 Note: You do not have to submit hard copies. Goals: To learn the concepts of...

Hey! I need help on my C++ programming homework. If someone could work it out so I can use it for reference It would really helped me out! Thanks!

1 COMP3000: Assignment 5 Due : 12/04/2015 at 11:59 PM Points possible: 100 Note: You do not have to submit hard copies. Goals: To learn the concepts of Linked list. Implement a linked list through classes. Description: You have to provide a user a menu to select the actions from. The options in the menu are actually the allowed operations on the linked list. Based upon the option selected by the user, you will need to prompt the user to provide additional required data and/or perform the operation on the linked list. A list node consists of a <int key, int value> pair and a pointer to the next node in the linked list. You can make the “key” a unique field, but it is not required. The operations are: 1) Add a node : user should be able to add a node to a linked list. Before adding a node to the linked list, it has to be initialized to some <key, value> pair. 2) Search a node : user should be able to search a specific node with its key. When user selects this option, your program should prompt for the “ key” to be searched for. Your program should search for that key in the linked list and if a node with this key exists in the linked list, your program should display the “value” . 3) Update a node: user should be able to update the value of a node. In this case, user will specify the “key” of a node whose “value” he/she wants to update, and the new “value” . Your program should search for a node with this key and update the value. 4) Delete a node: user should be able to delete a node from the linked list. In this case, user will specify the “key” of a node, which should be deleted. Your program should search and delete the node. 5) Display the linked list: user should be able to view the entire linked list. When this option is selected, your program should print all the “<key, value>” pairs in the linked list. 6) Exit the program: user should be able to quit the program. When this option is selected, your program should display some “Thank you Message!”, and quit.
Background image of page 1
2 Sample Output: 1. Add a node. 2. Search a node. 3. Update a node. 4. Delete a node. 5. Display linked list. 6. Exit. Enter the number of the option you want to perform: If user enters 1: Enter the key of node: 1 Enter the value of node : 50 The node <1,50> is successfully added in the list!! Press any key to continue: After user presses a key: 1. Add a node. 2. Search a node. 3. Update a node. 4. Delete a node. 5. Display linked list. 6. Exit. Enter the number of the option you want to perform: If use enters 2: Enter the key of node: 1 The value of the node is 50. Press any key to continue: After user presses a key: 1. Add a node. 2. Search a node. 3. Update a node. 4. Delete a node. 5. Display linked list. 6. Exit. Enter the number of the option you want to perform: If user enters 3: Enter the key of node: 1 Enter the updated value: 60 Node is updated. New value <1,60>. Press any key to continue:
Background image of page 2
Show entire document
Sign up to view the entire interaction

Top Answer

View the full answer
linkedList.cpp

#include&lt;iostream&gt;
#include&lt;stdlib.h&gt;
using namespace std;
class linkedList
{
int key;
int value;
linkedList *next;
public:
linkedList(int k,int val);
linkedList();
void addNode(int...

Sign up to view the full answer

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

-

Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question
Ask a homework question - tutors are online