CS 142 - Intro to Programming

Description Text Calendar Grading Programs TAs

Course Description

The purpose of this course is to learn how to program computers. It is assumed that students have very little programming experience. Students that have never programmed at all may want to consider taking CS100 first.

In this particular version of CS142 we will be programming graphical animations. It is assumed that students have absolutely no experience in animation. The goal of the animation is to give us something really phun to program.

A key to programming is to learn to read manuals and documentation. For each lecture there are readings in the text. You are expected to read these BEFORE class.

Instructor: Dan R. Olsen Jr.

Office Hours: e-mail, call, knock on my door anytime(3336 TMCB) or peek in my lab (3329 TMCB)

Text Materials


  • Java: An Introduction to Problem Solving and Programing, 4th Edition,
  • Walter Savitch
  • Pearson/Prentice Hall

Tutorial for the Phun package

Java documentation for the Phun package

Java API documentation

If you want to work on your own machine you will need to install Eclipse. If you are working on the CS lab machines, Eclipse is already installed. If you are working on your own computer you can download Eclipse here. Eclipse is a tool that makes it easier for us to write Java programs.

You will also need the jar file for edu.byu.phun2d, which is our software package. If you don't know how to do these things, it would be better for you to use the department lab computers.

If you are working at home, or the lab computers still do not have the Phun package installed correctly, click here for a video on how to install the Phun package into Eclipse on your own.

- Topics
5 Jan - Course introduction, computing terms, first program, intro to 2D programs
Chapter 1
tutorial on how to get started
10 Jan - Variables, identifiers, assignment statements, console input and output, primitive data types, arithmetic, objects, classes and methods
Chapter 2.1

read program 1 and the sample programs

12 Jan - Strings, concatenation, string methods, more console input and output
Chapter 2.2, 2.3 and 2.4
17 Jan - Holiday
19 Jan - Classes, objects, methods, inheritance, 2D shapes, colors, javadocs

Program 1 is due before class.

Phun tutorial

Read program 2 description and sample code

24 Jan - Constructing 2D images from pieces (exercise skills)
Phun tutorial
26 Jan - Flow of control, if, while, for, boolean expressions, enumerations

Program 2 is due before class

Chapter 3.1-3.3, 4.1-4.2

Look at edu.byu.phun javadocs

31 Jan - Review flow of control, animation
2 Feb - Review for Exam
7 Feb - Exam 1
9 Feb - Classes and Methods
Chapter 5.1-5.2
14 Feb - Objects, Reference, animation
Chapter 5.3
16 Feb -

More on Objects and Animation

Program 3 is due before class time

21 Feb - Holiday
22 Feb - Names (Tuesday Class)
Chapter 6.1-6.7
23 Feb - Arrays
Chapter 7.4-7.5
28 Feb - Arrays
Chapter 7.1-7.3
2 Mar - No Class - Out of town
7 Mar - More Arrays

Program 4 due before class

9 Mar - Object Design Exercises
14 Mar - Inheritance
Chapter 8.1-8.3
16 Mar - Review
21 Mar - Exam 2
23 Mar - Exception Handling
Chapter 9.1-9.3
28 Mar - Recursion

Program 5 due before class

Chapter 11
30 Mar - Text File Input / Output
Chapter 10.1-10.3
4 Apr - 2D Scene save/load

Binary File Input/Output

Chapter 10.4-10.5
6 Apr - Data Structures

Program 6 due before class

Chapter 12.1-12.2
11 Apr - Generic Types
Chapter 12.3
13 Apr - Review for final

Program 7 due before class

16 Apr - 2:30 PM Section - Final Exam -2:30PM-5:30PM
21 Apr - 4:00 PM Section - Final Exam 11AM-2PM

  • Programs 50%
      For instructions on how to submit programs see the tutorial.
  • Exams
    • Exam 1 15%
    • Exam 2 15%
    • Final exam 20%

Programming Assignments


It does not matter what machine you use to implement your assignments. However, your code must be passed off on a Windows PC. Java is supposedly portable but is actually not in subtle ways. DO NOT WAIT until the last minute to make certain your code runs under Windows.


All programs are turned in through LearningSuite. There is a mechanism to upload files attached to each assignment in the Assignments section. Submit your source files, class files and any other data as a single zip file to Learning Suite. Include a "readme.txt" file that tells the TA how to run your program.

Late Policy

Programs are due 1/2 hour before class starts on the day the assignment is due. Program loose 10% per week up to a maximum of 40%. There is no way to pass the class by putting everything off until the end. Employers want to know that you can get stuff done on time. Your grade will reflect that.

  • ALL PROGRAMS ARE DUE BY NOON ON THE LAST DAY OF CLASS. No late submissions after that time.

Cheating Policy

All programming assignments (unless specifically indicated otherwise) are individual projects. They are designed to test your individual mastery of the material.

Students are encouraged to talk to each other, to the TAs, to the instructor or to search online for ideas and understanding that will help solve the programming assignment. However, the code should be your own. Copying from anyone else or from the internet is a violation of the Honor Code and will be dealt with as such.


TAs are located in 1058 TMCB in the far west corner (26) right near the 1060 lab.

  Mon Tues Wed Thurs Fri Sat
8AM Lane Richard Lane Richard Lane Cale
9AM   Richard   Richard Lane Cale
10AM Richard Richard Richard Danielle Lane Cale
11AM Richard, Lane   Richard, Lane Danielle Lane Cale
12PM Lane, Cale Richard Danielle, Lane Danielle Lane Cale
1PM Cale   Danielle   Lane  
2PM Cale Danielle Richard   Cale  
3PM   Danielle   Lane Cale  
4PM   Cale   Lane Cale  
5PM Danielle Cale Richard Richard    
6PM Danielle Cale Richard Richard    
7PM Danielle Cale   Richard    


Role of Teaching Assistants

Teaching assistants are provided to help you with your assignments and to do grading. They cannot debug your programs. They can answer questions and give explanations but your code is generally too complex for them to help much.

If you have a problem with how one of your assignments was graded, contact the TAs first and if you are not satisfied, talk to the instructor. If you have a question about requirements for a problem email the instructor. To prevent confusion, theTAs have been asked not to interpret requirements.