[Solved] Class called Book

$25

File Name: Class_called_Book.zip
File Size: 160.14 KB

SKU: [Solved] Class called Book Category: Tag:
5/5 - (1 vote)

Write a complete class called Book that has private instance variables for the title and author of the book and the following methods:

  • A default constructor that sets the title to Untitled and the author to Anonymous
  • A two-argument constructor that initializes the author and title to the provided arguments.
  • A public void method called display that displays the title, the word by, and the author. For example if the title is The Handmaids Tale and the author is Margaret Atwood, the method would display:
The Handmaid's Tale by Margaret Atwood

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] Class called Book
$25