/* * Sahil Patel * ACSL Contest #1 * Junior * Teacher - Reg Hahne */ import java.util.Scanner; public class NFLDraftJuniorClient { public static void main(String[] args) { //connect to file Scanner kbd = new Scanner(System.in); //declare variable int years, tally = 0, player = 0; double pay, payPlayer1 = 0, payPlayer2 = 0, payPlayer3 = 0, payPlayer4 = 0, payPlayer5 = 0, average = 0, low16 = 1000000, high18 = 100000, diff = 0, average16, average18; //loop annual pay more than 10 million determination process for(int index = 1; index <= 5; index++) { player++; //get user input System.out.println("Player " + player); System.out.println("Please enter the number of years for the player"); years = kbd.nextInt(); System.out.println("Please enter the amount of pay for the player"); pay = kbd.nextDouble(); System.out.println(""); if((pay / years) > 10) tally++; if(payPlayer1 == 0) payPlayer1 = (pay / years); else if(payPlayer2 == 0) payPlayer2 = (pay / years); else if(payPlayer3 == 0) payPlayer3 = (pay / years); else if(payPlayer4 == 0) payPlayer4 = (pay / years); else if(payPlayer5 == 0) payPlayer5 = (pay / years); if((((pay / years) * 1000000) / 16) < low16) low16 = (((pay / years) * 1000000)/ 16); if((((pay / years) * 1000000) / 18) > high18) high18 = (((pay / years) * 1000000) / 18); } average = ((payPlayer1 + payPlayer2 + payPlayer3 + payPlayer4 + payPlayer5) / 5) * 1000000; average16 = average / 16; average18 = average / 18; diff = average16 - average18; System.out.println(tally); System.out.printf("%,(.0f", average); System.out.println(""); System.out.printf("%,(.0f", low16); System.out.println(""); System.out.printf("%,(.0f", high18); System.out.println(""); System.out.printf("%,(.0f", diff); } } /* *Run #1 *Player 1 Please enter the number of years for the player 6 Please enter the amount of pay for the player 72 Player 2 Please enter the number of years for the player 5 Please enter the amount of pay for the player 61.775 Player 3 Please enter the number of years for the player 5 Please enter the amount of pay for the player 57 Player 4 Please enter the number of years for the player 6 Please enter the amount of pay for the player 60 Player 5 Please enter the number of years for the player 5 Please enter the amount of pay for the player 60 4 11,551,000 625,000 686,389 80,215 *