Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package coltonsSAt;
- public class SatProcessor
- {
- public static void main(String[] args) {
- SatData data = new SatData();
- int arraylength = data.length;
- String[] statenames = new String[arraylength];
- int [] combinedscore = new int [arraylength];
- int i = 0;
- while (data.hasNext()){
- statenames[i] = data.getState();
- combinedscore[i] = data.getCombinedScore0();
- i++;
- }
- while (data.hasNext()) {
- System.out.printf("State: %-15s Average score: %5d%n", data.getState(), data.getCombinedScore());
- }
- System.out.println("No more data");
- }
- public static double average(int[] combinedscore){
- int sum = 0;
- for(int i: combinedscore){
- sum += i;
- }
- return sum / combinedscore.length;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement