More about loops: "while" loops

In this tutorial, students create a program in Java that uses a while loop. The program must accept user input and then evaluate whether or not the value entered by the user is too high or too low. The program must continue to loop until the user enters the correct value.

Loops: "for"-loops

In this tutorial, students create a program in Java that utilizes the 'for' loop. The program must execute a series of actions, such as finding the product of all integers from 1 to 25, print the average grade for five (5) grade value (from 0 to 4) entries, and one additional loop application (as chosen by the student).

Classes and constructors

In this tutorial, students create a program that implements a class. Using Java, students must edit existing files (included) to create new variables, assign new values, and construct new objects.

If-statements; trivia questions

In this tutorial, students create a quiz. Using conditional statements (if) in Java, students must create a program that accepts user input, evaluates the entry against a specific value, and prints an appropriate output response.

Random numbers

In this tutorial, students create a random number generator. Using Java, students must create a program that prints a random integer, prints the value of a coin toss (H or T), prints a value from a discrete set of float/double values, prints a random lower-case letter, and two additional problems (as identified by the student).

Reading in words; "silly sentences"

In this tutorial, students create an interactive program. Using the Scanner class in Java, students must write a program that accepts user input and then displays a subsequent output.

Getting used to Java syntax (or, "Concise Guide to Java-ish for Tourists in Javaland")

In this tutorial, students work individually to explore the basic concepts of statements, sequence, and methods. Using pseudocode and various scenarios (such as making a milkshake, getting money from a cash machine, and doing laundry), students must examine the basic principles for creating a sequence of actions and then generate their own example. This activity is excellent for introducing the concept of sequences and statements to a student with no background in computer programming.

Chess Problems

In this activity, students exercise their understanding of file reading and graphics to display a chess problem as specified by data provided in a file. Students begin by reading a file containing positions of chess pieces, and then display pieces on a graphical board to represent the position encoded in the file.

Exceptional Encryption

In this assignment students work either individually or in pairs to implement and crack a simple version of RSA. As subproblems in generating RSA keys, students must generate random primes, calculate Euler's totient, and find the greatest common divisor of two numbers using Euclid's algorithm. They must then encrypt/decrypt messages using these keys and use brute force as an attack against encryption. In addition to reviewing brute force and recursive algorithms, this assignment requires students to write a program with multiple helper functions.

Subscribe to Baccalaureate Colleges - Liberal Arts