In: Computer Science
Problem Statement – Gymnastics Contest Java
The Adelaidean Gymnastics Federation is an organisation devoted to running the best Gymnastics contests in all of Adelaide.
In 2031, the School of Computer Science from the University of Adelaide was chosen to develop the Gymnastic Contest software. The competition has few criteria. The winner of the competition must demonstrate skills of good balance. Competitors must have the ability to jump high. A contestant should demonstrate coordination, strength and exhibit aesthetics during their routine. In this final project we require you to design all the features and functionalities for this event to happen.
We are focused on the final for this contest, when each finalist will be judged by the five skills aforementioned in a scale from 0.0 to 10.0. Besides, this the system also has to store competitors name, age and suburb and each finalist contains a moto, like “ I can bounce higher than anyone else!”
Requirements:
Design and develop the classes Contestant, Finalist and Contest.
● [30 % marks] Contestant: consist of a competitor;
● [30% marks] Finalist: consist of a Contestant Competitor that got into the finals in the gymnastics competition.
● [40 % marks] Contest : basic functionalities to guarantee that the contest will
happen; Specifications for the class Contestant:
Design and develop the classes Contestant, Finalist and Contest.
The class Contestant is a general class that represent any sort of competitor;
Requirements:
1. Implement the accessors and mutators;
2. Implement the parameters constructors;
a. Name, suburb, age;
b. Name, suburb, age and the skils: balance, jump, coordination, strength, aesthetics;
3. Implement function getMean(): this method aims to return the mean score of all skills from a Contestant;
Constraints:
1. Comment this code to acquire code style marks;
2. This problem represents 30% of your marks
a. Full marks: use abstraction, implement 1,2,3;
b. Half marks: implement at least 1,2;
c. No marks: doesn’t compile;
Specifications for the class Finalist:
/* * * * * * * *
class Finalist
This class inherit properties from the class Contestant.
This class aims to represent the Finalist of gymnastics contest for 2031
Requirements:
1. Implement the accessors and mutators;
a. moto;
2. Implement method display which displays each field of this contestant on a separate line with the name of the field then a “:” and then the value of the fields;
Constraints:
1. This problem represents 30% of your marks
a. Full marks: use inheritance, implement 1,2;
b. Half marks: implement at least 1,2;
c. No marks: doesn’t compile;
2. Observe that the property moto belongs to Finalist;
class Contest
This class depends on the data structure FinalistList containing items of the class Finalist.
This class aims to represent the Gymnastics Contest Final for the year 2031.
Requirements:
For the class Contest:
1. Implement method addFinalist;
2. Implement a method sortFinalist; that sorts by the mean of skills.
3. Implement the method printFinalists;
Constraints:
1. There are no restrictions regarding what resources use in order to implement this problem; it means that you can use either array, list, linked lists, etc...
2. There is a MAX NUMBER of 5 Finalists;
3. This problem represents 40% of your marks
a. Full marks: use linked list, and implement 1,2,3
b. Half marks: use array implement at least 2 out of 3;
c. No marks: doesn’t compile;
Details
addFinalist will take a Finalist as a parameter and add the finalist to the list if the number of finalist is beyond MAX_NUMBER an IndexOutOfBoundsException should be thrown.
sortFinalist will sort the FinalistList structure by the mean of the skills of the Finalists.
printFinalist will print the members of FinalistLists by calling display on each of the Finalist in
that list in the order they appear in that list.
Here is the answer for your question in Java Programming Language.
Kindly upvote if you find the answer helpful.
NOTE : For the skills attribute I have taken it as a double array just to store scores of the skills. If you want to store name and scores as well you can declare it as a class and use its array of objects. Please comment below if you need any guidance to create skills class.
########################################################################
CODE :
contestant.java
public class Contestant { //Accessors public String getName() { return name; } public void setName(String name) { this.name = name;
} |
###########################################################
Finalist.java
import java.text.DecimalFormat; public Finalist(String name, String suburb, int
age,String motto) { |
####################################################################
contest.java
public class Contest { //default Constructor |
##################################################################
ContestDriver.java
public class ContestDriver { public static void main(String[] args){ Contest finalContest = new Contest(); try{ double[] skills1 = {5.5,4.3,6.5,3.4,7}; finalContest.addFinalist(new Finalist("John Doe","Suburb1",30,skills1,"I can bounce higher than anyone else")); double[] skills2 = {6.4,3.3,9.8,3.4,7}; finalContest.addFinalist(new Finalist("James Williams","Suburb2",25,skills2,"I am the strongest man")); double[] skills3 = {5.5,3.3,10.0,3.4,7}; finalContest.addFinalist(new Finalist("Albert Thomas","Suburb3",38,skills3,"Coordination leads to success")); double[] skills4 = {5.9,3.3,7.4,8.0,6.8}; finalContest.addFinalist(new Finalist("Louis Philip","Suburb4",32,skills4,"I can balance anything with ease")); double[] skills5 = {3.3,3.1,10.00,4.9,5.9}; finalContest.addFinalist(new Finalist("Lina Roy","Suburb5",34,skills5,"I can jump higher that anyone else")); System.out.println("Before sorting : "); finalContest.printFinalists(); finalContest.sortFinalist(); System.out.println("After sorting : "); finalContest.printFinalists(); }catch(IndexOutOfBoundsException e){ System.out.println("ERROR : Max of 5 Finalists allowed"); } } } |
#############################################################
Contestant.java
#######################################################################
Finalist.java
#####################################################################
contest.java
######################################################################
ContestDriver.java
###################################################################
OUTPUT :
Any doubts regarding this can be explained with pleasure :)