Question
This is to be done in Java using Sets (HashSet or TreeSet). Please read all the instructions (especially the bolded) and what the correct output
This is to be done in Java using Sets (HashSet or TreeSet).
Please read all the instructions (especially the bolded) and what the correct output should be.
The task is to find out how many people you typically need to meet before you meet one person born each day of the year. You are assuming there are 365 days in a year (no leap years). This means a birthday can be represented by a random number from 1 - 365. Using a set, the task is to keep track of the birthdays you have already encountered. The task is to make a Java program that will randomly compute how many people are needed for having all the birthdays from 1 to 365 days.
Since it is random, the output may vary. However, the correct output for the number of total people needed should be somewhere around 1800 to 2500 people.
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