Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Array of References, StringTokenizer, Search and Sort in JAVA. 1) Code the class definition for a Book (see the data file) Write the two constructors,

Array of References, StringTokenizer, Search and Sort in JAVA.

1) Code the class definition for a Book (see the data file)

Write the two constructors, some fields can be constants

Write set( ) methods for price and quantity

Write get methods for title, ISBN, author, price, and quantity

Write a toString( ) method

Write an equals( ) method based on title of the book

Write a compareTo( ) method based on the title of the book

2) Write a driver with the main( ) method that:

Creates an array of Book references (see the data file)

Presents a menu with choices to

search for a particular book by title and if found allow the user to either change the price or the quantity

print the books in sorted order by title

quit the program

This is whats on the text file:

12 The Outsider,Stephen King,Scribner Book Company,30.00,978-1-5011-8098-9,May 2018,32 Shelter in Place,Nora Roberts,St. Martin's Press,27.99,978-1-250-16159-8,May 2018,14 Magnolia Table: A Collection of Recipes for Gathering,Joanna Gaines,William Morrow & Company,29.99,978-0-06-282015,Apr 2018,13 Oh the Places You'll Go!,Dr Seuss,Random House Children's Books,17.99,978-0-679-80527-4,Jan 1990,6 Calypso,David Sedaris,Little Brown and Company,28.00,978-0-316-39238-9,May 2018,21 Shadow Keeper,Christine Feehan,Berkley Books,7.99,978-0-451-49012-4,May2018,4 The Gray Ghost,Clive Cussler,G.P. Putnam's Sons,29.00,978-0-7352-1873-4,May 2018,17 Fairytale,Danielle Steel,Dell,8.99,978-1-101-88408-9,May 2018,2 12 Rules for Life: An Antidote to Chaos,Jordan B Peterson,Random House Canada,25.95,978-0-345-81602-3,Jan 2018,4 Educated: A Memoir,Tara Westover,Random House,28.00,978-0-399-59050-4,Feb 2018,2 Factfulness,Hans Rosling & Anna Rosling Ronnlund,Flatiron Books,27.99,978-1-250-10781-7,Apr 2018,1 Robin,Dave Itzkoff,Henry Holt & Company,30.00,978-1-62779-424-4,May 2018,3

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts of Database Management

Authors: Philip J. Pratt, Joseph J. Adamski

7th edition

978-1111825911, 1111825912, 978-1133684374, 1133684378, 978-111182591

More Books

Students also viewed these Databases questions