Write a subnet calculator and explain the code behaviours


Assignment

In Java, write a subnet calculator. Please read over the general assignment requirements before starting this assignment.

Requirements for Assignment Submission

1. You must write a complete program that compiles and runs with command-line javac and java.

2. Incomplete programs or code fragments are unacceptable.

3. Your program must solve the particular programming task required for the assignment.

4. If a program requires multiple source files, they must all be included in the zip file submitted.

5. If the program requires source files that are not part of the built-in JDK package, then you must include them in the zip file.

6. Programs must compile correctly, and be fully tested before submission.

7. All programs must compile from ONE working directory (it can have several sub-directories within it).

8. All programs must include proper explanations and complete headers.

- Explain the code behaviours and/or objectives by using a comment or a block of comments before the appropriate code or block of codes. Doing so will ensure that you can fully understand your code three months later, and it will help other developers/maintainers know what you were thinking while writing the programs.

- The headers for these programs must be contained in a block of comments at the beginning of the programs and functions, including program/function name, description, expected inputs, expected outputs/results, called by whom, and will call what functions.

- All programs must also include (in .doc/.pdf files, not .docx) a complete test plan (e.g., in a table) with test items, inputs, expected outputs, actual outputs, and results/remarks.

Assignment Description:

For any IP address entered, display the Network class, the default (classfull) subnet mask, and the CIDR notation.
Also display how many hosts per subnet, the network address and broadcast address.
For instance, if you enter 199.212.55.7
The result should be:
Network Class: C
Subnet Mask: 255.255.255.0
CIDR: /24
Hosts per subnet: 254
Network Address: 199.212.55.0
Broadcast Address: 199.212.55.255
Bits in Host: 8
Bits in Network: 24
You also need to be able to specify an IP address with a VLSM (variable length subnet mask) or an IP address with a dotted decimal notation subnet mask.
For instance if you enter:
199.212.55.7/16 or 199.212.55.7 255.255.0.0 the result should be
Subnet Mask: 255.255.0.0
CIDR: /16
Hosts per subnet: 65534
Network Address: 199.212.0.0
Broadcast Address: 199.212.255.255
Bits in Host: 16
Bits in Network: 16

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Write a subnet calculator and explain the code behaviours
Reference No:- TGS02446959

Now Priced at $40 (50% Discount)

Recommended (97%)

Rated (4.9/5)