title: Displaying two arrays in tester class
body: <p>I have six tasks that need to be completed but i do not know how to display them. I haave all the code to calculate each task needed but when it comes to applying them to my tester class i am stuck. below is my code for the original class. these are the task that need to be done:</p>
  
  <ol>
  <li>Display the original data set, as shown in the table.</li>
  <li>The average profit for the supermarket chain.</li>
  <li>The city with the highest profit.</li>
  <li>A list of all the cities with profit at, or above the average.</li>
  <li>The cities and their profit listed in descending order of the profits.</li>
  <li>Make a horizontal graph showing the performance of each supermarket</li>
  </ol>
  
  <p>Please help because ive been doing this for the last couple days and still havent been able to do anything... i must be stupid please help</p>
  
  <pre><code>package supermarkets;
  
  public class Supermarkets 
  {
  
      private String[] city = {"Miami", "Sunrise", "Hollywood",
          "Tallahassee", "Jacksonville", "Orlando", "Gainesville", "Pensacola",
          "Ocala", "Sebring"};
  
      private double[] profit = {10200000, 14600000, 17000000, 6000000,
          21600000, 9100000, 8000000, 12500000, 2000000, 4500000};
  
      public Supermarkets(String[] c, double[] p)
      {
          //array for the city
          city = new String[c.length];
          for (int i = 0; i &lt; c.length; i++)
              city[i] = c[i];
  
  
          //array for the profits
          profit = new double[p.length];
          for(int i = 0; i &lt; p.length; i++)
              profit[i] = p[i];
      }
  
  
      //sums up the profits from the cities
      public double sumArray()
      {
          double sum = 0;
  
          for (int i = 0; i &lt; profit.length; i++)
              sum = sum + profit [i];
  
          return sum;
      }
  
      //calculates the average of the profits from the cities
      public double average()
      {
          return sumArray() / profit.length;
      }
  
  
      //shows highest profit
      double findHighestProfit() 
      {
          double highest = profit[0];
  
          for(int i = 1; i &lt; profit.length; i++)
          {
              if ( profit [i] &gt; highest )
                  highest = profit [i];      
          }
          return highest;
      }
  
  
      //gives the above average profit
      public String aboveAvarage()
      {
          String s = "";
          double avg = average();
          for (int i = 0; i &lt; profit.length; i++)
              if (profit [i] &gt; avg)
                  s = s + city[i] + "  " + profit[i] + "\n";
          return s;
      }
  
  
      //creates a graph showing city and profits
      public String makeGraph()
      {
          String s = "";
          for (int i = 0; i &lt; profit.length; i++)
          {
              s = s + city[i] + " ";
              int x = (int) Math.floor( profit[i] );
  
              for(int j = 1; j &lt;=x; j++)
                  s = s + "*";
              s = s + "\n";
          }
          return s;
      }
  
  
      //resets profits position from least to greatest
      public int findPosition(int startScanFrom)
      {
          int position = startScanFrom;
  
          for (int i = startScanFrom + 1; i &lt; profit.length; i++)
              if (profit[i] &lt; profit[position])
                  position = i;
  
          return position;
      }
  
      //swaps values for city and profits
      public void swap(int i, int j)
      {
          // Swap the profits
          double temp = profit[i];
          profit[i] = profit[j];
          profit[j] = temp;
  
          // Swap the cities
          String str = city[i];
          city[i] = city[j];
          city[j] = str;
      }
  }
  </code></pre>