The program must be completed using python ONLY The program must contain and use a main function
Fantastic news! We've Found the answer you've been seeking!
Question:
The program must be completed using python ONLY
Transcribed Image Text:
The program must contain and use a main function that is called inside of: If_name_ _main_": Create one file called "yourStudentid.py" that contains two classes, the PropertyClass and the DecoratorClass PropertyClass Variables Functions get_value set_value del_value 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 The DecoratorClass should be initialized with and take in one variable called "value". It should default to O 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 (Refer to slide 40 of Lecture 8's PowerPoint) The output should look like this: Propertyclass getter, setter, and deleter Setting Value Getting Value Setting Value Getting Value 10 Deleting Value DecoratorClass getter, setter, and deleter Setting Value Getting Value Setting Value Getting Value 10 Deleting Value Process returned e (exe) Press any key to continue execution time : e.084 s The program must contain and use a main function that is called inside of: If_name_ _main_": Create one file called "yourStudentid.py" that contains two classes, the PropertyClass and the DecoratorClass PropertyClass Variables Functions get_value set_value del_value 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 The DecoratorClass should be initialized with and take in one variable called "value". It should default to O 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 (Refer to slide 40 of Lecture 8's PowerPoint) The output should look like this: Propertyclass getter, setter, and deleter Setting Value Getting Value Setting Value Getting Value 10 Deleting Value DecoratorClass getter, setter, and deleter Setting Value Getting Value Setting Value Getting Value 10 Deleting Value Process returned e (exe) Press any key to continue execution time : e.084 s
Expert Answer:
Answer rating: 100% (QA)
class PropertyClass Set default value of variable value to 0 if no value is passed to constructor ot... View the full answer
Related Book For
Business Statistics a decision making approach
ISBN: 978-0133021844
9th edition
Authors: David F. Groebner, Patrick W. Shannon, Phillip C. Fry
Posted Date:
Students also viewed these programming questions
-
Must be completed in PYTHON only
-
Must be completed in Python only Question 3: [Dictionary: Text Messaging] On some basic cell phones, text messages can be sent using the numeric keypad. Because each key has multiple letters...
-
In this exercise you will create a program that identifies all of the words in a string entered by the user. Begin by writing a function that takes a string of text as its only parameter. Your...
-
+9.33 x 10 C +91 Find the net force on 92. 0.180 m +4.22 x 10 C +92 0.230 m- -8.42 x 10 C 93 F = force exerted on q2 by 91 F3 = force exerted on 92 by 93 F = 10.9 N F3 = 6.04 N Remember: Forces...
-
Kyle Corporation is comparing two different capital structures, an all-equity plan (Plan I) and a levered plan (Plan II). Under Plan I, the company would have 300,000 shares of stock outstanding....
-
In a crossover trial comparing a new drug to a standard, denotes the probability that the new one is judged better. It is desired to estimate and test H 0 : = 0.5 against H a : 0.5. In 20...
-
Mary Kay Morrow began working for Hallmark in 1982. At the beginning of 2002, Hallmark adopted the Hallmark Dispute Resolution Program, which required, among other things, that claims against the...
-
Supertronics, Inc., would like to know how the firms profitability is altered by product mix. Currently, product mix is determined by giving priority to the product with the highest per unit...
-
A child bounces a 48 g superball on the side- walk. The velocity change of the superball is from 23 m/s downward to 13 m/s upward. If the contact time with the sidewalk is 1 800 s, what is the...
-
The evening manager of a restaurant was very concerned about the length of time some customers were waiting in line to be seated. She also had some concern about the seating times that is, the length...
-
Calculate the CLV What is a limitation of using the online tool Average Customer Acquisition Cost $500 Customer Retention Rate 80.00% Average Annual Profit per Customer $1000.00
-
A triangle is formed by taking a point on the unit circle (cos, sin 0) and forming the lines connecting each pair of points among (0,0), (cos 0,0), and (cos, sin 0) as in the graph below. When the...
-
Critically examine theories and frameworks drawn from the broad study of Human Resource Management and related disciplines, and apply concepts to a tourism and hospitality context; Demonstrate an...
-
Determine the minimum resistance R in k of the following circuit to protect the LED from being broken by limiting the operating current below 1mA. Given the total voltage drop of the diode Vp = 0.7V;...
-
A BWR fuel assembly has a 5 * 5 square lattice with rod diameter of 1 0 . 2 mm and channel box inner width of 6 7 . 7 mm . Most of the fuel rods have full length of 3 . 7 m . Two rods have length of...
-
The most recent financial statements for Kerch, Incorporated, are shown here (assuming no income taxes): Income Statement Sales Costs Net income Balance Sheet $ 4,300 3,400 Assets $15,400 Debt Equity...
-
Bark River Machine and Tool Company Market Price, January 1 $60.00 Dividend, December 31 $2.00 Market Price, December 31 $65.00 Broker Commission, per Share Maintenance Margin Investor Money Invested...
-
Fiber Systems makes boat tops for a number of boat manufacturers. Its fabric has a limited two-year warranty. Periodic testing is done to determine if the warranty policy should be changed. One such...
-
Airgistics provides air consolidation and freight-forwarding services for companies that ship their products internationally. As a part of its commitment to continuous process improvement, Airgistics...
-
The first few years after the turn of the century saw a rapid increase in housing values, followed by a rapid decline due in part to the sub-prime crisis. The following table indicates the increase...
-
Lewis Edwards decides to branch out on his own and set up his own private practice as an accountant. Events occurring in March 2019 are as follows. Ignore GST. Required (a) After analyzing the events...
-
On 1 March 2017, James Taylor decided to open Taylors Tailormade that makes suits, trousers and jackets, and repairs and alters clothes. He contributed for this purpose sewing equipment $46 000 and a...
-
In December 2019, Mike Mills opened a miniature golf course to cater for the summer holiday tourists and completed the transactions below during its first month of operations. For the sake of...
Study smarter with the SolutionInn App