Question: Object Oriented Program Aggregation Example: Use javadoc comments ON ALL METHODS OF THE CLASSES IN THIS PROGRAM. Here is the file data You may copy

Object Oriented Program
Aggregation Example: Use javadoc comments ON ALL METHODS OF THE CLASSES IN THIS PROGRAM.
Here is the file data
You may copy and paste this data to a filename of your choice:
Book, Writer, Address, Price, category
Algorithms to Live By,Christian and Griffiths,New York, 14.59,Programming
Computer Science, David Reed, New York, 78.99,Computer Science
Introduction to Java, Daniel Liang, Chicago, 117.56, Java
Simply Java, Harvey Deitel,Boston, 23.49, Java
Create a class called Writer with the following attributes and methods:
Writer Class
writerName: String
address : String
Use either String Tokenizer or the split string method to read the data.
all getters
all setters
default constructor
second constructor with name and address as parameters
copy constructor
any other constructors you may want to include
equals() THIS MUST BE THE EQUALS METHOD AND TOSTRING METHODS WE USE IN CLASS
toString()
Create a class called Book with the following attributes and methods:
Writer : writer
category : String
price : double
title: String
all getters
all setters
default constructor
second constructor with Writer, category, price, and name as parameters
any other constructors you may want to include
copy constructor
equals() THIS MUST BE THE EQUALS METHOD AND TOSTRING METHODS WE USE IN CLASS
toString()
reducePrice(percentage : double)- Create a method to be able to take the price and reduce it by a percentage of the total current price and print that out. You have direct access to that price.
Create a BookUtilities class with the following methods:
readAllBookData(books : ArrayList)- creates the ArrayList from the data file bookdata.txt Preview the document
displayAllBookData(books : ArrayList)- displays the ArrayList, nicely formatted
searchForCategory(books : ArrayList)- displays the Book object with a certain category passed in, search on a substring of the category.
searchForBook(books: ArrayList)- displays the Book object on a book that starts with a certain letter or few letters.
searchByPrice (books : ArrayList, double minPrice)- displays all Books with maxPrice price and below. So if I enter $30, it will list book <= $30.
sortyByWriter((books : ArrayList) : Sort the books by Writer, maybe a choice of ascending versus descending
Create an application that will :
Create an ArrayList of Book objects
call readAllBookData()
call displayAllBookData()
call searchByCategory()- the search comes from user input
call searchByPrice - the price comes from user input
call sortByWriter - The information about the books is sorted by Writer NOTE: You may have some scrubbing of the file to do. That means if there is bad data in there, get rid of that first. Please do not use the Collections Class
USE A MENU THAT STARTS THE PROGRAM OUT AND WORKS SEAMLESSLY AND EXITS UPON ONE OF THE OPTIONS. Only allow a user to enter numbers and if they enter anything else, send an error message back and return to the menu. You might want to use Character Wrapper class to look at the first character of the menu option?
Unit test (in comments) at the bottom of the driver showing me your testing for the copy constructors, copy method and the price discount method. PLEASEEEEE I NEED THE FULL CODE and it also has to read a file . my code only complies but wont run or output anything

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 Accounting Questions!