Question: Homework # 3 builds upon Homework # 2 . Recall that in HW# 2 , our program reads the contents of datafile CS 5 3
Homework # builds upon Homework # Recall that in HW# our program reads the contents of datafile CSInet.txt Each line in CSInet.txt contains an IPv address and alias pair as shown below: sample CSInet.txt includes errors In HW# you were asked to construct a linked list of addresst structures, each of which contained the four integers of an IPv address along with a fifth component in which to store an associated alias of up to characters. In this project, you will replace the linked list with a Binary Search Tree BST All edit checks for HW# apply to HW# regarding range checking for the IPv octets and alias length printable characters. For this exercise, the CSInet.text file may have errors. If any of the following errors occur within the CSInet.txt file, the record must be written out to the text file: CSerrorlog see test case example and omitted from the BST Possible errors within CSInet.txt may include: IPv address does not parse into four legal integers. The alias length is greater than ten characters note:
is not a legal character within an alias The alias contains one or more uppercase letters. Again, you will create a structure type called addresst similar to that used in HW# with the following modifications needed to convert the linked list to a BST platte jet wabash green baker As with HW# for this assignment, you will create your own test data files using the sample format. Grading will involve using different data files with the same format. platte jet smith wabash green smith baker abercrombie Sanders struct addresst int octet; char alias; struct addresst leftChildrightChildparent; int height, depth; struct addresst head NULL; As CSInet.txt is being read in those records that do not contain errors will be stored in the BST composed of addresst structures containing the addressalias pairs read in from the file. Once the BST has been created, the user will receive the following menu options: Add address Look up address Update address Delete address Display list Display aliases for location Display Error Log Quit Program Structure and Design displayList and displayAliasesForLocation shall be based on Inorder Traversal. displayList will display the alias, address, height, depth, and parents alias for each node. deleteAddress lookUpAddress and displayAliasesForLocation will display an error message if the alias or location entered is not listed. Following the error message, the menu will be redisplayed. A separate UDF will be defined as an entry point for each menu option. These functions must each be properly prototyped and documented as discussed. No duplicate aliases or address are allowed. If attempted, display an appropriate error message followed by the menu. For this exercise, all aliases entered by the user must be converted by your program to lower case. testcase scenarios: Add address Look up address Update address Delete address Display list Display aliases for location Display Error Log Quit platte jet smith wabash green smith baker abercrombie Sanders Enter menu option: baker height: depth: parent:green green height: depth: parent:jet jet height: depth: parent:platte platte height: depth: parent: NONE wabash height: depth: parent:platte note that option displays the list in alphabetical order, due to the inorder traversal Enter menu option: Enter Locality: Location: baker jet Enter menu option: Enter alias: platte platte: Enter menu option: Enter IPv address: Enter alias: barbara Enter menu option: baker height: depth: parent:green barbara height: depth: parent:baker green height: depth: parent:jet jet height: depth: parent:platte platte height: depth: parent: NONE wabash height: depth: parent:platte Enter menu option: Enter Locality: Location: baker barbara jet Enter menu option: Error Log: smith smith abercrombie Sanders Enter menu option: Goodbye!
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
