Numeric addresses for computers on the international networkInternet are compose
ID: 3613822 • Letter: N
Question
Numeric addresses for computers on the international networkInternet are composed of four parts, separated by periods, of theform: xx.yy.xx.mm where xx, yy, zz, and mm are positiveintegers. Locally, computers are usually known by a nickname,as well. You are designing a program to process a list ofInternet addresses,Purpose:
The program should display alist of messages identifying each pair of computers from the samelocality -that is, each pair of computers with matching values forthe first two components of the address.
In the message, the computers should be identified by theirnicknames
Example message:
Machine platte and green areon the same local network.
Follow the message by a display of the full list of addresses andnicknames. Include in your program, member function to readaddresses, to print addresses and a local_addresses
Directions:
1. Split your program into 3 files:Network.h, Network.cpp and clientNet.cpp as described in the ADTnotes.
2. Define a class called address_t with membersfor the four integers of an internet address and a fifthmember in which to store an associated nickname of 10 characters.Your program should read a list up to 100 addresses and nicknamesterminated by a sentinel address of all zeros and nickname labeled"none". The data is stored in a file calleddata.txt
3. Define and implement a member function CompareTo as in your book(Chapter 2), which should take 2 network addresses and comparethem.
4. Include exceptions handling in your code. Your programshould define two exceptions: one if the data file is not found, itshould ask the user to enter a different file name. Thesecond exceptions: one if the data file is not found, it should askthe user to enter a different file name. The second exceptionshould handle the cases where one of the network addresses is anegative number and skips to the next file entry.
File data.txt
111.22.3.44 platte
555.66.7.88 wabash
111.22.5.66 green
222.33.5.77 blue
234.23.89.00 red
675.44.678.99 yellow
222.44.56.00 black
556.66.33.40 brown
234.44.55.88 green
666.11.22.33 purple
0.0.0.0 none
Explanation / Answer
please rate - thanks found the bug--out of time #include #include #include using namespace std; int extract(char[] ,char ,int& ); class Address {private: int part[4]; char name[10]; public: void setval(int num[]) {int i; for(i=0;iRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.