OutSchool CS1: Introduction to Computer Science and Programming with Java
-
Introduction to the computer
-
Using and interacting with computers
(---- this material is taught in lab sessions)
- Using and Interacting with a computer in general:
click here
------
PPT
- Using and Interacting with a UNIX computer
in the MathCS lab:
- Using the BlueJ Integrated Development Environment (IDE):
-
Intro to the Java Programming language
- Using the (stand-alone) Java programming language compiler:
click here
------
PPT
- What does a computer program contain - statements and variables:
click here
- Executing a computer program:
click here
- Comparing the organization of a Java program to
that of a book:
click here
- The building blocks of a Java program:
click here
-
Storing and manipulation numerical information
- Floating point numerical information:
click here
- Floating point operators and floating point expressions:
click here
- Arithmetic expressions containing Mathematical functions:
click here
- Importing methods in Java's library:
click here
- Invoking (using) methods in Java's library:
click here
- Using Java's Scanner class
to read input from the console input:
click here
- Assignment statements using the same variable in LHS and RHS:
click here
- Different types of numerical information:
- Floating point variables of different lengths:
click here
- Integers:
- Summary automatic conversion rules:
click here
- Mixing integer and
floating point numbers in an
arithmetic operation:
click here
- Numerical literals and named constants:
click here
- Short-hand operators:
click here
- The assignment expressions:
click here
- The ++ and -- operators:
click here
- External reference page on
priority and
associativity of Java's operators:
click here
-
The character and string data types
-
Conditional statements and Boolean expressions
-
Loop statements
- The while-statement:
click here
- Writing algorithms
using the while-statement:
click here
- Desiging loops: the loop invariant
click here
- Advanced algorithm - the Bisection Method:
click here
- Programming errors on using
the while-statement:
click here
- The break and
continue
statements:
click here
- Using the while-statement to
process data files:
click here
- The for-statement:
click here
- Writing algorithms
using the for-statement:
click here
- Advanced algorithm - the Rectangle Method:
click here
- Advanced algorithm - Exact Pattern Matching:
click here
- A simple Monte Carlo simulation using a for-loop:
click here
- Using nested for-loops in simple graphics:
click here
- Using nested for-loops in parsing:
click here
- The break and
continue
statements inside a
for-statement:
click here
- Re-writing the for-statement
with a while-statement and vice versa:
click here
- The do-statement:
click here
-
User defined (class) methods
- Introduction to methods:
click here
- The different kinds of variables in a Java program:
click here
- Memory organization -
storing variables efficiently
in the RAM memory:
click here
- Local variables and how to recognize them:
click here
- The life time of local variables:
click here
- The scope of local variables:
click here
- An important property of local variables:
click here
- Parameter variables:
click here
- The method invocation mechanism and
the System stack:
click here
- Parameter passing mechanism: pass-by-value :
click here
- Parameter passing mechanism: pass-by-reference :
click here
- Class variables:
click here
-
The array data structure
- Introduction and motivation:
click here
- The basics of the array data structure:
click here
- Working with arrays (of numbers):
click here
- Simple algorithms on an array - sum, min:
click here
- Copying an array and changing the size of an array:
click here
- The array doubling algorithm:
click here
- Array of the type String:
click here
- The command line arguments:
click here
- Array of the type char - another way to represent string:
click here
- Converting String to array of char and
vice versa:
click here
- Storing multiple information
on items --- Parallel arrays:
click here
- Sort an array - the selection sort algorithm:
click here
- Passing an array as parameter
to a method:
click here
- Making an algorithm more available (i.e., more useful):
click here
- Returning an array as return value
from inside a method:
click here
- Example returning an array from a method - Sieve of
Eratosthenes
click here
- 2-dimensional arrays:
click here
- Using 2-dimensional arrays ---
making pictures on a 400x300 grid:
click here
- (SKIP: (too difficult)
Using 2-dimensional arrays ---
The Gaussian Elimination Algorithm for
simultaneous equations:
click here )
-
Classes: user-defined types
- Instance variables, objects and
user-defined types
(classes with only
variables) --- information on bank account:
click here
- Life time and scope of
Instance variables:
click here
- Object typed parameter variables:
click here
- Instance methods:
click here
- Shadowing instance variables by
local/parameter variables:
click here
- Computer lingo: what is an object --
click here
- Copying an object:
click here
- Classes with private variables
(and
public methods):
click here
- Special features built-in to objects:
- User-controlled
initialization
of objects - Constructor methods:
click here
- User-controlled
conversion
of objects into String representation -
toString():
click here
- Principles of Object Oriented Programming -
Information hiding and Abstract Data Types (ADT):
click here
- Example of Object-Oriented programming (OOP):
a deck of playing cards
- Implementing playing cards:
click here
- Using the Card class:
click here
- Passing a Card object to an
instance method of the Card class:
click here
- Implementing a deck of cards:
click here
- Using the DeckOfCards class:
click here
- Decoupling in action:
Changing the implementation of
the Card object:
click here
- Using the deck of card: play Poker
(5 card stud)
- Introduction to the
game of Poker:
click here
- Playing Poker
on a computer
- a Poker card game method library
- Designing the Poker library:
click here
- Checking for Poker hands:
click here
- Monte Carlo experiment to find
the probabilities of Poker hands:
click here
- Prepare to play Poker --- Assigning values to Poker hands:
click here
-
The String data type
- Review of Strings in Java and some:
click here
- Comparison operations (instance methods) on Strings:
click here
- Finding substrings (instance methods) in Strings:
click here
- Some transformation operations (instance methods) on Strings:
click here
- Converting String to array of char and
vice versa:
click here
-
Solving complex problems with computer programs:
Modular programming
- Modular programming and the divide and conquer
methodology:
click here
- A Case study: Text formatting
-
Recursion
-
Packages
- Putting a class into a package:
click here
- Using classes from a package (in same directory):
click here
- Using classes from a package in an abitrary directory:
click here
- The package access specifier:
click here
-
Inheritance: extending (re-using) existing classes (software)
- Intro to inheritance:
click here
- Adding more instance
variables and methods
to a derived class:
click here
- Access specifiers and Inheritance:
click here
- Using constructors in the base class:
click here
- The type information of variables:
click here
- Converting between user-defined types: Upcasting
and Downcasting
click here
- Application of upcasting:
click here
- Summary on the access specifiers in Java:
click here