This course will teach fundamental concepts of computer programming, including how to write small object-oriented programs. This course begins with basic elements of programming languages (such as variables, constants, expressions and statements). The course then examines objects and object-oriented programming in detail, culminating in the ideas of overriding and inheritance.
CS 125 is intended for students who have no prior computer programming experience. Students who have performed well on a course meeting the requirements of ICS3M (see http://www.edu.gov.on.ca/eng/curriculum/secondary/techedcis11ex/) should consider taking CS135.
Prerequisites: None
Successors: CS 134 (for Math and CS students), CS126 (for other students)
Used in course: DrJava
Assumed knowledge: Computer literacy.
Java: An Introduction to Computer Science & Programming,
4th ed., by Walter Savitch, Prentice-Hall.
Course notes.
3.0 lecture hours plus one 2.0 hour lab per week. Available in Fall, Winter and Spring.
Introduction (3 hrs) Introduction to the course. Computer hardware and memory; programming languages. A First Java application program. Compilers, interpreters and (virtual) machines. Using an IDE Tokens, types, and values. Number systems and data representation.
Basic concepts in programming (3 hrs) Basic program structure. Variables and constants. Operators. Expressions and simple statements. The class String. A brief overview of objects. Simple output.
Control structures (6 hrs) 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.
Object-oriented programming (15 hrs) Invoking String methods. Defining methods. Invoking methods on user defined objects. Simple parameters. Return values. Instance variables. Local variables. Scope, visibility and persistence; encapsulation. Accessor and mutator methods. Variables of a class type and objects, writing your own classes. Creating objects. Objects in the memory model. Objects as parameters. Methods calling methods; helper methods being private. Static methods and variables. Top down design, systematic testing. Overloading. Writing constructors.
Arrays (6 hrs) 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.
Advanced object-oriented concepts (5 hrs) Class structure and inheritance. Accessing the parent class. Overriding methods. Simple OO dispatch. Inheritance.
History of computing (1 hr)