Extra Inheritance
Extra Inheritance
Validation: publisher matches a format: only contains letters and spaces, publisher’s length from 1
to 20 chars.
2. Create a class called KidBook (This class is derived from Detective class)
It extends some fields: private int age, private String gender
Validation: age >=3 and age <=16; gender is “female” or “male”
3. Create a class BookStore. It contains the main method.
When the program runs, it shows a menu:
1. Create a new book
2. Display the book
3. Update the book
4. Exit
When user choosea the option 1. The program displays a submenu:
1. Create a Detective book
2. Create a Anime Book
3. Create a Kid Book
4. Back the main menu
When user chooses the option 2. The program will display the accepted book
When user chooses the option 3. User can update the book’s fields. If user accepts a empty
string for the field the the program keeps the old value of it.
For example: