Question: In Java Write a program that takes FOUR user inputs: IPv4 of machine1: Subnet mask of machinel: IPv4 of machine2: Subnet mask of machine2: Your

In JavaIn Java Write a program that takes FOUR user inputs: IPv4 of

Write a program that takes FOUR user inputs: IPv4 of machine1: Subnet mask of machinel: IPv4 of machine2: Subnet mask of machine2: Your program should determine whether machine and machine2 are in the same subnet. If yes, your program should print "Yes these IP's are in the same subnet", and then your program prints the LAST IPv4 address in that subnet. If no, your program should print the last IPv4 address in machinel's subnet, and then print the last IPv4 address in machine2's subnet run #1: IPv4 of machine1: 192.168.1.12 Subnet mask of machine1: 255.255.255.0 IPv4 of machine2: 192.168.1.123 Subnet mask of machine2: 255.255.255.0 output: Yes these are in the same subnet and the last IPv4 address in that subnet is 192.168.1.255 IPv4 of machine1: 192.168.1.12 Subnet mask of machiner: 255.255.255.0 IPv4 of machine2: 192.168.1.200 Subnet mask of machine2: 255.255.255.240 output: No, these are not in the same subnet the last IPv4 address in subnet 1 is 192.168.1.255 the last IPv4 address in subnet 2 is 192.168.1.207 Assume user input address ad subnet masks are valid Write a program that takes FOUR user inputs: IPv4 of machine1: Subnet mask of machinel: IPv4 of machine2: Subnet mask of machine2: Your program should determine whether machine and machine2 are in the same subnet. If yes, your program should print "Yes these IP's are in the same subnet", and then your program prints the LAST IPv4 address in that subnet. If no, your program should print the last IPv4 address in machinel's subnet, and then print the last IPv4 address in machine2's subnet run #1: IPv4 of machine1: 192.168.1.12 Subnet mask of machine1: 255.255.255.0 IPv4 of machine2: 192.168.1.123 Subnet mask of machine2: 255.255.255.0 output: Yes these are in the same subnet and the last IPv4 address in that subnet is 192.168.1.255 IPv4 of machine1: 192.168.1.12 Subnet mask of machiner: 255.255.255.0 IPv4 of machine2: 192.168.1.200 Subnet mask of machine2: 255.255.255.240 output: No, these are not in the same subnet the last IPv4 address in subnet 1 is 192.168.1.255 the last IPv4 address in subnet 2 is 192.168.1.207 Assume user input address ad subnet masks are valid

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!