Page 1 of 1

Exercise 1:Computer Addresses Management Numeric addresses for computers on the wide area network Internet are composed

Posted: Fri May 20, 2022 12:24 pm
by answerhappygod
Exercise 1 Computer Addresses Management Numeric Addresses For Computers On The Wide Area Network Internet Are Composed 1
Exercise 1 Computer Addresses Management Numeric Addresses For Computers On The Wide Area Network Internet Are Composed 1 (53.96 KiB) Viewed 72 times
Exercise 1:Computer Addresses Management Numeric addresses for computers on the wide area network Internet are composed of four parts separated by periods of the form xx.yy.zz.mm, where xx,yy, zz, and mm are positive integers. Locally computers are usually known by a nickname as well. You are designing a program to process a list of internet addresses, identifying all pairs of computers from the same locality (1.e, with matching xx and yy component). (a) Create a structure called InternetAddress with fields for the four integers and a fifth component to store an associated nickname. (b) Define a function. ExtractinternetAddress, that extracts a list of any number of addresses and nicknames from a data file whose name is provide as argument, and returns a dynamically allocated array that holds the indicated number of internet addresses (represented in InternetAddress) objects) retrieved from the file. The first line of the file should be the number of addresses that follow. Here is a sample data set: 4 111.22.3.44 555.66.7.88 111.22.5.88 234.45.44.88 plato gauss mars ubuntu (e) Define a function Common Locality that receives as arguments the array constructed in a) and the number of internet addresses, and displays a list of messages identifying each pair of computers from the same locality. In the messages, the computers should be identified by their nicknames. Here is a sample message: Machines plato and mars are on the same local network. (d) Define the main function that prompts the user to enter the name (computers.txt) of the file containing the Computer addresses as described in (b) and displays a list of messages identifying all pair of computers from the same locality.