Write a program that takes in temperatures for 10 days. Find the average temperature for those 10 days, and then print the number of days and the temperatures that were above average.
Welcome to the above average temperature tester program.
Please enter the temperature for day 1
Please enter the temperature for day 2
Please enter the temperature for day 3
Please enter the temperature for day 4
Please enter the temperature for day 5
Please enter the temperature for day 6
Please enter the temperature for day 7
Please enter the temperature for day 8
Please enter the temperature for day 9
Please enter the temperature for day 10
The average temperature was 86.1
The days that were above average were
Day 1 with 97
Day 2 with 87
Day 6 with 104
Day 9 with 90
Create a Java program that solves the "Four Football Players" problem. There were four football players 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 players agreed to start the next day.
The following morning, one of the players, 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 player must work and how many hours each day. For example, a player 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 player 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.
Couple of notes:
1. There cannot be a 0 straw which indicates 0 days for 0 hours.
2. Each straw must be unique so they cannot repeat values.
3. Since this is combination you cannot have repeated results
Example: 2 4 6 12 and 4 2 6 12 are technically not a combination as the both contain the same values in different order, so only show 2 4 6 12
4. Finally there is only one solution which is 2 4 6 12
|Due By (Pacific Time)||09/22/2014 10:00 pm|
out of 1971 reviews
out of 766 reviews
out of 1164 reviews
out of 721 reviews
out of 1600 reviews
out of 770 reviews
out of 766 reviews
out of 680 reviews