Question: IN PYTHON: Define a class named Book. Each instance of Book should have three instance variables: title, author, checked_out. The Book constructor should take two

IN PYTHON:

Define a class named Book. Each instance of Book should have three instance variables: title, author, checked_out.

The Book constructor should take two arguments, title and author. Use these to set the initial values for the corresponding instance variables. The instance variable checked_out should be set to False.

add these methods to the class Book:

checkitout (no arguments): sets the book's checked_out attribute to True

checkitin (acceptsa Library instance as its argument): call the library's willAccept() method on the current book. If library will accept it, set the checked_out attribute of the book to False. Otherwise, do not modify it.

tobechecked (no arguments): Return True if the checked_out attribute is False and False otherwi

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!