Write a program that takes FOUR user inputs: IPv4 of machine1: Subnet mask of machine1: IPv4...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a program that takes FOUR user inputs: IPv4 of machine1: Subnet mask of machine1: IPv4 of machine2: Subnet mask of machine2: Your program should determine whether machine1 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, I your program should print the last IPv4 address in machine1'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 machine1: 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 machine1: IPv4 of machine2: Subnet mask of machine2: Your program should determine whether machine1 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, I your program should print the last IPv4 address in machine1'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 machine1: 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
Expert Answer:
Answer rating: 100% (QA)
Heres a Python script that accomplishes this task python import ipaddress def checksamesubnetip1 mas... View the full answer
Related Book For
Numerical Methods With Chemical Engineering Applications
ISBN: 9781107135116
1st Edition
Authors: Kevin D. Dorfman, Prodromos Daoutidis
Posted Date:
Students also viewed these programming questions
-
Water flows through a pipe section that tapers from an internal diameter of 200 mm down to 100 mm over a distance of 1 m. Determine the pressure drop over the section for a flow of 0.06 m3s-1. The...
-
Takeaways for Case study analysis of Transferring Knowledge Between Projects at NASA JPL
-
Company Revenue for Fiscal Year 2014 (millions of dollars) Walmart 476,294 Exxon Mobil 407,666 Apple 170,910 General Motors 155,427 Ford Motor 146,917 General Electric 146231 Identify and explain...
-
Water is pumped out of a holding tank at a rate of 5 5e 0.12t liters/minute, where t is in minutes since the pump is started. If the holding tank contains 1000 liters of water when the pump is...
-
The force shown in Figure 7-22 acts on a 1.3-kg object whose initial speed is 0.35 m/s and initial position is x = 0.27 m. (a) Find the speed of the object when it is at the location x = 0.99 m. (b)...
-
Suppose there are two transformers between your house and the high-voltage transmission line that distributes the power. In addition, assume that your house is the only one using electric power. At a...
-
The following information was taken from the records of Underwood Company at June 30, 2007: Requirement Prepare a multistep income statement for Underwood Company for the fiscal year ended June 30,...
-
Beechers Boston Barbeque Company purchased a customer list and an ongoing research project for a total of $300,000. Beecher uses the expected cash flow approach for estimating the fair value of these...
-
rmation or Transmission is Strictly Prohibited! Harnoor Kaur Limited, follows IFRS, is in the process of preparing its financial statements for its second year of operations ending December 31st,...
-
Suppose, you are a CEO of a company and you just made a big investment in a new production facility. Your Chief Risk Officer provides you with the following information: Your liabilities consist of...
-
Assist me in developing the main points to complete a 10-page research paper for a communication course on the topic of "Relationship Building With Stakeholders"? The name of the course is "Nonprofit...
-
Scenario: Assuming that your organisational target is to met at least 90% of sales target, 85% of service level target, and 80% of your waste reduction target and you have exceeded both the service...
-
What is the value today of receiving $ 5 , 0 0 0 at the end of each year for the next 5 years, assuming an interest rate of 7 % compounded annually?
-
5. Monthly selling and administrative (S&A) expenses are estimated as follows: Sales salary $30,000 Administrative salary 15,000 Advertising and promotion 8,000 Depreciation of S&A assets 12,000 Rent...
-
With respect to contingencies, it is acceptable to include them at the beginning of the project, end of the project or spread them out over the project's duration. As a team, decide which approach...
-
What is cataloging? Why is cataloging important? What is RDA? What organization(s) are responsible for the development of RDA? When was RDA implemented in the U.S.A? What does MARC stand for? What...
-
You have just had your first child and want to fund her college education. You anticipate that she will start college in 18 years. You estimate by then you will need $50,000 a year to cover her...
-
What is a lobbyist in US? How did this term emerge?
-
Consider the system of ordinary differential equations (a) Confirm that (x,y) = (0,0), (1,1), and (1,1) are steady states of this system. (b) What is the 2 2 steady state Jacobian for this system in...
-
Consider the following program: What system of equations is being solved by this method? What method is used for the solution? Will this program converge to a solution? To save you time, we have...
-
Determine the stability condition for the step size h for the midpoint method, which has the form h h Yi+1 = Yi + hf ( xi + 12 - Yi + 1/ (xi, yi))
-
Derive the expression for the natural frequency of the system shown in Fig. 2.60. Note that the load \(W\) is applied at the tip of beam 1 and midpoint of beam 2. , E, I W 12, E2, 12 FIGURE 2.60 Load...
-
A weight is suspended using six rigid links and two springs in two different ways, as shown in Fig. 2.64. Find the natural frequencies of vibration of the two arrangements. 00000 W (a) 00000 k 00000...
-
A scissors jack is used to lift a load \(W\). The links of the jack are rigid and the collars can slide freely on the shaft against the springs of stiffnesses \(k_{1}\) and \(k_{2}\) (see Fig. 2.63)....
Study smarter with the SolutionInn App