Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Database Experts Guide To Database 2

Authors: Bruce L. Larson

1st Edition

0070232679, 978-0070232679

More Books

Students also viewed these Databases questions

Question

What are the best practices for managing a large software project?

Answered: 1 week ago

Question

How does clustering in unsupervised learning help in data analysis?

Answered: 1 week ago