Question: In this assignment you will create a class called Character which creates a character in a setting of your choosing. The class should have the

 In this assignment you will create a class called Character which

In this assignment you will create a class called Character which creates a character in a setting of your choosing. The class should have the following: 1. A name for the character. 2. A brief description (less than 100 characters long). 3. Exactly three attributes of type string, float and integer. 4. The class constructor will receive the name, description and the values for the different attributes and use them to create an instance of the class. 5. You must use name mangling to make all these attributes inaccessible from outside the class (including the name and description). 2 6. There must be getters for all these attributes, and a setter for the description. The name however, can't be changed after creating a Character. 7. The float attribute should have a setter that checks whether the provided value is in a given interval and only updates the attribute if that's the case. 8. There must be a mutator method for increasing the integer attribute in some amount (in the our example we use a level_up_aim() method that increases the aim by 5%). 9. You must implement the matr.. method for printing the character's info in a format similar to the one shown in the example. 10. You must also provide appropriate docstring documentation for classes and methods. 11. You must provide a driver script that creates an instance of a character, modities and prints it, as shown in the example

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!