//Mike Domzalski //trashisdead01100@aol.com /* Program is designed to calculate a skaters score */ package Domzalski6; import SavitchIn; public class domzalski6 { public domzalski6() { } public static void main (String args[]) { int count=0, numJudge=0, judge=0; int count2=0, numJudge2=0; double artHigh =-1, artLow=6, techHigh=0, techLow=7; double artScore, techScore=0, totalArtScore=0, totalTechScore=0; double finalScore, artScoreTotal=0, techScoreTotal=0; // Take score of skater and asking how many judges there are System.out.println("Processing Skater."); System.out.println("How many Judges?"); judge = SavitchIn.readLineInt(); // begin the main loop to calculate the Artistry score for skater while(judge > count) { // add 1 to # of jugdes & count to eventually end the loop count++; numJudge++; // Get the artistry score from the user System.out.println("Artistry Score from Judge " + numJudge); artScore = SavitchIn.readLineDouble(); // error check to score is valid while((artScore < 0) || (artScore > 6)) { System.out.print("Invalid Score - "); System.out.println("Enter between 0.1 and 6.0"); artScore = SavitchIn.readLineDouble(); }// end while artscore error check // check for high and low scores if(artScore >= artHigh) { artHigh = artScore; }// end if artist high score if(artScore <= artLow) { artLow = artScore; }// end if low score // add the art score to art score to get a total score artScoreTotal += artScore; } // end while /* calculate artistry score by subtracting highest/lowest score from total */ System.out.print("Subtracting high: " + artHigh); System.out.print(" and low: " + artLow); System.out.println(" from total: " + artScoreTotal); totalArtScore = artScoreTotal - (artHigh + artLow); System.out.println("Artistry Score for Skater is: " + totalArtScore); //Begin second loop to calculate the technical score for skater while (judge > count2) { // seperate count for a new while count2++; numJudge2++; System.out.println("Technical Score from Judge " + numJudge2); techScore = SavitchIn.readLineDouble(); // error check to score is valid while((techScore < 0) || (techScore > 6)) { System.out.print("Invalid Score - "); System.out.println("Enter between 0.1 and 6.0"); techScore = SavitchIn.readLineDouble(); }// end while techscore error check techScoreTotal += techScore; // check for high and low scores if(techScore >= techHigh) { techHigh = techScore; }// end if artist high score if(techScore <= techLow) { techLow = techScore; }// end if low score }// end while technical System.out.print("Subtracting high: " + techHigh); System.out.print(" and low: " + techLow); System.out.println(" from total: " + techScoreTotal); totalTechScore = techScoreTotal - (techHigh + techLow); System.out.println("Technical Score for Skater is: " + totalTechScore); // Final Output of skaters score finalScore = totalTechScore + totalArtScore; System.out.println("Your final total is: " + finalScore); }// end public main }// end public class