NOTE: Program MUST be written in C NOT C++, using headers such as stdio.h, time.
ID: 3534807 • Letter: N
Question
NOTE: Program MUST be written in C NOT C++, using headers such as stdio.h, time.h, stdlib.h, ctype.h, or string.h. Headers such as iostream.h or fstream.h cannot be used and will not be rated! Thank you!
YOU WILL BE GIVEN 5 STARS IF THE PROGRAM WORKS AS ASKED.
1. Numeric addresses for computers on the international 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. Create a structure type called address t with compo-
nents for the four integers of an Internet address and a fth component
in which to store an associated nickname of 16 characters. Your program
should read a list of up to 100 addresses and nicknames terminated by a
sentinel 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
555:66:7:192 blue
0:0:0:0 none
----------------------------------------------------------------------------
The program should display a list of messages identifying each pair of
computers from the same locality | that is, each pair of computers with
matching values in the rst three components of the address. In the mes-
sages, the computer should be identied by their nicknames.
----------------------------------------------------------------------------
Example Message:
Machines wasbash and blue are on the same local network.
-----------------------------------------------------------------------------
Follow the messages by a display of the full list of addresses and nicknames.
Include in your program a scan address function, a print address func-
tion, and a local address function. Function local address should take
two address structures as input parameters and return 1 (for true) if the
addresses are on the same local network, and 0 (for false) otherwise.
Explanation / Answer
http://ideone.com/uqbYG5
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.