Answer to Question #295010 in Python for dv13

Question #295010

Note: This question is part 2 of question #295009 so please answer the take both questions as one question and then answer. please thank you.


c. Book class should include a constructor and the following methods: -  

 - setBookISBN: to set the ISBN for the book. (Hint: You can use ISBN class input method) 

- DisplayBookISBN: to get the ISBN of the book. (Hint: You can use ISBN class method) 

- display details: to display all the information of a book which includes Books ISBN, title, authorName, publisherName, Address (Country, City, Street Name and House Number) and price.  

 

Question 2: 

Create class diagram of Question-01. 


1
Expert's answer
2022-02-08T09:35:26-0500


class ISBN:
    def __init__(self,ISBNBook):
        self.ISBNBook=ISBNBook


    def setBookISBN(self):
        self.ISBNBook=input("Enter ISBN: ")


 
        
class Book(ISBN):
    def __init__(self,title,authorName,publisherName,address,price):
        self.title=title
        self.authorName=authorName
        self.publisherName=publisherName
        self.address=address
        self.price=price
        
    def setBook_ISBN(self):
        self.setBookISBN();
        self.title=input("Enter title: ")
        self.authorName=input("Enter author name: ")
        self.publisherName=input("Enter publisher name: ")
        self.address=input("Enter address: ")
        self.price=float(input("Enter price: "))
        
 
    def DisplayBookISBN(self):
        print(f"ISBN: {self.ISBNBook}")
        print(f"Title: {self.title}")
        print(f"Author name: {self.authorName}")
        print(f"Publisher name: {self.publisherName}")
        print(f"Address: {self.address}")
        




b=Book("title","author name","Publisher name","Address",45)
b.setBook_ISBN()
b.DisplayBookISBN()






Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS