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 sortByAuthor - The information about the books is sorted by author NOTE: You may have some scrubbing of the file to do. Please do not use the Collections Class to sort.
In java Create a class called Author with the following attributes and methods:
Here is the file: bookData
Book, Author, Address, Price, category
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
name : String
address : String
all getters
all setters
default constructor
second constructor with name and address as parameters
copy constructor
equals()
toString()
Create a class called Book with the following attributes and methods:
author : Author
category : String
price : double
name: String
all getters
all setters
default constructor
second constructor with author, category, price as parameters
copy constructor
equals()
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<Book>) - creates the ArrayList from the data file bookdata.txt Preview the document
displayAllBookData(books : ArrayList<Book>) - displays the ArrayList, nicely formatted
searchForCategory(books : ArrayList<Book>) - displays the Book object with a certain category passed in, search on a substring of the category.
searchForBook(books: ArrayList<Book>) - displays the Book object on a book that starts with a certain letter or few letters.
searchByPrice (books : ArrayList<Book>, double minPrice) - displays all Books with maxPrice price and below. So if I enter $30, it will list book <= $30.
sortyByAuthor((books : ArrayList<Book>) : Sort the books by author, 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 sortByAuthor - The information about the books is sorted by author NOTE: You may have some scrubbing of the file to do. Please do not use the Collections Class to sort.
Trending now
This is a popular solution!
Step by step
Solved in 5 steps