Java programming Formation Skydiving Leagues are regional, but belong to a Natio
ID: 3578414 • Letter: J
Question
Java programming
Formation Skydiving Leagues are regional, but belong to a National Organization known as the National Skydiving League. Each week during competition season, a draw, such as your last program has accomplished, is produced and all teams jumping in the Leagues that weekend jump the same draw within the class that they belong to.
Of course, a meet is only good if you can record the scores for the event, so you will use what you have already done, and add to it in the following way:
As you know a meet consists of up to 10 competition rounds, but regular meets consist of a minimum of 3 rounds. Each of these rounds is scored by judges, and the meet raw score is the summation of the rounds. Your program should allow you to enter the scores for each team that competes that weekend along with the class they belong to. 'You should be able to record the name of the team, the names of the Team Members (remember there are 5 people on a 4-way team including the camera flier), the team's class and the date and place of the event. A judge should be able to enter a round number, and select a team and enter the score for that round. In real life, each team would be assigned a number for the event, like 101, 102, etc., and that's how the teams are tracked in the computer system.
At the end of the meet, you need to produce a report broken down by class and ordered by average score with the name of each team, the names of the team members, the corresponding round skydive, and the score for each round and the average. An example of how this should look is this:
06/20/2014 Skydive Pepperell, CA
Class AAA
Tsunami
Manny Ramirez, Romelinda Brens, Rosa Mela, Cindi Barack, Lauren Do
Round 1: 15,12,B 19
Round 2: 22, Q, F, C 18
Round 3: J, M, D, P, O 22
Total 59
Average 18.3
Continue this example for each class and the teams under it.
MAJOR LEAGUE HINT: It would be helpful to separate out the draws into a class and run the rest of the assignment in the main. Remember that the draw, once produced, never changes, but the rest of the data does.
For points, a pro team averages about 21 or 22 a round. A top semi-pro 18 or 19.
Explanation / Answer
//Jump.java
import java.util.Random;
import java.util.Scanner;
import java.util.ArrayList;
public class Jump
{
public static void main(String[] args)
{
Random randomNumber = new Random();
Scanner inputClass = new Scanner(System.in);
ArrayList< Boolean > formationRound = new ArrayList< Boolean >();
for( int i = 0; i < 39; i++)// fills ArrayList
{
formationRound.add( false );
}
formationRound.set( 0, true );
int formation = 0;
int point = 0;
int roundClass = 0;
int roundNumber = 0;
int round = 0;
int i = 1;
boolean random = false;
boolean A = false;
boolean AA = false;
boolean AAA = false;
System.out.print( "1: Class A 2: Class AA 3: Class AAA ");
System.out.print( " Enter number 1-3 depending on class: " );
roundClass = inputClass.nextInt();
// A class
// six rounds
if( roundClass == 1 )
{
A = true;
round = 6;
formationRound.set( 1, true ); formationRound.set( 13, true );
formationRound.set( 3, true ); formationRound.set( 14, true );
formationRound.set( 5, true ); formationRound.set( 16, true );
formationRound.set( 8, true ); formationRound.set( 17, true );
formationRound.set( 10, true ); formationRound.set( 18, true );
formationRound.set( 11, true ); formationRound.set( 20, true );
formationRound.set( 12, true ); formationRound.set( 22, true );
}// end else
else // AA or AAA
{
System.out.print( "Enter if it is a 6 round or 10 round meet ");
round = inputClass.nextInt();
if( roundClass == 2 )
{
AA = true;
formationRound.set( 3, true ); formationRound.set( 12, true );
formationRound.set( 5, true ); formationRound.set( 16, true );
formationRound.set( 10, true ); formationRound.set( 17, true );
}
else
{
AAA = true;
}
}//end else
while( round > 0)
{
System.out.printf( " Round %d ", i++ );
point = 0;
while(point < 5)
{
if(point == 4 && random )
{
do
{
boolean notValid = true;
while(notValid)
{
formation = randomNumber.nextInt(38)+1; //generate number
if(!formationRound.get(formation))
{// deal with good formation
notValid = false;
}
}//end while notValid
}while((formation<23)||formation == 31);
}//end if point
else
{
do
{
boolean notValid = true;
while(notValid)
{
formation = randomNumber.nextInt(38)+1; //generate number 1-through ArrayList size
if(!formationRound.get(formation))
{ // deal with good formation
notValid = false;
}
}//end while notValid
}while(formation == 31);
}//end else point
if(formation < 23)
point += 2;
else
{
random =true;
point++;
}
if(formation > 22)// print out string randomletter
System.out.printf(" %s %s ",randomLetter(formation), formationName(formation));
else
System.out.printf(" %d %s", formation, formationName(formation));
}//end point loop
if(formation < 23)
{
formationRound.set( formation, true );
}
System.out.println();
System.out.printf( " %s ", point );
round--;
} // end outer while loop
}//end of main
public static String formationName(int g)
{
switch(g)
{
case 1: return "Snowflake Snowflake";
case 2: return "Sidebody Donut Sidebody Donut";
case 3: return "Side Flake Opal Turt";
case 4: return "Monopod Monopod";
case 5: return "Opal Opal";
case 6: return "Stardian Stardian";
case 7: return "Sidebuddies sidebuddies";
case 8: return "CandianTree CandianTree";
case 9: return "CatsAccordian CatsAccordian";
case 10: return "Dimond Bunyid";
case 11: return "Photon Photon";
case 12: return "Bundy Bundy";
case 13: return "Offset Spinner";
case 14: return "Bipole Bipole";
case 15: return "Catipilar Catipilar";
case 16: return "Compressed Box";
case 17: return "DanishTree Murphy";
case 18: return "Zircon Zircon";
case 19: return "Ritz Icepick";
case 20: return "Piver Viper";
case 21: return "ZigZag Marguis";
case 22: return "ZigZag Marguis";
case 23: return "Unipod";
case 24: return "Stairstep Diamond";
case 25: return "MurphyFlake";
case 26: return "Yuan";
case 27: return "Meeker";
case 28: return "Open Accordian";
case 29: return "Cataccord";
case 30: return "Bow";
case 31: return "Donut";
case 32: return "Hook";
case 33: return "Adder";
case 34: return "Star";
case 35: return "Crank";
case 36: return "Satelit";
case 37: return "Sidebody";
case 38: return "Phalanx";
case 39: return"";
default: return"";
}//end of switch
}//end of String
public static String randomLetter (int f)
{
if (f>22)
switch (f)
{
case 23: return "A";
case 24: return "B";
case 25: return "C";
case 26: return "D";
case 27: return "E";
case 28: return "F";
case 29: return "G";
case 30: return "H";
case 31: return "I";
case 32: return "J";
case 33: return "K";
case 34: return "L";
case 35: return "M";
case 36: return "N";
case 37: return "O";
case 38: return "P";
case 39: return"";
default: return"";
}//end of switch
return"";
}//end of String
}//end of class
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.