IB CS Java - for the Core Syllabus for exams in 2014
by Dave Mulkey , Germany, Aug 2012
Introductory
Notes
-
Computation - calculation,
decisions, repetition
-
Data - input, output, storage, processing
- Input and Strings
Cafeteria Prices , Overdue
Books (dates)
,
ISBN
Validation (String character functions), String Notes and Practice
Matching Birthdates (with
format checking) , Mixed
Up Letters (String functions) , Encryption
- Arrays (linear)
Appointments , CD list (search in array) ,
CD List 2 (sorted)
,
Bookstore (parallel
arrays),
Data List, Queue - uses an ARRAY to
store a Queue of names
- Collecting and Saving Data
eMail
Addresses ,
eMail 2
(saving to disk file) , Saving Prices (write to
disk file)
- Objects for records and
Collections
Dance
Name List (vector
collection) , Check-out Trip List
(Array of Objects)
- 2D Arrays
Tic Tac Toe
, Ski Hotel
, Game Of Life
(simulation)
- Sorting and Searching
Test
Score Stats (sorting)
, Primes (searching) , Binary Search
, Bubble Sort
Notes about
sorting, with illustrations and demonstrations
OOP Samples
They following programs demonstrate the use of OOP techniques.
IBIO Test - code
for the IBIO commands in JETS
Fractions - a
program to add fractions which are stored as Objects
Blackjack - a
simple card game simulation, using a CARD class
Stack - uses a
STACK stored in a Linked-List to reverse a list of words
BinaryTree
- alphabetical binary search tree
You may find it easier and/or more satisfying to write OOP code in BlueJ,
which clearly shows separate classes and connections between them.
If you do switch to BlueJ, keep in mind that it uses STANDARD Java,
and is missing some of the Processing commands that make things
easier.
Most of your code will work the same, but you will need to write
standard class headers and a main method.
GUI, Graphics and other Interesting Commands
You may find the following demonstrations useful for project work.
These examples are presented in Processing programs, but you might
wish to use NetBeans
for project work, as it makes lots of GUI and
other OOP construction faster and easier. Specifically,
NetBeans
supports Swing components. Swing components are more complex
to use, but provide numerous helpful, advanced features.
Buttons and
Pictures - Uses AWT Buttons to display pictures
NumList - input
numbers and store them in an AWT List box
Quiz Questions with Parallel
Arrays - quiz questions with pictures
Storing Data in Files
Email List -
saves names and email addresses in a disk file
By
default, data files land in the same folder
where the EmailList.java file is saved.
Text
File Demo - input single Strings, collects them in a
LinkedList,
then saves all the Strings in a text file. Later it loads
all the Strings from the text file into the LinkedList.
Dates List -
(in Processing) uses "loadStrings" and "saveStrings" to read and
write
from
a text file. The loadStrings and saveStrings commands
are
sensible and store the .txt file(s) in the same folder
where the DatesList.java program is saved.