Question: is should be done in python 3 and is very very urgent. please test the code with the sample outputs in the question. is very
is should be done in python 3 and is very very urgent.
please test the code with the sample outputs in the question. is very very important because that is what will make the answer different from the other solutions that have already been provided relative to this question. please is very very urgent.thank you


1.1 Problem 1 (2 marks) Problem: An Internet Service Provider (ISP) must, as part of its service to customers, provide a Domain Name Server (DNS). A DNS is a server that maintains a database of domain names, such as www.griffith.edu.au, 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 IPAs 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 ? u www.amazon.com 2.2.2.2 ? u www.cnn.com Bad command. ? I www.google.com 8.8.8.8 ? I www.amazon.com 2.2.2.2 ? I www.cnn.com None ? 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. . 1.2 Problem 2 (3 marks) 2 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 program is like this: ? u www.google.com 8.8.8.8 ? u www.amazon.com 2.2.2.2 ? b 2.2.2.2 ? I www.google.com 8.8.8.8 ? I www.amazon.com None ? 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
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
