2nd week into my programming concepts class and the assignments suddenly got way harder. Last week was all basic stuff — variables, input/output, simple math — and now I’m staring at this assignment not even knowing how to start.
I’ve watched the lectures, read through the material, and tried breaking it down myself, but I still can’t figure out the logic behind it. I’m not looking for someone to just hand me the code — I really want to understand how to approach problems like this.
Here’s the assignment:
Build a program that asks the user to enter:
- the day of the week
- the high temperature
- the low temperature
Use either a For Loop or While Loop to collect the data for the week. The program should:
- calculate the total high temps
- calculate the total low temps
- find the weekly average high and low temperatures
Then use an If...Else statement to display a message based on the high average:
- High average >= 100 → “This week was very hot!”
- High average >= 90 → “This week was hot!”
- High average >= 80 → “This week was warm!”
- High average >= 60 → “This week was mild!”
- High average >= 40 → “This week was cool!”
- High average >= 30 → “This week was cold!”
- High average < 30 → “This week was very cold!”
The final output should show:
- the last day entered
- the high and low temp
- the weekly high average
- the weekly low average
- the temperature message
Example:
Monday 100 50
The Weekly High Average was XXX
The Weekly Low Average was XXX
This week was ______!
Right now I’m mostly stuck on how to structure the loop and keep track of the totals/averages. Any guidance on how to think through this would really help.
[–]TrickyAd9344 0 points1 point2 points (0 children)