CS1

Rational Number Object

In this assignment, students demonstrate their understanding of classes and implementing mathematical ideas with object-oriented programming concepts by writing a class that represents a rational number. Students maintain information about the rational number, noting that the number is represented in its reduced form at all times (for which students need to write a recursive subroutine to find the GCD of two integers). Students implement several methods to perform arithmetic operations on rational numbers.

Sieve of Eratosthenes

In this assignment, students use an ancient method for finding prime numbers known as the Sieve of Eratosthenes to determine all the prime numbers in a range of numbers. Students being with a list of integers, and maintain an array of booleans to maintain whether a number is prime. This activity is a good introduction to more complex mathematical logic used in programming.

Competitive Pig Game

In this activity, students build the game "Pig", and implement a computer player for the game. There are two rounds, where the human plays first in round 1 and the computer plays first in round 2, in order to eliminate any advantage.

Cardset Object

In this activity, students exercise their understanding of classes and objects in order to build a class that stores a set of cards. The set of cards is backed by an array, and students implement methods to add and discard cards, check the high and low ranks of the hand, and check if the hand contains a pair, a flush, or a straight. This activity is good for students that are being introduced to classes.

Tessellation, Problem Set 2

In this assignment, students will be creating mosaics in Python. Students will work to generate tessellations, such as Ring and Hex. Functions must be composed to generate the various images.

Engagement Excellence

JavaDocs and Intro to Eclipse

In this lab, students work to explore the basics of working with an integrated development environment (IDE). Using the Eclipse IDE, students create a project, add a package, insert some code, implement some methods, and do some refactoring.

Design, Develop, Debug- Connect 4

In this lab, students work to design, develop, and debug a game. In particular, students must use UML and pseudocode to create 'Connect 4' (a popular board game). The methods should be designed to handle the complexity of the potential game moves and the student must clearly illustrate how their program design accounts for the various conditions under which this scenario occurs.

Pseudocode

In this lab, students work to create a square with Turtle graphics and pseudocode. Using the Turtle class in Java, students must create a 'filled-in square.' To start, students must create the program using pseudocode and then, after the algorithm for creating the shape has been defined, write the actual algorithm.

Interfaces and polymorphism- Painting!

In this lab, students work to create a 'painting' program. The Java program must use variables and methods to store values and perform actions, respectively, for painting. To abstract this idea beyond custom methods, students must create interfaces. Specifically, students are to create an interface where the user can (and must) implement all methods in that interface.

Engagement Excellence

Introduction to UMLet and Design

In this lab, students work collaboratively to create graphical representations of class relationships. Using UML and Java, students must build containment diagrams (shows an instance or instances of classes that are contained, or instantiated, within the class) and inheritance diagrams (shows how one or more class extends, or inherits, from the class to which the arrow is pointing).

Subscribe to CS1