Project 2: Multi‑Week Weather Analyzer
Overview
This project extends the work you did in Project 1 by analyzing multiple weeks of temperature data. Instead of a single 7‑day dataset, you will process four weeks of weather information, compute broader trends, and generate a comparative report.
This follow‑up project helps you practice loops, nested structures, functions, and organizing a larger program.
Learning Objectives
This project assesses your ability to:
- Use variables and data collections effectively (Outcome 1)
- Apply conditionals in multi‑step decision making (Outcome 2)
- Use nested loops to analyze multi‑dimensional data (Outcome 3)
- Write and call functions to organize code (Outcome 4)
- Break down a complex problem into manageable parts (Outcome 6)
Dataset
You are given temperatures for 4 weeks (28 days total). Each week includes a list of 7 daily high temperatures:
weeks = [
[72, 68, 75, 80, 77, 71, 69],
[70, 67, 74, 78, 76, 73, 71],
[69, 65, 72, 77, 79, 74, 70],
[73, 70, 76, 82, 78, 75, 72]
]
days = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]
Copy this into your program.
Requirements
Functional Requirements
Your program must:
- Compute the average temperature per week
- Compute the overall average across all 28 days
- Find the hottest day overall (temperature + week + day name)
- Find the coolest day overall
- For each week, count how many days are Hot (>75), Mild (70‑75), and Cool (<70)
- Generate a formatted report showing:
- Weekly averages
- Overall average
- Hottest & coolest days
- Weekly category counts
Technical Requirements
Your code must:
- Use nested loops to process weeks and days
- Include at least two functions (e.g.,
compute_week_average,classify_temperature) - Use meaningful variable names
- Include comments explaining your approach
- Run without errors
Getting Started
Suggested Approach
- Process one week first: compute its average
- Add classification for each day
- Track extremes while looping through all weeks
- Create functions for reusable steps
- Build the final report
Example
Sample Output (abbreviated):
=== Multi‑Week Weather Report ===
Week 1 Average: 73.1°F
Week 2 Average: 72.7°F
Week 3 Average: 72.3°F
Week 4 Average: 75.1°F
Overall Average: 73.3°F
Hottest Day: 82°F (Week 4, Thursday)
Coolest Day: 65°F (Week 3, Tuesday)
Weekly Categories:
- Week 1: Hot 2 | Mild 3 | Cool 2
- Week 2: Hot 1 | Mild 4 | Cool 2
- Week 3: Hot 2 | Mild 3 | Cool 2
- Week 4: Hot 2 | Mild 4 | Cool 1
Rubric
See project-2.rubric.md for detailed grading criteria.
Grading Summary
| Criterion | Points |
|---|---|
| Correctness | 40 |
| Code Quality | 30 |
| Organization | 20 |
| Documentation | 10 |
| Total | 100 |
Submission
- Name your file
multiweek_weather.py - Push to your GitHub repository by Week 7
- Verify your code runs without errors
Academic Integrity
- You may discuss ideas but must write your own code
- No copying code from the internet or classmates
- AI tools may help you understand but not write the program
Getting Help
- Start early
- Come to office hours
- Use the discussion forum for conceptual questions