Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6075479
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:29:58+00:00 2026-05-23T10:29:58+00:00

I would like someone to give me some ideas how to to write this

  • 0

I would like someone to give me some ideas how to to write this program in Java. I don’t want people to write code for me, but guide me on how to start and what methods/design should be used to get this program done. I’m new in Java and this is a programming practice for me.

My idea for the program is a simple team scheduling program, which allows users to enter numerous teams and generate the schedule for each team. In the schedule, each team will play against each other once only.

e.g. 4 teams

Team 1 vs Team 2
Team 3 vs Team 4
————————
Team 1 vs Team 3
Team 2 vs Team 4
————————
Team 1 vs Team 4
Team 2 vs Team 3

My question is should I use an Array to store all the teams? How should I generate the schedule (use the Random class)? How can I make sure that each team will play against each other once, and not multiple times?

Thanks a lot.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T10:29:58+00:00Added an answer on May 23, 2026 at 10:29 am

    Here are a few basic ideas:

    Of course you need a Team object. And you need a Schedule object. Then I would recommend a couple of implementation choices from the Design Patterns book. One would be to use the Builder pattern. You would have a ScheduleMaker and then you could have different concrete builders. For instance, in Football, there are rules about the schedule: each team is going to play 2 games against each peer in its division. Generally different concrete Builders are used to provide for different physical variances. For example, in the Go4 book, the example is of a MazeBuilder where simple and complex implementations contain different numbers of doors, halls, etc. In your case, you would want to have perhaps different rule-oriented ways of making the schedule. For the example I gave, you would push a method called ‘setupDivisionalGames’ into the interface, then you could fill the rest of the schedule with randomly selected rivals who are not from within the division. (Builder is generally buildA, buildB… getProduct().)

    If this is starting to sound like another pattern, a simpler implementation would be to just have a Strategy pattern for picking opponents. If you don’t have rules like the one above, then a simple random Strategy would be a good default implementation and if you wanted to get more fancy, you could just unit test a new implementation and change no other code and get new schedules.

    Finally, think about the possibility of doing a score-based approach. That’s how the NFL works. If you are the Detroit Lions, your schedule is going to be more cush than if you are the Packers this coming season. Either Builder or Strategy would let you do something like that pretty easily: the team’s relative score must be close to the average score of all opponents, something like that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hope someone could help me with this: I would like to have a column
Could someone give me some ideas on the proper Thread Safe way to get
Lots of questions similar but I have a specific example I would like some
Would like someone to take a look at my script and tell me where
I would like someone to clarify something for me: There are two kinds of
I would like someone to explain me what _forward is exactly doing, I cannot
I have a confusion regarding DataContext which i would like someone to confirm or
I have a search form. I would like when someone type the term, first
I would like to know if someone knows why I can't send sms with
i would like to know if there is an event for every time someone

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.