Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help with a coding question. It's asking to be done in python. Note: All variable and class names must be followed. Any variable

I need help with a coding question. It's asking to be done in python.

Note: All variable and class names must be followed. Any variable names not specified in this document must be descriptive.

Note: If a main function is used, ensure it is inside if __name__ == __main__: Provided main functions will not be marked.

Question: Create one file that contains two classes, the PropertyClass and the DecoratorClass:

image text in transcribed

image text in transcribed

image text in transcribed

PropertyClass Variables Functions value get_value set_value del_value The PropertyClass should be initialized with and take in one variable called "value". It should default to 0 if nothing is passed to it The class should have: A getter function for value that will print out "Getting Value" and then return value A setter function for value that will print out "Setting Value" and then set the value A deleter function for value that will print out "Deleting Value" and then delete the value These three functions must then be passed into a property named value DecoratorClass Variables Functions value value value value The DecoratorClass should be initialized with and take in one variable called "value". It should default to 0 if nothing is passed to it The class should have: A getter function for value that will print out "Getting Value" and then return value A setter function for value that will print out "Setting Value" and then set the value A deleter function for value that will print out "Deleting Value" and then delete the value These three functions must use the @property decorator to specify whether they are a getter, setter, or deleter The output should look like this: PropertyClass getter, setter, and deleter Setting Value Getting Value Setting Value Getting Value 1e eleting Value ecoratorClass getter, setter, and deleter Setting Value Getting Value Setting Value Getting Value 10 eleting Value Process returned (exe) Press any key to continue .. ._ execution time 0.084 s PropertyClass Variables Functions value get_value set_value del_value The PropertyClass should be initialized with and take in one variable called "value". It should default to 0 if nothing is passed to it The class should have: A getter function for value that will print out "Getting Value" and then return value A setter function for value that will print out "Setting Value" and then set the value A deleter function for value that will print out "Deleting Value" and then delete the value These three functions must then be passed into a property named value DecoratorClass Variables Functions value value value value The DecoratorClass should be initialized with and take in one variable called "value". It should default to 0 if nothing is passed to it The class should have: A getter function for value that will print out "Getting Value" and then return value A setter function for value that will print out "Setting Value" and then set the value A deleter function for value that will print out "Deleting Value" and then delete the value These three functions must use the @property decorator to specify whether they are a getter, setter, or deleter The output should look like this: PropertyClass getter, setter, and deleter Setting Value Getting Value Setting Value Getting Value 1e eleting Value ecoratorClass getter, setter, and deleter Setting Value Getting Value Setting Value Getting Value 10 eleting Value Process returned (exe) Press any key to continue .. ._ execution time 0.084 s

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

Neo4j Data Modeling

Authors: Steve Hoberman ,David Fauth

1st Edition

1634621913, 978-1634621915

More Books

Students also viewed these Databases questions

Question

Additional Factors Affecting Group Communication?

Answered: 1 week ago