1 class Book Info: 3 5 def _init_(self): self.genre = 'unknown' self.num chapters = 0 6 book BookInfo() 7 book.genre = input() 8 book.num_chapters = int(input()) 9 10 Your code goes here ** 11

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter11: Advanced Inheritance Concepts
Section: Chapter Questions
Problem 17RQ
icon
Related questions
Question

Output the attributes of the BookInfo object book as follows:

  • 'Genre: ' followed by book's genre
  • 'Chapters: ' followed by book's num_chapters
1 class Book Info:
3
5
def
_init_(self):
self.genre = 'unknown'
self.num chapters = 0
6 book BookInfo()
7 book.genre = input()
8 book.num_chapters = int(input())
9
10 Your code goes here **
11
Transcribed Image Text:1 class Book Info: 3 5 def _init_(self): self.genre = 'unknown' self.num chapters = 0 6 book BookInfo() 7 book.genre = input() 8 book.num_chapters = int(input()) 9 10 Your code goes here ** 11
AI-Generated Solution
AI-generated content may present inaccurate or offensive content that does not represent bartleby’s views.
steps

Unlock instant AI solutions

Tap the button
to generate a solution

Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage