arrays


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: arrays

  1. #1
    Join Date
    Feb 2005
    Posts
    4

    Question arrays

    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!!!
    Attached Files Attached Files

  2. #2
    Join Date
    Dec 2004
    Location
    france
    Posts
    35
    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!

  3. #3
    Join Date
    Feb 2005
    Posts
    4

    array

    thanks for the help

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center