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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started