Computers and Technology

Program structure and design: (Write a C Program to compile in linux) Create a structure type called:
struct address_t
with components for the four integers of an IPv4 address along with a fifth component in which to store an associated alias of up to 10 characters.
Read the file CS222_Inet. txt in order to count the number of records in the file. Provide error checking in order to ensure that each integer portion of the IP address falls within the range [0..255]. If a record contains an illegal IP address, that record is written to the file
222_Error_report and excluded from the 222_Locality_Report
Once the record count has been established, rewind() the file.
Dynamically allocate the proper amount of memory (using malloc()) to store a dynamically allocated array of address_t structures based on the record count.
Dynamically allocate the proper amount of memory (using malloc()) to store a dynamically allocated array of address_t structures based on the record count.
Reread the file and store the data within the dynamically allocated array of address_t structures. Once the array of structures has been populated,
close the CS222_Inet. txt file.
Conditions to write program:
For this exercise you may have a maximum of 2 global variables.
Include at least the following UDFs (You may define your own prototypes):
a) readDataFile
b) generateLocalityRpt
c) getDateAndTime
remember: Max 2 global variable
Sample txt file. (CS222_Inet. txt) to read
194.161.11.166 PLUTO
131.250.182.166 JET
23.88.118.05 WALTER
111.22.217.26 GRIFFITH
194.461.01.166 KRIS
111.22.15.26 ZENITH
131.250.45.215 BAKER
247.276.31.30 SONS
124.95.149.166 FAIROAK
127.88.118.205 SAMUEL
124.95.31.30 BOULER
201.46.182.165 SMITH
192.168.1.2 MATILDA
0.0.0.0 NONE
192.168.1.3 MAYA
192.168.25.45 HARRY
165.25.74.4 PETER
111.22.3.44 TARA
NOTE: Sentinel ip 0.0.0.0 NONE marks the end of reading file and exit loop, it could be anywhere in the file (not necessarily at the end of file)
// Sample output (localityreport. txt)
Sean Howard Jul 10, 2021
CS222 Network Locality Report
Address total:5
Localities: 3
192.168
MATILDA
MAYA
HARRY
111.22
GRIFFITH
ZENITH
131.250
JET
BAKER
// Sample output file (Error_Report. txt)
Sean Howard Jul 10, 2021
CS222 Network Error Report
194.461.01.166 KRIS
247.276.31.30 SONS

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 10:30, darrengresham999
Choose the best explanation for the following statement communication is symbolic
Answers: 3
image
Computers and Technology, 22.06.2019 17:30, glocurlsprinces
Rachel completed typing an official document with a word processing program. she wants to make sure that her document has no typographical errors. she also wants all headings to have the same font. which features in a word processing program should she use? rachel should use the feature in a word processing program to find typographical errors. she should apply to have uniform headings.
Answers: 1
image
Computers and Technology, 22.06.2019 19:20, bob4059
1)consider the following code snippet: #ifndef book_h#define book_hconst double max_cost = 1000.0; class book{public: book(); book(double new_cost); void set_cost(double new_cost); double get_cost() const; private: double cost; }; double calculate_terms(book bk); #endifwhich of the following is correct? a)the header file is correct as given. b)the definition of max_cost should be removed since header files should not contain constants. c)the definition of book should be removed since header files should not contain class definitions. d)the body of the calculate_terms function should be added to the header file.
Answers: 1
image
Computers and Technology, 24.06.2019 00:50, anthonycraig0205
3. what is the output of the following statements? temporary object1; temporary object2("rectangle", 8.5, 5); temporary object3("circle", 6, 0); temporary object4("cylinder", 6, 3.5); cout < < fixed < < showpoint < < setprecision(2); object1.print(); object2.print(); object3.print(); object4.print(); object1.set("sphere", 4.5, 0); object1.print();
Answers: 1
Do you know the correct answer?
Program structure and design: (Write a C Program to compile in linux) Create a structure type call...

Questions in other subjects:

Konu
Social Studies, 16.12.2019 16:31