Hero background

Code the City

Technology • 95 • 20 students • Created with AI following Aligned with Common Core State Standards

Download now

Free PDF · we'll email you a copy

Technology
95
20 students
14 August 2026

Teaching Instructions

Introduce computer science to high school students in an engageing way.

Overview

Students are introduced to computer science through a team challenge: use a simple computer simulation to improve traffic flow at a busy city intersection. They will break a complex problem into smaller parts, define criteria and constraints, test variables, and justify a solution using evidence from the simulation.

Learning intentions

Students will be able to:

  • Explain how computer science uses algorithms, data, and models to solve real-world problems.
  • Break a complex transportation problem into smaller, manageable problems.
  • Use a computer simulation to investigate how changing variables affects a system.
  • Evaluate a proposed solution using prioritized criteria, constraints, and trade-offs.

Success criteria

  • I can identify the inputs, processes, outputs, criteria, and constraints in a computer model.
  • I can describe an algorithm or set of rules that could improve traffic flow.
  • I can run fair tests, record data, and use evidence from a simulation.
  • I can defend a solution while acknowledging at least one trade-off or limitation.

Curriculum links

  • Analyze a major global challenge and specify qualitative and quantitative criteria and constraints that reflect societal needs and wants.
  • Design a solution to a complex real-world problem by breaking it into smaller engineering problems.
  • Use a computer simulation to model how proposed solutions affect interactions within and between systems.
  • Evaluate solutions using prioritized criteria, constraints, trade-offs, and social and environmental impacts.

Lesson structure (95 minutes)

  1. 0–8 min · Hook: Can code fix traffic? Teacher opens the city traffic hook and challenge slides with a visual comparison of a congested and smoothly flowing intersection, then asks, “Should a city prioritize speed, safety, fairness, or lower emissions?” Students make an individual choice, then briefly defend it to a partner.

  2. 8–20 min · What computer scientists do. Teacher uses the computer science concepts slides to introduce algorithms, variables, inputs, outputs, data, models, and simulations; connect these ideas to navigation apps, games, and smart traffic signals. Students annotate the traffic simulation investigation sheet by identifying possible inputs, outputs, and rules in the intersection system.

  3. 20–32 min · Define the problem. Teacher presents the scenario: four roads meet near a school, hospital, and apartment complex; traffic demand changes throughout the day, and the city has limited funds. Teams of four use the worksheet to separate the challenge into smaller problems, such as signal timing, pedestrian safety, emergency access, and neighborhood impact. Students agree on three measurable criteria and at least three constraints, including cost, safety, reliability, accessibility, or emissions.

  4. 32–42 min · Model and predict. Teacher demonstrates the browser-based or spreadsheet simulation from the simulation demonstration slides, showing how to change signal timing, traffic volume, pedestrian crossing time, and emergency-vehicle priority. Students predict which change will most improve their selected criteria and record a testable hypothesis on the worksheet.

  5. 42–68 min · Team simulation investigation. Teacher assigns each team a starting configuration, checks that students change only one variable at a time where possible, and circulates with questions such as “What stayed constant?” and “What evidence supports that conclusion?” Students run at least four trials, record wait time, queue length, safety conflicts, cost, or another agreed measure, and revise their configuration based on evidence. Each student has a role: operator, data recorder, criteria monitor, or reporter.

  6. 68–84 min · Evaluate and communicate. Teacher asks teams to prepare a two-minute recommendation using the evidence and presentation prompt slides. Students compare their results with the baseline, explain their algorithm or rule changes, identify the strongest trade-off, and present their proposed solution. Listening teams record one strength and one question for each presentation.

  7. 84–95 min · Debrief and exit assessment. Teacher leads a brief discussion about why different teams produced different solutions and how models simplify reality. Students complete the final section of the reflection and exit questions: state their best solution, cite one data point, identify one limitation of the simulation, and explain one possible social or environmental impact.

Resources

  • Computers, one per student or pair
  • Browser-based traffic simulation or teacher-prepared spreadsheet model
  • Projector and speakers
  • the city traffic and computer science slide deck
  • the traffic simulation investigation sheet
  • Timer
  • Whiteboard or shared digital workspace
  • Team role cards or posted role instructions
  • Optional spreadsheet for recording and graphing trial data

Assessment

  • During problem definition, check that teams distinguish criteria from constraints and can break the challenge into smaller problems.
  • Review team data tables and question whether tests are fair, variables are identified, and conclusions are supported by evidence.
  • Use the exit response to assess understanding of simulation, algorithmic decision-making, trade-offs, and model limitations.

Differentiation

  • Provide a word bank and sentence starters such as “Our priority is ___ because ___” and “When we changed ___, the data showed ___.”
  • Give students who need additional support a partially completed data table, a baseline trial, and a limited choice of variables; pair them with a supportive peer for operating the simulation.
  • Offer speech-to-text, enlarged materials, keyboard alternatives, and clearly assigned roles for students with language, attention, motor, or processing needs.
  • Extend advanced students by requiring a weighted scoring system, a graph of competing criteria, or a discussion of how biased data could produce an unfair traffic algorithm.
  • For multilingual learners, preview terms with visuals and allow ideas to be recorded through labeled diagrams, tables, oral explanation, or written response.

Create Your Own AI Lesson Plan

Join thousands of teachers using Kuraplan AI to create personalized lesson plans that align with Aligned with Common Core State Standards in minutes, not hours.

AI-powered lesson creation
Curriculum-aligned content
Ready in minutes

Created with Kuraplan AI

Generated using openai/gpt-5.6-luna

🌟 Trusted by 1000+ Schools

Join educators across United States