This page contains information about UW CSE 142 and 143 assignments.

Homework Assignments

UW CSE gives weekly homework assignments throughout CSE 142 and 143. Each assignment usually covers the topics taught in class over the previous week; some topics become foundational and end up being utilized in assignments through the rest of the term. We expect students to work independently on their homework assignments. We provide assistance to them in a programming lab staffed by our TAs. Our TAs are trained to help the students learn problem solving and debugging strategies so that the students can become self-sufficient programmers.

You can vary the weight that you give to homework assignments, subject to how much emphasis you want to put on examinations. At UW, homework assignments are worth between 40 and 50% of a student's grade for the term. We find that consistent independent practice informs a student's success in our courses, which is why we place such weight on the homework assignments.

CS1 Assignments

Assignment 1

Song

println, static methods

Song asks students to use printlns and static methods to create the output of a repeating song. They must use methods to create structure in their program and eliminate the redundancy in the output of the song.

Assignment 2

Rocketship

variables, expressions, for loops

In this assignment, students are asked to draw an ASCII-art rocket ship. There is redundancy in the output that the student can capture by using nested for loops. The students must also use static methods to add structure to their program.

Assignment 3

Cafe Wall

parameters, graphics

This assignment is an introduction to graphical programming and parameters. The student is tasked with drawing a repeating figure in different sizes and shapes.

Not many of our assignments use scaffolding code, but for this assignment, we provide one file for the student to use. It's a java object that provides a simple interface for doing graphical programming. To use it, you must save the file in your working directory.

Assignment 4

Admissions

Scanner, if/else, return

Admissions is a simple interactive text program. It prompts the user for input regarding some numerical aspects of a college application for two different people, accepts text input from the user, does some processing on the input values, and prints some summary information comparing the two applicants. Method returns and user input are new concepts in this assignment, as well as building on variables, expressions, and parameters.

Assignment 5

Guessing Game

while loops, random, assertions

Guessing Game gives the student practice with indefinite loops, as well as an introduction to the Random object. The product is an interactive text program where the program picks a random number, the user attempts to guess the number, and the program gives the user feedback about their guess until the user guesses correctly. Additionally, the program can play multiple games, requiring the implementer to keep track of some statistics throughout the execution of the program.

Assignment 6

Baby Names

file processing

BabyNames brings together many of the previously introduced topics. In this program, students must parse user input and file data to graph the popularity of a given name over time. The product is a program that accepts a name from a user, and draws a line graph on a DrawingPanel to show how common that name has been over the last ~100 years, based on SSA data.

DrawingPanel is needed for this assignment, as well as the text file that the student's program must parse to find the data.

Assignment 7

Personality Test

arrays

Personality Test is a program that parses a text string representing answers on a personality test, and then prints information about the subject's personality based on the answers. In this assignment, students must use arrays to keep track of multiple values, process String character by character, and know a little about reference vs value semantics when passing arrays as parameters.

Assignment 8

Critters

defining classes

This is our students' first introduction to implementing objects. The main program is a 2-dimensional world; the objects that the students must implement are critters. The critters interact with the world and with each other, and this behavior is defined the objects that the students implement. This assignment has the most scaffolding code, and it is the first time that students don't write the main class.

This assignment is an opportunity for the students' programs to interact with each other in a controlled manner. Every quarter, we run a tournament where the students can submit a critter with behavior that they devise entirely on their own. The tournament pits these objects against each other to see whose critter survives the longest.

CS2 Assignments

Basic Object Implementation:

LetterInventory

exceptions, iterators, Comparable

LetterInventory is an object implementation practice assignment. The student implements a simple object that keeps track of counts of letters. The object has several public methods; for our students, it is the first real experience that they get using data fields and public methods to create an object abstraction.

Linked Lists

Assassins

linked lists

AssassinManager delves deeper into object implementation, including linked list algorithmic programming. The assignment is to implement a game manager for the game of "Assassins. The state of the game is kept in a linked list object implemented by the student. The kill() method is the most difficult, requiring students to rearrange nodes between two linked lists.

Stacks and Queues

Sieve

stacks, queues, interfaces

This assignment has student implement a Sieve of Eratoshenes, which is an algorithm to find prime numbers up to n. It gives students practice implementing algorithms, specifically with queues.

Java Collections, Interfaces

Evil Hangman

collections, interfaces, maps, sets

EvilHangman is an assignment where the student implements a devious game manager. Instead of classic hangman, where a word is picked before the game, the game manager maintains a set of words that all could be the answer, given the current positions of the letters that have been guessed. When a letter is guessed, the manager responds that the letter is an 'incorrect guess' unless all of the available words contain the letter. In this case, the manager combs through the list of available words, and decides 'where' the guessed letter belongs by determining which letter placement will leave the largest remaining set of words to choose from.

This assignment gives students practice using Set and/or Map ADTs, as well as the Java Collections class and programming against interfaces.