Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Create a Book class with the following characteristics: Private member variables: autherName ( String ) , numQfPages ( int ) , price ( double )
Create a Book class with the following characteristics:
Private member variables: autherNameString numQfPages int pricedouble isbnint
Public methods: input constructor, getters, setters, toString equalsnote: two Book objects are considered equal if they have the same isbn.
Create a BookArrayStack class
Private members: data array holding Book objects topint
Public members: constructor, isEmpty pop push pee
tableBookArraystackdata:Booktop:intBookArrayStackintpushBook:voidpop:Bookpeek:BookisEmpty:boolean
Implement a BookNode node class and the following BookLinkStack class.
tableBookLinkStacktop:BookNodemanyNodes:intBookLinkStackpushBook:voidpop:Bookpeek:BookisEmpty:boolean
Describe the difference between the push and peek methods in a stack class. When would you use each one?
Consider the following five statements.
mustack.Qushbook;
mxstack.Rushbook:
Book aBeok mxstack.reek l
Book bBook mustack. opl;
mostack.lushaBook:
Draw the maStack after each statement is executed if
a mxStack is an object of type BadkAmaxStack
b mystack is an object of type BookLinkStack
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started