โ Back to Classes
Question 428
Book Describe Class
Book Describe Class
Create a classBookwhose constructor takes a title and an author, and aDescribe()method that returns the text "<title> by <author>". Do not write aMainmethod. Fornew Book("The Hobbit", "Tolkien")the program prints: The Hobbit by Tolkien
Expected Output:
The Hobbit by Tolkien
Topics:
Classes
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท Ctrl+Space to expand shortcuts (cw, cr, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.