CS 152: Computer Programming Fundamentals
in Java

Computer Science Department
University of New Mexico

Instructor:
Joel Castellanos
Department of Computer Science
e-mail: cs152-instructor@cs.unm.edu

Course Description
CS-152 offers a solid foundation in the art of computing. For most students, CS-152 should not be a first course in computer programming, but should only be taken after being familiar with writing computer programs in Java or some other computer language such as Python, MATLAB, C/C++, Fortran, or BASIC. That said, CS-152 does not have any formally required prerequisites: An introductory programming class, (such as CS-105 ), significant high school programming experience either from a class or club, and self-taught programming experience can be sufficient preparation for CS-152.

The primary emphasis of this course is to develop fluency in working with conditional control flow, looping structures, and procedural programming techniques. The secondary emphasis is to apply those skills in solving computational problems.

CS-152 is a project based course: students spend many hours writing programs that for a wide range of applications. In past semesters these have included business applications, multimedia manipulations, video games, simulations of complex systems, and scientific models.

CS-152 is currently taught using the Java programming language in the Eclipse Integrated Development Environment.

While Java is an Object Oriented Programming (OOP) language and while students in CS-152 will certainly be working with Objects, CS-152 is not a course on OOP. Experienced programmers with solid skills in control flow, procedural programming and computational problem solving should skip CS-152 and take CS-251 (Intermediate Programming). CS-251 is also currently taught in Java and its primary emphasis is on unerstanding, developing and applying OOP skills.


Syllabus & Lab Schedule

Textbook and Required Materials:
i-clickerŪ. Available UNM bookstore. Register your i-clidker here.
Note: Register using your UNM NetID, NOT your student ID.

Java: An Introduction to Problem Solving and Programming (6th Edition) by Walter Savitch
First few sections of textbook:
  1. Chapter 1, Section 1
  2. Chapter 1, Section 2
  3. Chapter 1, Section 3
  4. Chapter 1, Section 4


Lecture Notes and Labs:
  1. Welcome to CS-152
  2. Hello World: Intro to Eclipse IDE
  3. Lab 1: Your Name in ASCII Art
  4. Ch1: Introduction to Computers and Java
  5. Ch1: Simple Graphics using Applets
  6. The Hallowed CS-152 Coding Standard
  7. Lab 2: Change Maker
  8. Ch2: Variables, PrimitiveTypes and Expressions
  9. Ch2: JOptionPane
  10. Ch2: String Class
  11. Ch3: If Statements
  12. Lab 3: Roach Population
  13. Ch3: Boolean Expressions
  14. Ch4: While Loop
  15. Source Code: Picture.java Version 2013.2.22. This is a utility class used in many labs and projects in CS-152.
  16. Source Code: DrawResize.java This is an exmple file that makes use of the Picture class's resize listener.
  17. Lab 4: Parsing and Drawing a String of Commands With Loops
  18. Using Joel's Picture Class
  19. Chapter 4: for loops
  20. Chapter 4: Programming Tips
  21. Chapter 5: Class and Method Definitions
  22. Lab 5: Lindenmayer Systems
  23. Lab 6: Lindenmayer Systems with user input turn angle
  24. Midterm Exam Review
  25. Random
  26. Space Invaders
  27. Lab 7: Lightsaber Battle
  28. Diffusion Limited Aggregation - a project from Fall 2012
  29. The javax.swing Graphical User Interface widget toolkit.
  30. The Chaos Game
  31. Working with Images
  32. Lab 8: Buttons and Images
  33. PrimeFactorAttack BonusLevel: The Upgrade
  34. Chapter 6: More about Objects and Methods
  35. Image Histograms: This was a project from a past semester. The slides include concepts and quiz questions that will be useful to study for the final exam.
  36. Final Exam Review



Past Exams:
  1. Midterm Exam from Spring 2013
  2. Final Exam from Fall 2012
Ongoing Class Project: Prime Factor Attack
  1. Prime Factor Attack Website