Question: Add a private variable _ _ discount ( float ) in the Book class with a default value of 0 . 1 . Write a

Add a private variable __discount (float) in the Book class with a default value of 0.1.
Write a public method get_discount that returns the value of __discount.
Write another method set_discount to update the discount value (with input validation ensuring it is between 0 and 0.5).(python program)

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 Programming Questions!