” CS 222课程 写作、 辅导Python,JAVA,C++程序语言CS 222: Computer Programming for EngineersHomework # 4 RubricMost computers on the internet have a 32 bit Internet Protocol Version 4 (IPv4) address. As reading these addresses would be difficult usingbinary or hexadecimal notation, IPv4 addresses are usually represented in dotted decimal notation.For purposes of representation, the 32 bits composing the address maybe divided into four octets (bytes) written in decimal numbers, eachranging from 0 to 255, and concatenated as a character string with a full stop (ASCII 46) between Each number.For example:The first two components of the address indicate the computers localityon the network. In the above example, the locality is specified by thenumbers 172 and 16.Another example:Locally, computers are often known by an alias (nickname) aswell. You will design and write a program to process a list of Internetaddresses from file CS222_Inet.txt. Your program should read a list ofup to 100 addresses and nicknames terminated by a sentinel address ofall zeros and the sentinel nickname, NONE.Sample CS222_Inet.txt:Your program will Generate a report listing all computers from the same locality—that 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 file222_Locality_Report. As with HW3, the report will contain the users name and current Date, along with the generated report listing.Examples: Hal Greenwald Oct 22, 2020CS222 Network Locality Report111.22PLATTEGREEN131.250JETBAKER172.66WABASH111.22.3.44 PLATTE131.250.95.21 JET172.66.7.88 WABASH111.22.5.66 GREEN131.250.47.63 BAKER0.0.0.0 NONEFor this assignment, you willcreate your own test data filesusing the sample format. Grading will involve using different data files with the same format.Program structure and design:Create a structure type called:struct address_twith components for the four integers of an IPv4 address along with a fifth component in which to store an associated alias of up to 10characters.You will then declare an Array of 100 address_t structures in which tostore the data read in from CS222_Inet.txt. For this exercise you may have 2 global variables only:struct address_t addressArray[100];FILE *outputReportInclude at least the following UDFs (You may define your own prototypes):a) readDataFile (Note: you may assume that the data file is syntactically correct.)b) generateLocalityRptc) getDateAndTime (same as HW3)Rubric 10 points: Is the source code well documented and formatted using clearly readableindentation and white space (while viewed within vi)? 1 point Is struct address_t addressArray[100] properly implemented? 1 point Are the 3 UDFs Properly implemented? 2 points Did you limit your program to 2 (or fewer) global variables? 2 points Is the sentinel input loop properly implemented? 2 points Is 222_Locality_Report correct? 2 points Note: Your program must compile using gcc in order to receive creditNote: Other than Prompting for the user name, this project does not require aninteractive user interface.如有需要,请加QQ:99515681 或邮箱:99515681@qq.com
“
添加老师微信回复‘’官网 辅导‘’获取专业老师帮助,或点击联系老师1对1在线指导。