Question: 1 Create a Python program that utilizes a Person class that maintains the following information: 2 Name (string) PhoneNumber (string) Address (string) Age (int) 3

1 Create a Python program that utilizes a Person class that maintains the following information:

2

Name (string)

PhoneNumber (string)

Address (string)

Age (int)

3

4

5 In addition, program should contain the following:

6

a __init__ constructor method that allows you to create a Person object with values provided for Name, PhoneNumber, Address and Age. In addition, the constructor should provide for default values of None for the string members and 0 for Age

a __str__ method that allows you to print the values of a Person object

Accessor methods for each of the class variables that separately returns their values

Mutator methods that directly modify each the class variables that separately returns their values

Error checking in both the constructor and the mutator for the Age class variable that unsures that the value of Age is always between 1 and 100

A client program that imports the Person class from a separate file and tests the constructor and all the the methods associated with the Person

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!