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...
-
Overhead application using a predetermined overhead rate; practical capacity versus normal volume: manufacturer Jane Statton, the accountant for Hobart Happy Critters Ltd is in the process of...
-
Start with the partial model in the file Ch08 P08 Build a Model.xls on the textbook's Web site. You have been given the following information for a call option on the stock of Puckett Industries: P =...
-
How do systems serve the different management groups in a business? Describe the characteristics of transaction processing systems (TPS) and the roles they play in a business. Describe the...
-
Cederholm Company has gathered the following information. Units in beginning work in process ............ _0_ Units started into production ............... 36,000 Units in ending work in process...
-
Sierra Company manufactures soccer balls in two sequential processes: Cutting and Stitching. All direct materials enter production at the beginning of the cutting process. The following information...
-
As part of Dubai Development Plan, Roads and Transport Authority (RTA) plans to connect malls and recreational places through public transport. It has identified 10 such places whose locations are...
-
SECTION 2 - MYSQL Exercise Review above ERD diagram for answering Questions. USE students_db SELECT 'substitute with netid or UTDID' , current_user(), @ @hostname, now(), ( SELECT Distinct state FROM...
-
Understanding Hours Per Patient Day Nursing Hours Per Patient Day (NHPPD) can be calculated by dividing the total nursing hours worked by the patient census (NHPPD = Nursing hours worked/census) Use...
-
A class or classes necessary to create objects to be used by a program that meets the following requirements: A person object. It should be able to create and hold demographic information for a...
-
MUFC Ltd makes two products, carpet polish and floor deodoriser. Operating information from the previous year is as follows: Carpet polish Floor deodoriser Sales price per unit $9.00 $13.00 Variable...
-
Type up a Word document that explains the process of finding your IP address. Provide screen shots in the document of your own IP address on your computer and explain how you found it. Note that you...
-
Q1: What is the run time of the following function: def f1(number): rc = 1 for i in range(0, 5): rc += 1 return rc
-
The AW method of analysis has what advantage over the PW method of analysis? Question 8 options: Projects with 'unequal lives' can be compared AW accounts for tax and depreciation AW is the preferred...
-
According to a recent survey, 40% of millennials (those born in the 1980s or 1990s) view themselves more as spenders than savers. The survey also reveals that 75% of millennials view social...
-
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 accountant of Hook, Line and Sinker, a partnership of seven people, has asked your advice in dealing with the following items in the partnership accounts for the year to 31 May 2007. (a) (i)...
-
The chief accountant of Uncertain Ltd is not sure of the appropriate accounting treatment for a number of events occurring during the year 2005/6. (i) A significant number of employees have been made...
-
Identify which of the following numbers are irrational: \(\sqrt{441}, 4.33, \sqrt{70}, 5+9 \pi\)
Study smarter with the SolutionInn App