Scores - scores=IO.readDouble if(n == 0{largest = scores...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
public class Scores { public static void main(String[] args) { int judges = IO.readInt(); double scores; int n; double largest = 0; double smallest = 0; double total = 0; while (judges < 3) { IO.reportBadInput(); judges = IO.readInt(); } for (n = 0; n < judges ; n++) { scores = IO.readDouble(); while (scores < 0|| scores > 10) { IO.reportBadInput();
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: scores=IO.readDouble(); } } if (n == 0 ) {largest = scores; smallest = scores; total = total + scores;} s else {if (scores > largest) {largest = scores;} if (scores < smallest) {smallest = scores;} total=total+scores;} } total = ((total - (largest + smallest))/(judges-2)); t IO.outputDoubleAnswer(total); } }...
View Full Document

This note was uploaded on 07/12/2009 for the course CS 111 taught by Professor Hari during the Fall '08 term at Rutgers.

Ask a homework question - tutors are online