> Source URL: /demos/cs1-path/projects/project-2.spec
---
project_number: 2
title: Multi‑Week Weather Analyzer
outcomes: [1, 2, 3, 4, 6]
difficulty: intermediate
prerequisites: [project-1, lab-04]
estimated_time: 4-6 hours
due_date: Week 7
theme: data analysis
---

# 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](../course.outcomes.md))
- Apply conditionals in multi‑step decision making ([Outcome 2](../course.outcomes.md))
- Use nested loops to analyze multi‑dimensional data ([Outcome 3](../course.outcomes.md))
- Write and call functions to organize code ([Outcome 4](../course.outcomes.md))
- Break down a complex problem into manageable parts ([Outcome 6](../course.outcomes.md))

## Dataset

You are given temperatures for **4 weeks** (28 days total). Each week includes a list of 7 daily high temperatures:

```python
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:

1. Compute the **average temperature per week**
2. Compute the **overall average** across all 28 days
3. Find the **hottest day overall** (temperature + week + day name)
4. Find the **coolest day overall**
5. For each week, count how many days are Hot (>75), Mild (70‑75), and Cool (<70)
6. 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

1. **Process one week first**: compute its average
2. **Add classification** for each day
3. **Track extremes** while looping through all weeks
4. **Create functions** for reusable steps
5. **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](project-2.rubric.md) for detailed grading criteria.

### Grading Summary

| Criterion     | Points |
| ------------- | ------ |
| Correctness   | 40     |
| Code Quality  | 30     |
| Organization  | 20     |
| Documentation | 10     |
| **Total**     | **100** |

## Submission

1. Name your file `multiweek_weather.py`
2. Push to your GitHub repository by **Week 7**
3. 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


---

## Backlinks

The following sources link to this document:

- [Project 2](/demos/cs1-path/index.path.llm.md)
- [Project 2: Multi‑Week Weather Analyzer](/demos/cs1-path/projects/project-2.rubric.llm.md)
