This course will teach fundamental concepts of computer programming, including how to write small object-oriented programs. This course begins with a review of elements of programming languages (such as variables, constants, expressions and statements). The course then examines objects and object-oriented programming in detail, including the ideas of overriding and inheritance. The course ends with an introduction to graphical user interface (GUI) components.
CS 133 is for Mathematics students who have substantial experience writing programs with selection, repetition, and procedures with parameters. Students with little experience or who already know the contents discussed here should consult "Typical Course Sequence" under the "Programs" section of the CS Handbook.
Prerequisites: CS 120 or Grade 11 or 12 or OAC Computer Science or 4M Computer and Information Science; registration in the Faculty of Mathematics or Software Engineering.
Successor: CS 134.
Antirequisites: CS 112, 121, 122, 123, 133, 130, 131, 132, 135, CHE 121, CIVE 121, ECE 150, GENE 121, PHYS 239, SYDE 121.
Used in Course: Student labs are equipped with a Java development environment. Students may use a Java development environment on their personal computers for course work and assignments.
Java: An Introduction to Computer Science and Programming, 4th ed., by Walter Savitch, Prentice Hall, 2004. Course notes.
Three hours of lectures, and one 2 hour lab per week. Normally available only in the Fall. Also offered at St. Jerome's in the Fall.
Introduction (3 hours) Overview of the course. Review of basic concepts, including types, values, number systems, data representation, variables, constants, expressions, statements, input and output. Simple Java programs. Basic object-oriented concepts. Instantiating objects from existing classes, invoking methods. The class String.
Control Structures(3 hours) Conditional statements (if-else). Logical and Boolean expressions. Nested and compound statements. While loops. Different kinds of loops (for, do-while). Nesting loops. Tracing and debugging.
Working with Classes (6 hours) Class and method definitions. Simple parameters. Return values. Instance variables. Local variables. Static methods and variables. Scope, visibility and persistence; encapsulation.
Classes and Objects (6 hours) Creating objects. Objects in the memory model. Objects as parameters. Methods calling methods; helper methods being private. Overloading methods. Top down design, systematic testing. Writing constructors.
Arrays (4 hours) Arrays: declaration, creation and indexing. Arrays of primitive types. Iterating through arrays. Arrays as parameters and return values. Arrays of objects. Searching arrays and simple array processing. Sorting an array. Two dimensional arrays. Exceptions.
Files (4 hours) Advanced input and output. Streams and files. Text and binary files. File I/O. Exceptions.
Advanced Object-Oriented Concepts (4 hours) Class structure and inheritance. Accessing the parent class. Overriding methods. Simple OO dispatch. Inheritance.
Graphical User Interfaces (6 hours) Types of GUI components, layout managers, event delegation model, named inner classes. Extending an existing class to make a customized component.