import java.util.ArrayList;
import java.util.List;

class NBAPlayer {
    private String name;
    private int jerseyNumber;

    // Constructor for creating NBAPlayer objects
    public NBAPlayer(String name, int jerseyNumber) {
        this.name = name;
        this.jerseyNumber = jerseyNumber;
    }

    // Getter method for retrieving the player's name
    public String getName() {
        return name;
    }

    // Getter method for retrieving the player's jersey number
    public int getJerseyNumber() {
        return jerseyNumber;
    }

    // Override the toString() method to provide a custom string representation of the player
    @Override
    public String toString() {
        return "Player: " + name + " (#" + jerseyNumber + ")";
    }
}

class NBATeam {
    private String name;
    private List<NBAPlayer> roster;

    // Constructor for creating NBATeam objects
    public NBATeam(String name) {
        this.name = name;
        this.roster = new ArrayList<>();
    }

    // Method to add a player to the team's roster
    public void addPlayer(NBAPlayer player) {
        roster.add(player);
    }

    // Method to display the team's roster
    public void displayRoster() {
        System.out.println("Roster for " + name + ":");
        for (NBAPlayer player : roster) {
            System.out.println(player);
        }
        System.out.println();
    }
}

public class Main {
    public static void main(String[] args) {
        // Create two NBA teams
        NBATeam lakers = new NBATeam("Los Angeles Lakers");
        NBATeam warriors = new NBATeam("Golden State Warriors");

        // Add players to the teams
        lakers.addPlayer(new NBAPlayer("LeBron James", 23));
        lakers.addPlayer(new NBAPlayer("Anthony Davis", 3));

        warriors.addPlayer(new NBAPlayer("Stephen Curry", 30));
        warriors.addPlayer(new NBAPlayer("Klay Thompson", 11));

        // Display the rosters of both teams
        lakers.displayRoster();
        warriors.displayRoster();
    }
}

// Entry point of the program, calling the main() method to execute the code
Main.main(null);
Roster for Los Angeles Lakers:
Player: LeBron James (#23)
Player: Anthony Davis (#3)

Roster for Golden State Warriors:
Player: Stephen Curry (#30)
Player: Klay Thompson (#11)
import java.util.Random;

class MLSTeam {
    private String name;
    private int goalsScored;

    // Constructor for creating MLSTeam objects
    public MLSTeam(String name) {
        this.name = name;
        this.goalsScored = 0;
    }

    // Getter method for retrieving the team's name
    public String getName() {
        return name;
    }

    // Method to increment the team's goal count
    public void scoreGoal() {
        goalsScored++;
    }

    // Getter method for retrieving the team's total goals scored
    public int getGoalsScored() {
        return goalsScored;
    }
}

class MLSMatch {
    private MLSTeam homeTeam;
    private MLSTeam awayTeam;

    // Constructor for creating MLSMatch objects with home and away teams
    public MLSMatch(MLSTeam homeTeam, MLSTeam awayTeam) {
        this.homeTeam = homeTeam;
        this.awayTeam = awayTeam;
    }

    // Method to simulate a match, randomly generating goals for each team
    public void simulateMatch() {
        Random random = new Random();
        int homeGoals = random.nextInt(5); // Simulate up to 4 goals per team
        int awayGoals = random.nextInt(5);

        for (int i = 0; i < homeGoals; i++) {
            homeTeam.scoreGoal();
        }

        for (int i = 0; i < awayGoals; i++) {
            awayTeam.scoreGoal();
        }
    }

    // Method to display the result of the match
    public void displayResult() {
        System.out.println(homeTeam.getName() + " " + homeTeam.getGoalsScored() + " - " + awayTeam.getGoalsScored() + " " + awayTeam.getName());
    }
}

public class MLSMatchSimulator {
    public static void main(String[] args) {
        // Create two MLS teams
        MLSTeam team1 = new MLSTeam("LA Galaxy");
        MLSTeam team2 = new MLSTeam("Seattle Sounders");

        // Create a match between the two teams
        MLSMatch match = new MLSMatch(team1, team2);

        // Simulate the match
        match.simulateMatch();

        // Display the result of the match
        match.displayResult();
    }
}

// Entry point of the program, calling the main() method to execute the code
MLSMatchSimulator.main(null);
LA Galaxy 3 - 3 Seattle Sounders
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Random;

class NFLTeam {
    private String name;
    private String city;

    // Constructor for creating NFLTeam objects with a name and city
    public NFLTeam(String name, String city) {
        this.name = name;
        this.city = city;
    }

    // Method to get the full name of the NFL team (city + name)
    public String getFullName() {
        return city + " " + name;
    }
}

class NFLPlayer {
    private String name;
    private String position;

    // Constructor for creating NFLPlayer objects with a name and position
    public NFLPlayer(String name, String position) {
        this.name = name;
        this.position = position;
    }

    // Getter method for retrieving the player's name
    public String getName() {
        return name;
    }

    // Getter method for retrieving the player's position
    public String getPosition() {
        return position;
    }
}

public class NFLDraftSimulator {
    public static void main(String[] args) {
        // Create a list of NFL teams
        List<NFLTeam> teams = new ArrayList<>();
        teams.add(new NFLTeam("Patriots", "New England"));
        teams.add(new NFLTeam("Packers", "Green Bay"));
        teams.add(new NFLTeam("Chiefs", "Kansas City"));
        // Add more NFL teams...

        // Create a list of NFL players
        List<NFLPlayer> players = new ArrayList<>();
        players.add(new NFLPlayer("Tom Brady", "Quarterback"));
        players.add(new NFLPlayer("Aaron Rodgers", "Quarterback"));
        players.add(new NFLPlayer("Travis Kelce", "Tight End"));
        // Add more NFL players...

        // Shuffle the draft order (randomize the order in which teams select players)
        Collections.shuffle(teams);

        // Simulate the NFL draft
        for (int i = 0; i < teams.size(); i++) {
            NFLTeam team = teams.get(i);
            NFLPlayer player = players.get(i);

            // Display the draft results for each round
            System.out.println("Round " + (i + 1) + ": " + team.getFullName() + " selects " + player.getName() + " (" + player.getPosition() + ")");
        }
    }
}

NFLDraftSimulator.main(null)
Round 1: Green Bay Packers selects Tom Brady (Quarterback)
Round 2: New England Patriots selects Aaron Rodgers (Quarterback)
Round 3: Kansas City Chiefs selects Travis Kelce (Tight End)