Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 Java
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 validStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started