Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Numeric addresses for computers on the international networkinternet are compose

ID: 3618328 • Letter: N

Question

Numeric addresses for computers on the international networkinternet are composed of four parts ,seperated by periods,of theform xx.yy.zz.mm where xx,yy,zz,and mm are positive integers.Locally,computersare usually known by a nickname as well.you are designing a programto process a list of internet addresses,identifying all pairs ofcomputers from the same locality.Create a structure type calledaddress_t with components for the four integers of an internetaddress and a fifth component in which to store an associatednickname of 10 characters.   Your program shouldread a list of up to 100 addresses and nicknames terminated by asentinel address of all zeros and a sentinel nickname. Sample Data 111.22.3.44                    platte 555.66.7.88                    wabash 111.22.5.66                    green 0.0.0.0                            none The program should display a list of messages identifying eachpair of computers from the same locality-that is , each pair ofcomputers with matching values in the first two components of theaddress .In the messages,the computers should be identified bytheir nicknames. Example Message Machines platte and green are on the same local network. Follow the messages by a display of the full list of addressesand nicknames. Include in your program a scan_address function , aprint_address function ,and a local_address function .Functionlocal_address should take two address structures as inputparameters and return 1 (for true) if the addresses are on the samelocal network,and 0(for false) otherwise Numeric addresses for computers on the international networkinternet are composed of four parts ,seperated by periods,of theform xx.yy.zz.mm where xx,yy,zz,and mm are positive integers.Locally,computersare usually known by a nickname as well.you are designing a programto process a list of internet addresses,identifying all pairs ofcomputers from the same locality.Create a structure type calledaddress_t with components for the four integers of an internetaddress and a fifth component in which to store an associatednickname of 10 characters.   Your program shouldread a list of up to 100 addresses and nicknames terminated by asentinel address of all zeros and a sentinel nickname. Sample Data 111.22.3.44                    platte 555.66.7.88                    wabash 111.22.5.66                    green 0.0.0.0                            none The program should display a list of messages identifying eachpair of computers from the same locality-that is , each pair ofcomputers with matching values in the first two components of theaddress .In the messages,the computers should be identified bytheir nicknames. Example Message Machines platte and green are on the same local network. Follow the messages by a display of the full list of addressesand nicknames. Include in your program a scan_address function , aprint_address function ,and a local_address function .Functionlocal_address should take two address structures as inputparameters and return 1 (for true) if the addresses are on the samelocal network,and 0(for false) otherwise

Explanation / Answer

please rate - thanks #include #include #include struct address_t    {int xx;    int yy;    int zz;    int mm;    char nname[10]; }add[100]; int local_address(struct address_t,struct address_t ); void scan_address(char[],struct address_t[],int); void print_address(struct address_t); int main() {char address[12]; FILE *in; int i=0,j,k; in=fopen("input.txt","r"); if(in == NULL)     {printf("Error opening input file! ");     return 0;     } fscanf(in,"%s",&address); while(strcmp(address,"0.0.0.0")!=0)      {fscanf(in,"%s",add[i].nname);       scan_address(address,add,i);       i++;       fscanf(in,"%s",&address);       } printf("the addresses are: "); for(j=0;j