UNB/ CS/ David Bremner/ teaching/ java/ ComputerArray.java
public class ComputerArray{


    public static void main(String[] args){
        Computer[] table={
            new Computer("Pentium IV 3.2C",  2000,1200),
            new Computer("Athlon64 3400+",   2500, 1400),
            new Computer("Macintosh G5 2MHz",2000, 1000)
        };

        int bestI=0;
        double bestRatio=table[0].ratio();
        for (int i=0; i<table.length; i++){
            if (table[i].ratio()<bestRatio){
                bestRatio=table[i].ratio();
                bestI=i;
            }
        }
        System.out.println("best price performance is "+ table[bestI].getName());
    }
}
//