Question: Define a class checkAge that extends Book 2 class that we discussed in lecture 2 to include an attribute indicating the age that a book
Define a class checkAge that extends Book class that we discussed in lecture
to include an attribute indicating the age that a book aims. The constructor accepts the age as a
parameter. The class also provides an agelevel method that returns a string as follows:
a person is less than it says Kids books
a person is less than it says School books
a person is to it says Job related books
a person is or older it says Upper level books for seniors
After executing your program, the IDE console window might look like following sample
output:
Number of pages:
Number of definitions:
Definitions per page:
Enter your age:
You entered:
Book type for a person with an age of is: Job related books
For another run:
Number of pages:
Number of definitions:
Definitions per page:
Enter your age:
You entered:
Book type for a person with an age of is: School books
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
