You are given the following two dimensional arrays of people and their birth months: String [][] people = {{June, May, March, June, May, March, February, June, May, January, May, March}, {John, Mary, Peter, Bob, Sam, Dan, Judith, Gary, Tiff, Suzy, Jim, Jane}} 1) Create an enum type for the the first six months of the year 2) Randomly select a month from this enum 3) Loop through the array of people and make a list of all the people whose birthdays correspond to the month that was randomly chosen above. I ONLY NEED THE ANSWERS TO 2 AND 3. Please provide the code
You are given the following two dimensional arrays of people and their birth months:
String [][] people = {{June, May, March, June, May, March, February, June, May, January, May, March}, {John, Mary, Peter, Bob, Sam, Dan, Judith, Gary, Tiff, Suzy, Jim, Jane}}
1) Create an enum type for the the first six months of the year
2) Randomly select a month from this enum
3) Loop through the array of people and make a list of all the people whose birthdays correspond to the month that was randomly chosen above.
I ONLY NEED THE ANSWERS TO 2 AND 3. Please provide the code
Trending now
This is a popular solution!
Step by step
Solved in 4 steps
When I type in the code for the 3rd question this line is highlighted
if (people[i][j] == first){
the error says "incomparable types: String and month". Do you have any idea why I might be getting this error?