i'm trying to write a program that creates of an array of books. i need to have methods that will find the highest and lowest name & price of the books, the number of hardcover/paperback books, and the average price of hardcover/paperback books. any help will be greatly appreciated!!!
Well
i take a look at you're book class code
well java allow you to creat array of any objet
so you just need to go about it this way
book [] Collection=new book[45];// don't forget to instanciate this array with filling every fields of the book class
and eventually have a double array (the prices of them books)
and then you could easily find the minimuim of that newly created double array;double[]
pricescollecti=new double[45];
for(int i=0;i<45;i++){
pricesColoection[i]=bookColloction[i].price;}
then you''d just have to creat
methode comparing the elemet of and array
good luck!
Bookmarks