Create a Java program that solves the teenagers problem. There were teenagers an
ID: 3620254 • Letter: C
Question
Create a Java program that solves the teenagers problem. There were teenagers and they were caught in a misdeed. The judge sentenced them to a total of 200 hours of community service and said it was up to them how they divided up the work. The teenagers agreed to start the next day. The following morning, one of the teenagers, who was lazier but not as dumb as the other three, said there was no reason for them all to do the same amount of work. He suggested the following scheme: the players would draw straws. A straw would be marked with a single number indicating both how many days the teen must work and how many hours each day. For example, a teen drawing a straw marked with a 3 would work for 3 hours a day for 3 days, making a total of 9 hours. The lazy teen convinced the others to agree with this scheme and through trickery drew the best straw.The problem is to determine all of the possible ways to divide up the work according to this scheme.
You will have to use nested loops to test all of the possible combinations of 4 numbers that will result in exactly 200 hours of work.