Advertisement
Guest User

Untitled

a guest
Nov 25th, 2014
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.76 KB | None | 0 0
  1. package coltonsSAt;
  2.  
  3.     public class SatProcessor
  4.  
  5.     {
  6.  
  7.     public static void main(String[] args) {
  8.  
  9.     SatData data = new SatData();
  10.  
  11.     int arraylength = data.length;
  12.  
  13.     String[] statenames = new String[arraylength];
  14.    
  15.     int [] combinedscore = new int [arraylength];
  16.  
  17.     int i = 0;
  18.  
  19.     while (data.hasNext()){
  20.  
  21.     statenames[i] = data.getState();
  22.     combinedscore[i] = data.getCombinedScore0();
  23.     i++;
  24.  
  25.    
  26.     }
  27.    
  28.  
  29.    
  30.  
  31.     while (data.hasNext()) {
  32.  
  33.     System.out.printf("State: %-15s Average score: %5d%n", data.getState(), data.getCombinedScore());
  34.  
  35.     }
  36.  
  37.     System.out.println("No more data");
  38.  
  39.     }
  40.  
  41.     public static double average(int[] combinedscore){
  42.         int  sum = 0;
  43.         for(int i: combinedscore){
  44.             sum += i;
  45.            
  46.         }
  47.         return sum / combinedscore.length;
  48.        
  49.     }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement