Locally, computers are often known by an alias (nickname) as well. You will design and write a program to process a list of Internet addresses from file "CS222_Inet.txt. Your program should read a list of up to 100 addresses and nicknames terminated by a sentinel address of all zeros and the sentinel nickname, "none".

Sample CS222_Inet.txt:

111.22.3.44 platte
131.250.95.21 jet
172.66.7.88 wabash
111.22.5.66 green
131.250.47.63 baker
0.0.0.0 none

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.

Your program will generate a report listing all computers from the same localitySSSthat is, each computer with matching values in the first two components of the address. In the list, the computers should be identified by their alias. The report will be saved to file "222 Locality Report". The user will also generate a report listing all of the computers sorted alphabetically by alias. This report will be saved to file "222 Alias List". As with HW3, both reports will contain the users name and current date, along with the generated report listing.

Examples:

Hal Greenwald July 13, 2017
CS222 Network Locality Report

111.22
platte
green

131.250
jet
baker

172.66
wabash
Hal Greenwald July 13, 2017
CS222 Network Alias Listing

baker 131.250.47.63
green 111.22.5.66
jet 131.250.95.21
platte 111.22.3.44
wabash 172.66.7.88

Program structure and design:

Create a structure type called address_t with components for the four integers of an IPv4 address along with a fifth component in which to store an associated alias of up to 10 characters.

Create a twoSdimensional array called locality_t which will contain each unique locality pair: int locality_t[100][2];

In the above example, the locality_t would contain the following three unique locality pairs:

locality_t[row][0],locality_t[row][1]
111, 22
131, 250
172, 66

You may use the Bubble Sort (will be discussed in class), or any other sorting mechanism of your choice for the alias sort.

Include at,least the following UDFs (You may define your own prototypes):

  • Read_Data_File (Note: you may assume that the data file is syntactically correct.)
  • Generate_Locality_Rpt
  • Generate_Alias_List
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.