So I am stuck on my midterm with the two following questions I haven't the slightest clue were to begin; can anyone help me I have never encountered this before

2. Write one program that uses counter-controlled repetition to process temperatures. The program has the following display:

(1st Example Display)
Enter the number of temperatures: 2
Enter a temperature: 77
Enter a temperature: 78
The average temperature is 77.5 degrees for the 2 days.
End of Program

(2nd Example Display)
Enter the number of temperatures: 3
Enter a temperature: 80
Enter a temperature: 84
Enter a temperature: 79
The average temperature is 81.0 degrees for the 3days.
End of Program

(3rd Example Display)
Enter the number of temperatures: 0

No temperatures were entered.
End of Program






3. Write one program that uses sentinel-controlled repetition to process the hours an employee works. The program has the following display:

(1st Example Display)
Enter the number of hours or -1 to quit: 9
Enter the number of hours or -1 to quit: 4
Enter the number of hours or -1 to quit: -1

The employee worked an average of 6.5 hours/day for 2 days.
End of Program

(2nd Example Display)
Enter the number of hours or -1 to quit: 6
Enter the number of hours or -1 to quit: 3
Enter the number of hours or -1 to quit: 8
Enter the number of hours or -1 to quit: -1

The employee worked an average of 5.6 hours/day for 3 days.
End of Program

(3rd Example Display)
Enter the number of hours or -1 to quit: -1

No hours were entered
End of Program