Problem: An Internet Service Provider (ISP) must, as part of its service to customers, provide a...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Problem: An Internet Service Provider (ISP) must, as part of its service to customers, provide a Domain Name Server (DNS). ADNS is a server that maintains a database of domain names, such as www.griffith.edu.ay, and their corresponding Internet Protocol Addresses (IPA), such as 132.234.243.22 A domain name has only one IPA, but an IPA may have many domain names. Define a class that simulates a DNS. It must have: • a method for updating the DNS with a new domain name and its IPA; a method for returning the IPA for a domain name, or None if it does not exist; and • whatever private attributes are required to support the methods. . Write a test program that allows the user to test the class, by typing in fake domain names and IP As to update the DNS and domain names to look up. An example of the output from the test program is like this: ?u.www.google.com 8.8.8.8 Puwww.amazon.com 2.2.2.2 Pu www.cnn.com Bad command. ?I www.google.com 8.8.8.8 www.amazon.com 2.2.2.2 ? www.cnn.com None 29 where: • u DNS IPA updates the DNS with a new domain name and its IPA; . I DNS returns the IPA for a domain name, or None if it does not exist; and qends the test program. Bad inputs are to be reported and ignored Answer: Submit your code as problemlpy and insert a screenshot of your program output for the following scenario: 7u www.apple.com 10.10.10.10 7 www.tesla.com 11.11.11.11 ?u www.python.org ? I www.apple.com 71 www.python.org 79 Insert picture 1.2 Problem 2 (3 marks) Problem: The government now requires that DNSS should maintain a secret blacklist of IPAs that must not be returned, even if the domain name exists. Without changing your DNS class from problem 1, define a new class that extends your old class, adding: . . a method for adding an IPA to the secret blacklist; and a private attribute for the blacklist. Hint: it may be called a blacklist, but is a Python list the most efficient data structure to use here? You must also override the lookup method so that it returns None for blacklisted IPA, even if they do exist Write a test program that allows the user to test the new class. An example of the output from the test programis like this: . uwww.google.com 8.8.8.8 uwww.amazon.com 2.2.2.2 ?b2.2.2.2 ?Iwww.google.com ?Iwww.amazon.com B.B.B.B None ?g where: u DNS IPA updates the DNS with a new domain name and its IPA; b IPA adds the IPA to the secret blacklist: • I DNS returns the IPA for a domain name, or None if it does not exist or is in the secret blacklist; qends the test program. • Bad inputs are to be reported and ignored. Answer: Submit your code as problem2.py and insert a screenshot of your program output for the following scenario: Problem: An Internet Service Provider (ISP) must, as part of its service to customers, provide a Domain Name Server (DNS). ADNS is a server that maintains a database of domain names, such as www.griffith.edu.ay, and their corresponding Internet Protocol Addresses (IPA), such as 132.234.243.22 A domain name has only one IPA, but an IPA may have many domain names. Define a class that simulates a DNS. It must have: • a method for updating the DNS with a new domain name and its IPA; a method for returning the IPA for a domain name, or None if it does not exist; and • whatever private attributes are required to support the methods. . Write a test program that allows the user to test the class, by typing in fake domain names and IP As to update the DNS and domain names to look up. An example of the output from the test program is like this: ?u.www.google.com 8.8.8.8 Puwww.amazon.com 2.2.2.2 Pu www.cnn.com Bad command. ?I www.google.com 8.8.8.8 www.amazon.com 2.2.2.2 ? www.cnn.com None 29 where: • u DNS IPA updates the DNS with a new domain name and its IPA; . I DNS returns the IPA for a domain name, or None if it does not exist; and qends the test program. Bad inputs are to be reported and ignored Answer: Submit your code as problemlpy and insert a screenshot of your program output for the following scenario: 7u www.apple.com 10.10.10.10 7 www.tesla.com 11.11.11.11 ?u www.python.org ? I www.apple.com 71 www.python.org 79 Insert picture 1.2 Problem 2 (3 marks) Problem: The government now requires that DNSS should maintain a secret blacklist of IPAs that must not be returned, even if the domain name exists. Without changing your DNS class from problem 1, define a new class that extends your old class, adding: . . a method for adding an IPA to the secret blacklist; and a private attribute for the blacklist. Hint: it may be called a blacklist, but is a Python list the most efficient data structure to use here? You must also override the lookup method so that it returns None for blacklisted IPA, even if they do exist Write a test program that allows the user to test the new class. An example of the output from the test programis like this: . uwww.google.com 8.8.8.8 uwww.amazon.com 2.2.2.2 ?b2.2.2.2 ?Iwww.google.com ?Iwww.amazon.com B.B.B.B None ?g where: u DNS IPA updates the DNS with a new domain name and its IPA; b IPA adds the IPA to the secret blacklist: • I DNS returns the IPA for a domain name, or None if it does not exist or is in the secret blacklist; qends the test program. • Bad inputs are to be reported and ignored. Answer: Submit your code as problem2.py and insert a screenshot of your program output for the following scenario:
Expert Answer:
Answer rating: 100% (QA)
To run the program save it as problem1py and execute it using a Python interpreter It allows you to ... View the full answer
Related Book For
Project Management The Managerial Process
ISBN: 9781260570434
8th Edition
Authors: Eric W Larson, Clifford F. Gray
Posted Date:
Students also viewed these programming questions
-
calculate the current across a series circuit power by 15v with a 740 ohm resistor and 1.5kohm resistor and 2.2kohm resistors.
-
Please help with the discusin questions ! I give thumbs up Case #1: Hailing a New Era: Haier in Japan As one of the most valuable brands in China, Haier designs,manufactures, and sells various home...
-
Founded by Jeff Bezos, online giant Amazon.com, Inc. (Amazon), was incorporated in the state of Washington in July, 1994, and sold its first book in July, 1995. In May 1997, Amazon (AMZN) completed...
-
World Information Group has two major divisions: print and Internet. Summary financial data (in millions) for 2011 and 2012 are: The annual bonuses of the two division managers are based on division...
-
Guillen, Inc. began work on a $7,000,000 contract in 2010 to construct an office building. Guillen uses the completed-contract method. At December 31, 2010, the balances in certain accounts were...
-
For the homogeneous lamina shown in Figure 17, find m, My, Mx, x, and y. 1- +
-
On 1 July 2025 Costopoulos, Hashmi and Torcello decided to enter into a partnership agreement, some of the relevant information is as follows. 1. Costopoulos contributed \($27200\) cash, inventory...
-
Error Analysis and Correcting Entry the reported net incomes for the first 2 years of Sinclair Products, Inc., were as follows: 2010, $147,000; 2011, $185,000. Early in 2012, the following errors...
-
1. How do price levels and the changes in price level determine a country's exch rate? 2. When are the spot and forward currency markets aligned with interest rates? 3. Are changes in exchange rates...
-
Here are some diagnostic plots for the final exam data from Exercise 13. These were generated by a computer package and may look different from the plots generated by the packages you use. (In...
-
Identify five key strategies of prescriptive problem solving. Analyze how each strategy is different from another. Consider This: This tool is based on elaborate diagrams and procedures, such as a...
-
What is the output of the following application? A. 2 5 B. 8 5 C. 6 5 D. The code does not compile. E. None of the above. public class Airplane { static int start = 2; final int end; } public...
-
Which of these are functional interfaces? A. Lion B. Tiger C. Both Lion and Tiger D. Neither is a functional interface. E. The code does not compile. interface } Lion { public void roar(); default...
-
How lines of the following code do not compile? A. None, they all compile B. One C. Two D. Three E. Four F. Five or more 10: interface Flavor { 11: 12: 13: 14: public default void happy () {...
-
Which of the following are not valid variable names? (Choose two.) A. _ B. _blue C. 2blue D. blue$ E. Blue
-
What is the output of the Movie program? A. Sequel B. Trilogy C. Remake D. Adaptation E. null F. None of the above package theater; class Cinema { private String name = "Sequel"; public Cinema...
-
Use java There are n gardens in a row. The gardens are numbered 1 to n and the i-th garden has a greenness of a[i], with higher numbers representing greener gardens. Let us define the "greenness on...
-
Pedro Bourbone is the founder and owner of a highly successful small business and, over the past several years, has accumulated a significant amount of personal wealth. His portfolio of stocks and...
-
Why would people resist a multiproject resource scheduling system?
-
Ventura Baseball Stadium is a 47,000-seat professional baseball stadium. G&E Company began construction on June 10, 2019, and will complete it on February 21, 2022. The stadium must be ready for the...
-
Calculate the direct cost of labor for a project team member using the following data: Hourly rate: $50/hr Hours needed: 120 Overhead rate: 40%
-
The plant managers of ABC Corporations five plants have met at a common location at 8:00 am every Monday morning for 20 years. The people serving as plant managers have changed several times during...
-
New Piper, an aircraft manufacturer, issued a Mandatory Service Bulletin grounding 76 new aircraft manufactured during the first 5 months of 2004. Thirty-nine of the airplanes were in customers...
-
Consider the logistic map discussed in the text. To gauge the density of bifurcations, one uses a measure of distance between fixed points as follows. Define \(d=x^{*}-(1 / 2)\) as the distance...
Study smarter with the SolutionInn App