o urnament.javaThis file represents any Tournament that UEFA runs. Tournament.java is an abstract class.Variables:All variables should not be allowed to be directly modified outside the class in which...

1 answer below »
o urnament.javaThis file represents any Tournament that UEFA runs. Tournament.java is an abstract class.Variables:All variables should not be allowed to be directly modified outside the class in which they are declared, unless stated otherwise:•Stringname–the name of the tournament•int numTeams–the number of teams in a tournament (this must be an even number,otherwise set it to16)•boolean knockout–if it is a knockout tournament, this is true (default value is true). A knockout tournament is a tournament where the loser is immediately eliminated.•String finalReferee–the name of the referee for the final game of the tournament•int maxCapacity–the maximum capacity for all stadiums, which must be watched due to newly implemented COVID restrictions in Europe(this variable must be accessible only by all of Tournament’s subclasses, regardless of if they are in the same package or not)•int FINAL_CAPACITY–the maximum number of people allowed for the final game; UEFA wants this to be a smaller number, to make the final an intimate game between players and fans (this value must not be changeable after it is declared --this will be set to 30,000)Constructor(s):•A constructor that takes in name, numTeams, knockout, finalReferee, and maxCapacityoFirst, if the number of teamsis not even, set it to 16.oThen, if number of teams in the tournament is greater than 64, and it is not a knockout tournament, make it a knockout tournament (ie: set knockoutto true)Methods:All methods in this class should be public, unless stated otherwise:•toString()oThis method should properly override Object’s toString()methodoIf it is a knockout tournament, the toString()method should say “this isa KO tournament”; if not, it should say “this isn’ta KO tournament”oThe method should return:“Name: {name}, Number of Teams: {numTeams}, KO: this is/isn’ta KO tournament, Final Referee: {finalReferee}, Maximum Capacity: {maxCapacity}”•equals()oThis method should properly override Object’s equals()methodoIf two Tournaments have the same name, numTeams, and knockoutvalues, they are equal•refereeHire()oThis method is abstract and will take in a StringoIt will not return anything•Any necessary getter and setter methods (emphasis on necessary–don’t write any that have no use)S ummerShowdown.javaThis class describes one of UEFA’s new tournaments, Summer Showdown. This class will inherit from the Tournaments class.Variables:All variables mustnot beallowed to be directly modified outside the class in which they are declared, unless otherwise stated in the description of the variable.•String backupReferee–every referee can only referee one tournament’s final, so we have a backup referee just in caseConstructor(s):•A constructor that takes in numTeams, knockout, finalReferee, maxCapacity, and backupRefereeoReuse any code if you canoname will be “Summer Showdown”•A constructor that takes in finalRefereeand backupRefereeoUse constructor chaining if possibleonamewill be “Summer Showdown”, numTeamswill be 64, knockoutwill be false, and maxCapacitywill be 20,000Methods:All methods must have the proper visibility to be used where it isspecifiedthey are used.•toString()oThis method should properly override Object’s toString()methodoIt should print the following:“Name: {name}, Number of Teams: {numTeams}, Final Referee: {finalReferee}, Backup Referee: {backupReferee}, Maximum Capacity: {maxCapacity}”•equals()oThis method should properly override Object’s equals()methodoIf two SummerShowdownobjects have the same finalRefereeand maxCapacity, they are equal•refereeHire()oThis method should properly override the Tournamentclass’ refereeHire()methodoIf the inputted referee and SummerShowdown’s finalRefereeare the same, print, “We need a new referee! {inputReferee} is already refereeing the final!”and change backupRefereeto “Undecided”oIf backupRefereeand the input are the same, print, “Be ready for some conflicts!”and divide maxCapacityby 2 –this will reduce the pressure on the referees with a smaller crowdoOtherwise, print “Ready to play!”Co nferenceLeague.javaThis class describes the second of UEFA’s new tournaments, Conference League. This class will also inherit from the Tournaments class.Variables:All variables mustnot beallowed to be directly modified outside the class in which they are declared, unless otherwise stated in the description of the variable.•int teamsPerLeague–the number of participating teams from each league•String currentHolder–the current holder of the Conference League trophyConstructor(s):•A constructor that takes in finalReferee, teamsPerLeagueand currentHolderoUse constructor chaining if possibleonamewill be “Conference League”, numTeamswill be 32, knockoutwill be true, and maxCapacitywill be 15,000Methods:All methods must have the proper visibility to be used where it isspecifiedthey are used.•toString()oThis method should properly override Object’s toString()methodoIt should print the following:“Name: {name}, Number of Teams: {numTeams}, Final Referee: {finalReferee}, Teams per League: {teamsPerLeague}, Current Holder: {currentHolder}”•equals()oThis method should properly override Object’s equals()methodoIf two ConferenceLeague objects have the same currentHolderand finalReferee, they are equal•nextRound()oThis method does not return anythingoIt first checks if the tournament is a knockout tournament or not. If so, it checks whether there are more than 2 teams remaining or not:▪If there are more than 2 teams remaining, the number of teams is halved▪If not, it prints, “We have reached the final!” and checks if maxCapacityis greater than FINAL_CAPACITY; if so, it sets maxCapacityto the value of FINAL_CAPACITY•refereeHire()oThis method should properly override Tournament’s refereeHire()methodoIf the referees (the inputted one and ConferenceLeague’s one) are the same, print, “We need a new referee!”to a new line, and change the value of the ConferenceLeague’s referee to “Undecided”oOtherwise, print “We’re ready to go!”to a new line and set maxCapacityto double what it is –these referees can handle pressure from bigger crowdsTestingReuse your code when possible. Certain methods can be reused using certain keywords. These tests and the ones on Gradescope are by no means comprehensive, so be sure to create your own! CheckstyleYou may ignore the hashcode checkstyle error. We will not take points off for this error.Youmustruncheckstyleonyoursubmission(To learn more about Checkstyle, check out cs1331-style-guide.pdf under CheckStyle Resources in the Modules section of Canvas.) The Checkstyle cap for this assignment is 20 points.This means there is a maximum point deduction of 20. If you don't have Checkstyle yet, download it from Canvas -> Modules -> CheckStyle Resources -> checkstyle-8.28.jar. Place it in the same folder as the files you want to run Checkstyle on. Run checkstyle on your code like so:$java-jarcheckstyle-8.28.jaryourFileName.javaStartingaudit...Auditdone.ThemessageabovemeanstherewerenoCheckstyleerrors.Ifyouhadanyerrors,theywouldshowupabovethismessage,andthenumberattheendwouldbethepointswewouldtakeoff(limitedbythecheckstylecapmentionedintheRubricsection).Infuturehomeworkswewillbeincreasingthiscap,sogetintothehabitoffixingthesestyleerrorsearly!Additionally, you must Javadoc your code.Run the following to only check your Javadocs:$ java -jar checkstyle-8.28.jar -j yourFileName.java Run the following to check both Javadocs and Checkstyle:$ java -jar checkstyle-8.28.jar -a yourFileName.java For additional help with Checkstyle see the CS 1331 Style Guide.Turn-In ProcedureS ubmissionTo submit, upload the files listed below to the corresponding assignment on Gradescope:•Tournament.java•SummerShowdown.java•ConferenceLeague.javaMake sure you see the message stating the assignment was submitted successfully. From this point, Gradescope will run a basic autograder on your submission as discussed in the next section. Any autograder test are provided as a courtesy to help “sanity check” your work and you may not see all the test cases used to grade your work.You are responsible for thoroughly testing your submission on your own to ensure you have fulfilled the requirements of this assignment. If you have questions about the requirements given, reach out to a TA or Professor via Piazza for clarification.You can submit as many times as you want before the deadline, so feel free to resubmit as you make substantial progress on thehomework. We will only grade your latest submission. Be sure tosubmit every file each time you resubmit.Gradescope AutograderIf an autograder is enabled for this assignment, you may be able to see the results of a few basic test cases on your code. Typically, tests will correspond to a rubric item, and the score returned represents the performance of your code on those rubric items only. If you fail a test, you can look at the output to determine what went wrong and resubmit once you have fixedthe issue.The Gradescope tests serve two main purposes:•Prevent upload mistakes (e.g. non-compiling code)•Provide basic formatting and usage validationIn other words, the test cases on Gradescope are by no means comprehensive. Be sure to thoroughly testyour code by considering edge cases and writing your own test files. You also should avoid using Gradescope to compile, run, or Checkstyle your code; you can do that locally on your machine.Other portions of your assignment can also be graded by a TA once the submission deadline has passed, so the output on Gradescope may not necessarily reflect your grade for the assignment.AllowedImportsTopreventtrivializationoftheassignment,you are not allowed to import any classes or packages.FeatureRestrictionsThereareafewfeaturesandmethodsinJavathatoverlysimplifytheconceptswearetryingtoteachorbreakourautograder.Forthatreason,donotuseanyofthefollowinginyourfinalsubmission:•var(thereservedkeyword)•System.exit•System.arraycopy
Answered Same DayOct 13, 2021

Answer To: o urnament.javaThis file represents any Tournament that UEFA runs. Tournament.java is an abstract...

Swapnil answered on Oct 14 2021
124 Votes
93663/ConferencelLeague.java
93663/ConferencelLeague.java
public class ConfLeague extends Tment
{
    private
 int tPL;
    private String chldr;
    public ConfLeague(String fRef,int tPL,String chldr)
    {
        super("Conference League",32,true,fRef,15000);
        this.tPL = tPL;
        this.chldr = chldr;
    }
    @Override
    public String toString()
    {
        return "Name: Conference League ,"+"Number of Teams: "+super.getNumTeams()+", Final Referee:"+super.getfRef+" ,Teams each League: "+tPL+" ,Current Holder: "+chldr;
    }
    @Override
    public boolean eq(Object o) 
    {
        if (o == this) 
        {
            return true;
        }
        if (!(o instanceof ConfLeague)) 
        {
            return false;
        }
        ConfLeague c = (ConfLeague) o;
        return tPL.eq(c.tPL) && chldr.eq(c.chldr);
    }
    public void nRound()
    {
        if(tPL>2)
            tPL/=2;
        else
        {
            System.out.println("We have reached the final!");
            if(super.mCap>super.getFnlCap())
                super.mCap=super.getFnl...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here