DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
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

  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

Bookmarks

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


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links