Homework

During this quarter we are going to have 2 individual homework assignments where you get experience with AI programming tools and come up with app ideas.

Although each student is responsible for turning in their own homework, we strongly encourage students to work together. Everyone has to come up with their own solution, but we want people to talk about concepts together and help each other out when stuck.

We will use Canvas to submit homework assignments this quarter.


ECS 191: Homework 1 — Unix Utilities with AI-Assisted Development

Overview

In this assignment, you'll use Claude Code (an AI-powered coding assistant) to build simplified versions of common Unix utilities, then extend one of them with a new feature. This assignment introduces you to AI-assisted development.

What you'll build:

  • Four Unix utilities: wcat, wgrep, wzip, and wunzip
  • A line numbering feature (-n flag) for wcat
  • Test cases for your new feature

What you'll submit:

  • Your specification for the -n feature that you use as an input to Claude Code
  • wcat.cpp (with the -n flag implemented)
  • Appropriate test files for your feature
  • A brief reflection (see below)

Prerequisites:

$ git clone https://github.com/kingst/ecs150-projects.git

Part 1: Build the Base Utilities

Your Task

Use Claude Code to implement all four utilities from the ECS 150 Project 1 specification:

  • wcat.cpp - concatenate and print files
  • wgrep.cpp - search for patterns in files
  • wzip.cpp - compress files using run-length encoding
  • wunzip.cpp - decompress files
Requirements
  • All utilities must use open(), read(), write(), and close() for I/O
  • Code must compile with g++ -g -o <program> <program>.cpp -Wall -Werror
  • All utilities must pass the ECS 150 test cases (available in the repo)
Using Claude Code

Claude Code is a terminal-based AI coding assistant. The README.md we provide plus the test cases should be enough for Claude Code to complete project 1. Provide a prompt to let Claude Code know about the spec and how to run the test cases and have it solve each of the utilities one-by-one.

Part 2: Add Line Numbering to wcat

Feature Specification

Extend your wcat implementation to support an optional -n flag that prepends line numbers to each line of output, matching the behavior of standard Unix cat -n.

We are leaving the specification fairly sparse because having you create a spec is part of the assignment.

Writing Test Cases

You need to add test cases to the standard testing framework for project 1. You should have test cases to test out the basic feature plus any edge cases (e.g., multiple files). When in doubt, match the behavior of Unix cat. Hint: Claude Code can help you understand how the test cases work and create new ones, with some guidance.

Development Approach
  1. Write a specification: Write a simple prompt that explains the feature. You'll use this to get Claude Code to generate your implementation.
  2. Write your tests: Create comprehensive test cases for the new feature
  3. Write your code: Use Claude Code to create the new feature and test it, fixing issues that arise
  4. Verify: Ensure all original tests still pass

Submission Requirements

Submit the following files via Gradescope:

  1. wcat.md — Your specification for the -n flag feature, used as an input to Claude Code
  2. wcat.cpp — Your implementation with the -n flag
  3. test files — Your test files (must be loadable in the standard Project 1 test suite)
  4. reflection.md — A brief reflection (300 words max) addressing:
    • How did using Claude Code change your development process?
    • What challenges did you encounter with AI-assisted development?
    • Did you understand the code Claude Code generated? How did you verify this?
    • How did you decide what tests to write?

Grading Criteria

  • Line numbering feature (80%): -n flag works correctly
  • Code quality (10%): Clean, readable, properly commented
  • Reflection (10%): Thoughtful analysis of AI-assisted development

Academic Integrity

  • You are required to use Claude Code for this assignment — no manually written code is allowed
  • You must understand all code you submit
  • You may discuss approaches with classmates but not share code, tests, or specifications
  • Your reflection must be your own original writing

Good luck!


ECS 191: Homework 2 — Coming up with ideas

Details TBD

Part 1 — Ideas

Part 2 — Present the idea you want to work on to the class