Question: 5:18 f Expert Q&A + create a class called book Book will be a simple class consisting of fou fields: name: string representing the name

 5:18 f Expert Q&A + create a class called book Book

5:18 f Expert Q&A + create a class called book Book will be a simple class consisting of fou fields: name: string representing the name of book, such as "Data Structure" author: string representing the name of author of the book such as "Clifford Shi publish Year: int representing the year th book has been published such as 2019 .pages: int number of pages of the book as 234 Your Book class should have the following methods: Book(name, author,publish Year,pages) Constructor .getName(): string // Returns a Book's n .getAuthor(): String // Returns a Book's i getPublish Year: int // Returns a Book: publish year .getPages(): int The constructor should throw an error if any following are true: The name is an empty string. . The author is an empty string The publishYear is less than equal to 19

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!