2807/7001ICT Programming Principles (I)
Workshop 11
School of Information and Communication Technology
编程原理代写 2 Pre-workshop questions (1 mark) Complete these questions in writing before the start of the workshop. They will be marked early in the workshop.
1 Preparation
Before your workshop class:
- Read all of this document.
- Review the lecture notes sections 1 to 25.
- Bring some paper (a print-out of this document is best) and writing implements.
- Bring a storage device, such as a portable hard drive and cable, or a USB drive.
2 Pre-workshop questions (1 mark) 编程原理代写
Complete these questions in writing before the start of the workshop. They will be marked early in the workshop.
1.Describe the relationship between a class and an object.
2.Describe the relationship between a reference and an object.
3.What are the members of a class?
4.What are the instances of a class?
5.A class defifinition begins:
class A (B):
Which one is the superclass and which one is the subclass?
3 Workshop activities 编程原理代写
3.1 Marking last workshop’s problems
If you have problems that still need marking from the previous workshops, get them marked at the start of this one.
3.2 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.
Defifine 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.
3.3 Problem 2 (2 marks)
Problem: The government now requires that DNSs should now 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, defifine 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 effiffifficient 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.
4 After the workshop 编程原理代写
- You have created programs that might be useful to refer back to in future workshops. Make sure that you will have that work in the future. One copy is not enough for at IT professional. You should have at least 2 copies:
1.on your Griffiffiffith network storage drive; and
2.on your portable storage device.
- Please answer these feedback questions.
– What was the best aspect of this workshop?
– What was the most diffiffifficult or worst aspect of this workshop?
– Did you fifind an error in these workshop notes?
其他代写:program代写 project代写 essay作业代写 finance代写 python代写 report代写 paper代写 assignment代写 加拿大代写 作业代写 作业加急 英国代写 北美作业代写 homework代写 java代写 matlab代写