Question
In honor of the Winter Olympics, our Projects this semester will have a Winter Olympics theme. For Project #1, we'll be building, documenting and testing
In honor of the Winter Olympics, our Projects this semester will have a Winter Olympics theme. For Project #1, we'll be building, documenting and testing Objects and Enums that we will need to simulate our own Winter Olympics. The specification for our Objects, Enums and Driver is provided below. Also provided below are UML Diagrams depicting what our Objects should contain.
----------------------------------------------------------------------------------------
Athlete Object (Remember to consult the UML for attribute data types, method parameters and method return data types!):
Athletes should have:
A name attribute
A country attribute
A type of event attribute
A skill attribute
A counter for number of GOLD medals won (we will ignore silver and bronze medals for this version of the project)
A full parameter constructor (a constructor with a parameter for each of the 5 fields)
A default parameter constructor
A get method for each field
A set method for each field
Verify at 1 character was entered for the name! If not, set the Athlete's name as DEFAULT.
Verify that skill entered is between 0 and 10! If not, set the Athlete's skill as 0.
Verify that gold medals entered is not negative! If value entered for medals is negative, set medals value to 0.
A toString() method
An equals() method
MAKE SURE YOU HAVE JAVADOC COMMENTS FOR THE CLASS AND THE METHODS!!!
Class Level JavaDoc comments need AT LEAST:
The author(s) tag(s)
A description about what this class/object is for
Method Level JavaDoc comments need AT LEAST:
A description of what the method does
param tag(s) describing the input data if the method needs input data
return tag describing the returned output data if the method returns data
-----------------------------------------------------------------------------------------------
Event Object (Remember to consult the UML for attribute data types, method parameters and method return data types!):
Events should have:
A specific event name attribute
A venue attribute
A type of event attribute
A list of Athletes attribute
A full parameter constructor (a constructor with a parameter for each of the 4 fields)
A default parameter constructor
A get method for each field
A set method for each field
Verify that list of Athletes attribute has at least 1 Athlete! Otherwise, print an error message saying that competitions need at least 1 Athlete in order to run.
A toString() method
An equals() method
A compete() method which calculates the winning Athlete. This method should work by looping through the list of Athletes and, for each Athlete, generating a random number from 1 to 100 (both values inclusive) and adding the Athlete's skill attribute to the random number. The Athlete with the greatest sum (random value + Athlete's skill) is the winner of the event.
MAKE SURE YOU HAVE JAVADOC COMMENTS FOR THE CLASS AND THE METHODS!!!
Class Level JavaDoc comments need AT LEAST:
The author(s) tag(s)
A description about what this class/object is for
Method Level JavaDoc comments need AT LEAST:
A description of what the method does
param tag(s) describing the input data if the method needs input data
return tag describing the returned output data if the method returns data
-----------------------------------------------------------------------------------------------
Country Enum:
Must include a default value and AT LEAST 10 countries from this list --> https://www.pyeongchang2018.com/en/countries
Must include a method which returns a randomly select a Country Enum value
-----------------------------------------------------------------------------------------------
EventType Enum:
Must include a default value and all 15 general events listed here --> https://www.pyeongchang2018.com/en/game-time/results/OWG2018/en/general/competition-schedule.htm
Must include a method which returns a randomly select a EventType Enum value
-----------------------------------------------------------------------------------------------
Venue Enum:
Must include a default value and all 13 venues listed here --> https://www.pyeongchang2018.com/en/venues
Must include a method which returns a randomly select a Venue Enum value
-----------------------------------------------------------------------------------------------
The Driver:
The Driver Class will need:
A main() method which will:
Randomly select 5 event types.
Create 3 Athletes for each of the 5 selected event types. Data for each Athlete should be generated by:
Hardcoded name data
Randomly selected country data
event type data as per the 5 event types selected at the beginning
Randomly selected skill data (from 1 to 10, both values inclusive)
Medal count data should start at zero
Create 1 event for each of the 5 selected event types. Data for each Event should be generated by:
Hardcoded name data
Randomly selected venue data
event type data as per the 5 event types selected at the beginning
Use an array of the Athletes you created with the the same event type attribute
For each Event, use the compete() method to determine the winning Athlete AND print the winning Athlete's information along with the name of the Event that the Athlete won.
Also include code to test any other methods from Athlete and Event which the above main() method code did not test.
You may add additional attributes and/or methods to Athlete, Event, and your Driver if they will help you solve the problem.
I just need help setting up code in Java.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started