Question: Code written in Java. Code through step 2 written. Extension 2: Birthday Problem (5 points) Procedure To make things simple, let's assume that all months

Code written in Java.

Code through step 2 written.

Code written in Java. Code through step 2 written. Extension 2: Birthday

Extension 2: Birthday Problem (5 points) Procedure To make things simple, let's assume that all months have 31 days. 1. Open the Birthday class, found in the arrays package of the extensions folder. 2. Insert code to obtain from the user the number of people N that will enter the room. 3. For each person, randomly generate a month and day on which that person was born. 4. Using a two-dimensional array that is indexed by month and by day, keep track of the number of people born on that month and day. For example, perhaps you randomly decide the person was born in month 4 and day 28 5. After processing all of the N people, iterate over your array to compute: o For each month, the fraction (or percentage) of people born in that month. o The average of the 12 values you computed for the above o For each day, the fraction (or percentage) of people born on that day, whether in the same or in a different month. o The average of the 31 values you computed for the above The fraction (or percentage) of people born on exactly the same day. Be careful! A 1 entry means just one person was born on that particular day. You are looking for the fraction of people who share a birthday with at least one other person. *Birthday.java 3 1 package arrays; 2 import cse131 . ArgsProcessor ; 4 public class Birthday f 6 public static void main(String[ args) i ArgsProcessor ap new ArgsProcessor(args); 10 int N = ap.nextInt("How many people enter the room?"); 12 13 14 15 16

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!