Syllabus for
SW 408
– Visual Programming with Java, V1.0
School of Engineering
Graduate Course Catalog 2000-2001 :
An introduction to Java programming for experienced programmers.
Object-oriented programming, using Java, Packages, Multi-threading,
Classes, Inheritance, Exceptions, Interfaces, and the Abstract Window
Toolkit. The HTML and Java Model, Java Basics, Java code basics, data
types, and flow of control. (Prerequisite: Significant programming
experience or CS 132)
Note: This course may be substituted for SW 403 in order
to meet the requirements for core courses.
Textbook:
Java, Java, Java –
Object-Oriented Problem Solving ,
Ralph Morelli, Prentice Hall, ISBN 0-13-011332-8.
Computer Usage:
Students MUST have access to
a computer with a Java compiler. Metrowerks CodeWarrior Academic Pro
for Windows 95, 98, NT is strongly suggested and will be used in
class. E-mail access is required.
Course Notes: Handouts
/diskettes/e-mail
When: Fall Semester, Monday, 6:30- 9:20, Thursday,
6:30-9:20, Saturday 9AM – 12PM
Where: Bannow Science Center, Room 257
Who: Mr. Marquis (Saturday) Dr. D. Lyon (Monday and
Thursday)
Phone:
(203)641-6293
Fax: (203)877-4187
E- mail:
maynard_marquis_99@yahoo.com,
lyon@docjava.com
Office Hours:
Monday, Wednesday or Thursday; 6 pm - 6:30
pm in class room (Dr. Lyon)
Monday, Wednesday or
Thursday; 5 pm - 6:00 pm in Mc108 (Dr. Lyon)
Or by appointment (Dr. Lyon).
Saturday, 8:30 – 9:00 AM in classroom
(Mr. Marquis)
Part 1: Join the list!
This course is to be conducted in a partly on-line manner. Plan to
spend a little time each day getting your e-mail. All students are
required to have e-mail access and to join the class list.
To join the class list:
Point your web browser to:
http://www.docjava.com/java/The_Docjava_Java_Page.html
Then subscribe yourself...also add yourself to the notification
list
Course Learning Goals:
1 – To teach how to write
computer code in Java.
2 – To provide the
means to leverage object-oriented programming.
3 - To prepare the
student for advanced courses in Java.
Student Activities:
Learning a new computer language is
very much a hands-on activity, which cannot be learned from lectures
or textbook reading alone. It does require those lectures and
textbooks, but the real learning results from the laboratory trials
and the homework assignments. To achieve the course objectives, the
student must have good class attendance and participation, conduct
the computer programming tasks during the laboratory periods as well
as the assigned homework. Homework assignments and laboratory trials
are due at the beginning of the class following the assignments. They
are to be placed in an envelope containing the student’s name.
The contents of the envelope will be a diskette and a paper copy of
the requested Java source code.
Course Requirements:
The schedule of activities and
topics to be covered each week are outlined below. Each week will
begin with responses to questions and a brief review on the previous
week’s topics. The first week will begin with administrative
announcements and a review of this syllabus.
Week 1
- Introduction to Java and
Object-Oriented Programming
1 - Java Introduction
including the Java & HTML Models
2 - O-O Design including
Encapsulation, Inheritance, Polymorphism, Objects, Classes, and Class
Hierarchy.
3 - Java Syntax and
syntax example
4 - Java Packages,
Application structure, Class structure, and Method structure.
5 - O-O Example showing
encapsulation, inheritance, polymorphism, modularity, and
extendibility. (And using syntax, application structure, class
structure, and method structure).
Goals:
To define the characteristics of O-O
design and show an O-O example the first day. To provide an
understanding of class hierarchy. To introduce those portions of Java
Basics necessary to show the O-O example.
Outcome: The student
will be able to understand and write simple Java programs, which
illustrate the concepts of O-O design. Outcome:
Students can write and run hello
world.
Students can set up a small class hierarchy,
with mammals,
humans, students and professors.
Students can display a class hierarchy
graphically using the
code warrior IDE.
Week 2
- Java Basics
These are topics having
equivalents in other languages and should be familiar to the
students. They will be introduced in this week. Some will be covered
in greater detail later in the course.
1 - Reserved Words, Case
Sensitivity
2 - Primitive Data Types
(a word on Class String)
3 - Operators
4 - Control Structures
5 - Methods (structure,
overloading, special methods: main and constructor)
Goals: To introduce basic elements of the Java language,
which permit the development of algorithms within a program. To
understand the use of methods and the passing of variables.
Outcome: The student
will be able to introduce modularity into his Java program by the use
of methods. He or she will also be able to introduce mathematical
relationships and selection criterion.
Weeks 3, 4, 5
- Important Java Concepts
1 - Modifier Visibility,
Class Scope
2 - Modifier Abstract
(Classes & Methods)
3 - Interfaces
(Implementing in classes and extending other interfaces, more
inheritance & polymorphism).
4 - Inner Classes (and
again class scope)
5 – Reserved Word
“this”
6 - Modifier Static
(variables and methods)
Goals:
To provide the student with the Java
concepts that give object-oriented programming its modularity and
extendibility benefits.
Outcome:
The student will be able to
control the scope of a variable or method. He will be able to use the
concept of Abstract Methods and Interfaces to amplify and further
demonstrate O-O inheritance and polymorphism.
Week 6
- Primitive Data Types and Wrapper
Classes
Arrays and Vectors
1 – More
information on Primitive Data Types
2 – Methods in
their Wrapper Classes, pp. 100-104,
3 - Casting, pp. 275
4 – Arrays –
their construction, passing variables, pp. 407-67
5 – Vector Class
and its methods, pp. 446-447
Goals:
To provide the student with the
means to manipulate data within his or her program, converting from
one data type to another. To also provide the student with a means of
grouping the data into the containers, arrays and vectors.
Outcome: The student
will be able to write Java programs containing large amounts of data
in an efficient manner. He will also be able to increase and
demonstrate the efficiency, in terms of lines-of-code, of O-O
programming using the containers.
Week 7
- Strings and Processing
1 – String Class
2 – String
constructors
3 – String methods
4 –
StringBufferClass
5 –
StringTokenizerClass
Goals:
To provide the student with the
means to work with text-type data in Java programs.
Outcome: The student
will be able to create, read, and parse text using Java programs.
Week 8
– Graphical User Interface
Components and Listeners
1 – GUI Components:
Frames, Labels, Buttons, List, CheckBox, RadioButton, ComboBox, Menu
2 – Event
Listeners: WindowListener, ActionListener, ItemListener,
ListSelectionListener, ChangeListener, MouseListener,
MouseMotionListener, and KeyListener
Goals:
To give the student the components
necessary to create computer screen displays and to respond to events
occurring on the screen.
Outcome: The student
will be able to place GUI components onto a computer screen and to
respond to events such as a mouse click or the push of a button.
Week 9
– Midterm Exam
Week 10
– Review Midterm Exam and GUI
Container Layouts
1 – Container
Layouts: FlowLayout, BorderLayout, GridLayout, BoxLayout, CardLayout,
and GridBagLayout
2 – Layouts using
CodeWarrior
Goals:
To provide the means of arranging
and manipulating GUI components in desired patterns on the computer
screen.
Outcome:
The student will be able to design
functional and aesthetic displays on the computer screen using Java
classes and using CodeWarrior.
Week 11
- Graphics and Drawings
1 – Color control
2 – Font control
3 – Drawings:
Lines, Rectangles, Ovals, Arcs, Polygons, PolyLines
Goals:
To provide the means to control
color and font characteristics on the screen display and to draw
basic geometric shapes.
Outcome:
The student will be able to add
color to the screen display, to control the type and size of text
characters, and to draw shapes on the screen.
Week 12
- Exceptions
1 – The try block
2 – throw and
throws
3 – The catch block
4 – The finally
block
Goals:
To expose and explain Java exception
handling to the students.
Outcome: The student
will be able to create exception handling in Java programs, and he or
she will be able to respond to requests for exception handling when
using someone else’s code.
Week 13
- File I\O, input & output
streams
1 – Class hierarchy
of java.io
2 – Input Stream,
OutputStream
3 – Reader, Writer,
OutputStreamWriter
4 – Class File
Goals:
To teach the student
the
techniques used in Java to transfer data to and from computer files.
Outcome:
The student will be able to create
files and read from computer files using Java. In particular, he or
she will be able to create or read from files in the ASCI text
format.
Week 14
- Multi-threading
1 – Class Thread
2 – Priorities and
Scheduling
3 - Synchronization
4 – Runnable
Interface
Goals:
To expose the student to concurrent
programming and give him the tools to design multithreaded programs.
Outcome:
The student will be able to use the
Thread class and Runnable interface to design, write, and synchronize
multithreaded Java programs.
Week 15
– Final Exam
Morelli Chapter 12,
Recursive Problem Solving and Chapter16, Data Structures, are not
peculiar to Java and will only be covered as time permits. Some of
the Data Structures, Arrays and Vectors, are covered in Week 6.
Morelli Chapter 4, Applets, is not essential in a fundamental course
and will not be covered. Chapter 15, Sockets and Networking, will not
be covered in this course, and is relegated to an advanced course.
Additional References:
1 – Sun’s
Application Programming Interface, available in CodeWarrior.
2 – Java How to Program , Deitel & Deitel, Prentice Hall, Third Edition,
1999.
3 – The Java Class Libraries , Chan and Lee, Addison Wesley (c) 1997.
4 – Java Source Book ,
Ed Anuff, The John Wiley and Sons, Inc., First Edition, 1996.
5 – The Java Programming Language , K. Arnold & J. Gosling, Addison Wesley, Second
Edition.
Grading Policy:
Homework and Laboratory
Trials: 1/3
Midterm Exam : 1/3
Final Exam : 1/3
Assignments are due at
the beginning of class. Assignments handed in during class lose 5
points, after class 10 points. Late submittals lose 10 points per day
including weekends and holidays. Missing a test results in a zero
unless a written excuse is presented.
Mapping: Syllabus to Textbook
Week No. Topic Morelli Pages
Week 1 Introduction to Java and
Object-Oriented Programming
1 Java Intro
2 O-O Design, Encapsulation, Inheritance,
Polymorphism,Objects,Classes, Class Hierarchy 7-10, 58,60
3 Java Syntax 23, 34
4 Java Packages, Application Structure,
Class Structure, Method Structure 22-24, 61,63,69,70,74
5 O-O Example
Week 2 Java Basics
1 Reserved Words(Keywords), Case
Sensitivity 25,94
2 Primitive Data Types 94
3 Operators 232-240
4 Control Structures 137-145,
286-302
5 Methods 118-136
Weeks 3,4,5 Important Java
Concepts
1 Modifier Visibility, Class
Scope 69,71,72,75
2 Modifier Abstract (Classes and
methods) 205211
3 Interfaces 178179
4 Inner Classes 486-488
5 Reserved Word "this" 186211
Week 6 Primitive Data Types and Wrapper
Classes
Arrays and Vectors
1 More information on Primitive Data
Types 80,81,94-96
2 Methods in their Wrapper
Classes 97-104
3 Casting 259260275
4 Arrays 407-467
5 Vector Class 446-447
Week 7 Strings and Processing 345
1 String Class
2 String Constuctors
3 String methods
4 StringBufferClass
5 StringTokenizerClass
Week 8 Graphical User Interface
Components and Listeners 470
1 GUI Components
2 Event Listeners
Week 10 GUI Container
Layouts 470
1 Container Layouts
2 Layouts using CodeWarrior
Week 11 Graphics and Drawings 533
1 Color Control
2 Font Control
3 Drawings
Week 12 Exceptions 599
1 The try block
2 throw and throws
3 The catch block
4 The finally block
Week 13 File I/O, input & output
streams 763
1 Class hierarchy of java.io
2 InputStream, OutputStream
3 Reader, Writer,
OuputStreamWriter
4 Class File
Week 14 Multi-threading 702
1 Class Thread
2 Priorities and Scheduling
3 Synchronization
4 Runnable Interface
Mapping: Syllabus to Textbook
Week No. Topic Morelli Pages
Week 1 Introduction to Java and Object-Oriented Programming
1 Java Intro
2 O-O Design, Encapsulation, Inheritance, Polymorphism,Objects,Classes, Class Hierarchy 7-10, 58,60
3 Java Syntax 23, 34
4 Java Packages, Application Structure, Class Structure, Method Structure 22-24, 61,63,69,70,74
5 O-O Example
Week 2 Java Basics
1 Reserved Words(Keywords), Case Sensitivity 25,94
2 Primitive Data Types 94
3 Operators 232-240
4 Control Structures 137-145, 286-302
5 Methods 118-136
Weeks 3,4,5 Important Java Concepts
1 Modifier Visibility, Class Scope 69,71,72,75
2 Modifier Abstract (Classes and methods) 205211
3 Interfaces 178179
4 Inner Classes 486-488
5 Reserved Word "this" 186211
Week 6 Primitive Data Types and Wrapper Classes
Arrays and Vectors
1 More information on Primitive Data Types 80,81,94-96
2 Methods in their Wrapper Classes 97-104
3 Casting 259260275
4 Arrays 407-467
5 Vector Class 446-447
Week 7 Strings and Processing 345
1 String Class
2 String Constuctors
3 String methods
4 StringBufferClass
5 StringTokenizerClass
Week 8 Graphical User Interface Components and Listeners 470
1 GUI Components
2 Event Listeners
Week 10 GUI Container Layouts 470
1 Container Layouts
2 Layouts using CodeWarrior
Week 11 Graphics and Drawings 533
1 Color Control
2 Font Control
3 Drawings
Week 12 Exceptions 599
1 The try block
2 throw and throws
3 The catch block
4 The finally block
Week 13 File I/O, input & output streams 763
1 Class hierarchy of java.io
2 InputStream, OutputStream
3 Reader, Writer, OuputStreamWriter
4 Class File
Week 14 Multi-threading 702
1 Class Thread
2 Priorities and Scheduling
3 Synchronization
4 Runnable Interface