Question: PLEASE PROGRAM IN C SAMPLE OUTPUT: A network address is made up of 4 sections - each an integer from 0-255. Each section is separated

PLEASE PROGRAM IN C

PLEASE PROGRAM IN C SAMPLE OUTPUT: A network address is made upof 4 sections - each an integer from 0-255. Each section is

SAMPLE OUTPUT:

separated by a period (.) when shown to the user. Depending on

A network address is made up of 4 sections - each an integer from 0-255. Each section is separated by a period (.) when shown to the user. Depending on the class of the address, one or more sections identify the network and one or more sections identify the host within the network. This table shows this Class First octet value Subnet mask A 0-127 8 B 128-191 16 192-223 24 D 224-239 E 240-255 For the IP addresses from Class A, the first 8 bits (the first number) represent the network part, while the remaining 24 bits (last 3 numbers) represent the host part. For Class B, the first 16 bits (the first two numbers) represent the network part, while the remaining 16 bits (last 2 numbers) represent the host part. For Class C, the first 24 bits represent the network part (the first 3 numbers), while the remaining 8 bits (the last number) represent the host part. You must have at least 3 functions besides main. Each function must be in a separate file. You will use a makefile to compile each source file separately and link the resulting objects files together to create one executable. What the program will do: Convert the number of addresses from the command line to an int. Print an error and end the program if you there is not one argument plus the executable name on the command line. You will read each address into a 2 dimensional array of unsigned chars (that is to minimize the amount of memory you use since all numbers are between 0 and 255). The size of the array is known by the value you passed in through the command line. Sort the array. Count the number of networks in each class for classes A, B, and C. Don't count any addresses that are class D or class E. Determine if there is more than 1 host in each network. Print the number of networks in each class. Print the network address that has the most hosts and the number of hosts in that network. DO NOT USE GLOBALS. [k57h721@csci112 pgm1]$ ./runs.sh > out.txt [k57h721@csci112 pgm1] $ cat out.txt running pgm1 with 17 addresses Class A has 5 networks Largest A network is 106 with 3 hosts Class B has 5 networks Largest B network is 137.249 with 2 hosts Class C has 2 networks Largest C network is 215.116.26 with 2 hosts running pgm1 with 2000 addresses Class A has 128 networks Largest A network is 38 with 16 hosts Class B has 484 networks Largest B network is 129.74 with 2 hosts Class C has 256 networks All C networks have only 1 host running pgm1 with 5000 addresses Class A has 128 networks Largest A network is 95 with 35 hosts Class B has 1234 networks Largest B network is 144.40 with 3 hosts class C has 640 networks All C networks have only 1 host running pgm1 with 8000 addresses class A has 128 networks Largest A network is 106 with 50 hosts Class B has 1961 networks Largest B network is 141.175 with 4 hosts class C has 987 networks Largest C network is 216.24.49 with 2 hosts A network address is made up of 4 sections - each an integer from 0-255. Each section is separated by a period (.) when shown to the user. Depending on the class of the address, one or more sections identify the network and one or more sections identify the host within the network. This table shows this Class First octet value Subnet mask A 0-127 8 B 128-191 16 192-223 24 D 224-239 E 240-255 For the IP addresses from Class A, the first 8 bits (the first number) represent the network part, while the remaining 24 bits (last 3 numbers) represent the host part. For Class B, the first 16 bits (the first two numbers) represent the network part, while the remaining 16 bits (last 2 numbers) represent the host part. For Class C, the first 24 bits represent the network part (the first 3 numbers), while the remaining 8 bits (the last number) represent the host part. You must have at least 3 functions besides main. Each function must be in a separate file. You will use a makefile to compile each source file separately and link the resulting objects files together to create one executable. What the program will do: Convert the number of addresses from the command line to an int. Print an error and end the program if you there is not one argument plus the executable name on the command line. You will read each address into a 2 dimensional array of unsigned chars (that is to minimize the amount of memory you use since all numbers are between 0 and 255). The size of the array is known by the value you passed in through the command line. Sort the array. Count the number of networks in each class for classes A, B, and C. Don't count any addresses that are class D or class E. Determine if there is more than 1 host in each network. Print the number of networks in each class. Print the network address that has the most hosts and the number of hosts in that network. DO NOT USE GLOBALS. [k57h721@csci112 pgm1]$ ./runs.sh > out.txt [k57h721@csci112 pgm1] $ cat out.txt running pgm1 with 17 addresses Class A has 5 networks Largest A network is 106 with 3 hosts Class B has 5 networks Largest B network is 137.249 with 2 hosts Class C has 2 networks Largest C network is 215.116.26 with 2 hosts running pgm1 with 2000 addresses Class A has 128 networks Largest A network is 38 with 16 hosts Class B has 484 networks Largest B network is 129.74 with 2 hosts Class C has 256 networks All C networks have only 1 host running pgm1 with 5000 addresses Class A has 128 networks Largest A network is 95 with 35 hosts Class B has 1234 networks Largest B network is 144.40 with 3 hosts class C has 640 networks All C networks have only 1 host running pgm1 with 8000 addresses class A has 128 networks Largest A network is 106 with 50 hosts Class B has 1961 networks Largest B network is 141.175 with 4 hosts class C has 987 networks Largest C network is 216.24.49 with 2 hosts

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!