Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Question What are the requirements for a SIMPLE 401(k) plan?

Answered: 1 week ago