Question: Program in C++ Zip all of the header and source files into a single zip file for submission. o .zip only, no .rar, .tar, .7zip,
Program in C++
Zip all of the header and source files into a single zip file for submission.
o .zip only, no .rar, .tar, .7zip, etc
Pseudocode Details:
Linked list functions
o Recursive print
o Overloaded += operator
o Overloaded operator
? Prefix logic
? Postfix logic
Main function
Class Details
BaseNode class
o Must be abstract (-5 points)
o Attributes ? Roman numeral ? Arabic numeral
o Methods ? Default constructor Necessary for inheritance ? Overloaded constructor ? Copy constructor ? Accessors ? Mutators ? Overloaded << Write a single node using the specified file format ? Overloaded >> Read data from input stream and store in node DoubleLinkNode
o Derived from BaseNode
o Attributes ? Next pointer ? Prev pointer
o Methods ? Overloaded constructor Calls overloaded BaseNode constructor ? Copy constructor Calls BaseNode copy constructor ? Accessors ? Mutators Linked List
o Attributes ? Head pointer ? Tail pointer (points to end of list)
o Overloaded constructor ? Takes node and assigns head to point at the node passed in
o Destructor ? Delete linked list
o Accessors
o Mutators
o Print ? Recursively write linked list to file o Overloaded += operator ? Usage: LL += Node ? Inserts Node at the end of the list
o Overloaded -- operator ? Usage: LL-- or --LL ? Prefix notation: delete first node in list ? Postfix notation: delete last node in list Details: Roman numerals are as follows:
o 1 = I
o 5 = V
o 10 = X
o 50 = L
o 100 = C
o 500 = D
o 1000 = M
Determine if the input given is Roman numeral or Arabic. Convert from given type to the missing type. All numbers will be in the range of 1 4999. Store the file contents in a linked list. All manipulation of the data will happen in the linked list. Write the contents of the linked list back to the file at the end of the program. The file may contain invalid data.
o If invalid data is identified, ignore the entry in the file. Invalid data:
o Arabic numeral outside the given rage. o Invalid characters in Roman numeral. o Invalid characters in Arabic numeral. User will be able to search the data.
o Search can be for Arabic or Roman numeral
o Do not ask user what type of numeral to search for ? User can type in Arabic or Roman numeral ? You have to figure out what they typed Implement sorting algorithm of your choice
o Sorting algorithm will move nodes
o Do not exchange node data
o All sorts will sort in ascending order ? Arabic: smallest to largest number ? Roman: alphabetical
o Modify sorting algorithm from project 3 to link previous pointers as well as next pointers Users can add and delete from the list
o Add node to end of list ? User can type in Arabic or Roman numeral ? You have to figure out what they typed ? Convert user input to opposite type ? Store both values in node ? Add to list o Delete can happen from beginning or end of the list ? User will specify what end they want to delete from
You must use the overloaded operators for your objects in your program o At the top of main, write comments listing the line numbers where the overloaded operators are used (-5 points) User Interface and Input: Create a simple menu interface allowing the user to search and sort the data. Loop the menu until the user selects the exit option. The menu will consist of 5 options:
1. Search
2. Add
3. Delete first
4. Delete last
5. Exit All user input will be valid. Remember that the file input may not be valid. When reading from the file, you dont need to use random file access techniques. Read the entire line into a string and then validate it. File Structure: The file will contain an unknown quantity of numbers to convert. Each number will be on a separate line. The number will be either Arabic or Roman Each line of the file will have the same format o ? Roman numeral field 16 characters ? Arabic numeral field 4 characters The last line will not have a new line at the end Only one of the fields will hold a value on each line o If a field does not hold a value, it will contain all spaces. o If the Roman numeral field contains a space as the first character, you know that the line contains a value in the Arabic numeral field Output: When the user exits the program, write the linked list back to the file using the format described above.
EXTRA CREDIT OPPORTUNITY: Implement ability to delete any node Add option to menu
o 6. Delete specific node
? Yes, this option is listed after the exit option. ? This is on purpose to make grading easier for people that attempt the extra credit Prompt user for value to delete o Value may be Arabic or Roman numeral Search for value If value found o Remove value from list o Display success message If value not found o Display value not found message User will type in valid input
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
