Question: CS 3A Winter 2018 PYTHON Assignment #10 March 12, 2018 Part 2: Internet User Class (30 points] Every internet user has certain data associated with
CS 3A Winter 2018 PYTHON Assignment #10 March 12, 2018 Part 2: Internet User Class (30 points] Every internet user has certain data associated with him/her/it. We will oversimplify this by symbolizing such data with only two fields: a name ("Aristotle") and a globally accessible IP address ("139.12.85.191"). We could enhance these by adding other sometimes optional, sometimes needed data (such as a MAC address, port, local IP address, gateway, etc), but we keep things simple and use only these two for the assignment-any more would not satisfy spec. InternetUser Class Constants Define intended constant values MAX NAME LEN [you choose an int] MIN NAME LEN [you choose an int] MAX IP4 LEN=15 #xxx.xxx.xxx.xxx MINI P4LEN = 7 #x.x.x.x - DEFAULT NAME "you choose a str]" DEFAULT IP "[you choose a str]" Instance Members * name- a string that represents the description of the enternet user entity.. * ip a string thar represents the IP4 address: 1.2.3.4 or 200.200.200.200. We'll accept any string that can hold addresses from 0.0.0.0 to 999.999.999.999, even though the ints between the dots are out-of-range for real addresses. Client Callable Methods init (self, name, ip) - a constructor. It should take default arguments as defined by the indented constants. str (self)-a method that provides a nicely formatted returm string for potential screen I/O. Here's a possible string that received my choice of defaults: Name: (undefined) IP Aaddr: 0.0.0.0 " set name " set ip " get name get ip Client Test of Class InternetUser (first part of main0) Instantiate two or more InternetUser objects, some using the default arguments and some passing parametersr. Mutate one or more of the members and, after that, use the stringizerto assist a screen output so we can see what your objects contain. Next, test one or more accessors. Finally, call two or more mutators and constructors, providing both legal and illegal arguments and checking the return values (thus demonstrating that the mutators do the right thing). Name the source code files-InternetUser
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
