COSC 1320 Introduction to Computer Science II

Having as many practices as possible is the right way to learn a language!

There is NO lab for this course, so please do compile and modify the provided examples!

Be sure to check the course webpage frequently for updates and announcement!

Final Exam on May 6 (FRIDAY!!) from 8am-11am (location: SEC 100)!

The exam will cover all the materials of Java (NO C++ content).

Spring 2016


Course summary

This course aims to introduce the students the principles of object-oriented programming with the examples of C++ and Java languages.

The goal is to prepare students with the fundamental programming skills of C++ and Java for the future large-scale OOP tasks.

Prerequisites:

COSC 1410 Introduction to Computer Science I

Textbooks (required):

1) Absolute C++ (5th/6th edt.), 2) Absolute Java (5th/6th edt.), Walter Savitch, Addison-Wesley.

Recommended Reading:

Software and IDE (tutorials should be available in the blackboard learn):

Detailed syllabus is also available in the blackboard learn.


Schedule


TIMELINE
MATERIAL COVERED
WEEK 1 (01/19, 21) OOP Principles, Classes in C++
WEEK 2 (01/26, 28) Inheritance Mechanism
WEEK 3 (02/02, 04) Polymorphism and Virtual Functions
WEEK 4 (02/09, 11) Stream, File I/O, Templates
WEEK 5 (02/16, 18) Exception Handling, UML (Exam 1)
WEEK 6 (02/23,25) Classes in Java
WEEK 7 (03/01, 03) Java Inheritiance, Polymorphism, Abstract Class
WEEK 8 (03/08, 10) Java File I/O, ASCII text file processing (Exam 2)
SPRING BREAK
WEEK 9 (03/22, 24) Binary File I/O,
WEEK 10 (03/29, 31) Java Exception Handling, Java Interface and Inner Classes
WEEK 11 (04/05, 07) Java Swing I
WEEK 12 (04/12, 14) Java Swing II
WEEK 13 (04/19, 21) Final Reviews
WEEK 14 (04/26, 28) Final Group Project Presentations
Final Exam on May 6 (Friday!!) from 8:00am-11:00am (location: SEC 100)! The exam will cover all the materials of Java (NO C++ content).

Schedule and Materials

Come and visit the course webpage often, as the materials will be updated constantly without notice.

Week 1 (Ch 6~8, except 7.3)

Main goal: review OOP principles, important concepts of class, object, encapsulation, abstract data type (ADT), constructors,

Knowledge points that you should know:

Additional examples: (Again, please compile and play with the following examples, try to break the rules and see what would happen!)

An example of course grade for students, cpp1, cpp2, (constructors, destructor, dynamic memory allocation)

An example of a clock class cpp3 (constructors and operator overloading)

An example of car cpp4 (constructors)

A different employee example cpp5 (constructors, destructor, dynamic memory allocation, dynamic creation of objects)

Please be familiar with your selected programming environment. Be sure to compile and execute the examples of the textbook and the course webpage!

Week 2 (Ch.14) Inheritance

Main goal: understand the mechanism and benefits of inheritance of OOP, and know how to implement it in C++.

Knowledge points that you should know:

Additional materials:

Week 3 (Ch.15) Polymorphism and virtual functions

Main goal: Get familiar with the Polymorphism mechanism of OOP and how to achieve that in C++.

Knowledge points that you should know:

Additional materials:

Week 4 (Ch.16) C++ Stream and File I/O, Template

Main goal: Get familiar with the exception handling in C++ and another form of polymorphism, i.e., templates.

Knowledge points that you should know:

Additional materials:

File I/O examples (cpp1, cpp2, cpp3);

Template function examples (cpp1, cpp2)class templates (ch 7.3 the std::vector example!)

Week 5 Exception Handling, UML introduction, Exam 1 reviews

Main goal: Get familiar with C++ exception handling; introduction to the unified modeling language (UML).

Knowledge points that you should know:

Additional materials:

Exception handling examples (cpp1, cpp2, cpp3, cpp4)

NOTICE THE NEW TIME AND LOCATION for Exam1!

Mid-term exam 1 on Feb. 19 (FRIDAY!!) from 9am-11am (location: MH 150)! The exam will cover all the knowledge points from Week1 to Week4

Week 6 (Java introduction and Java class)

Main goal: get familiar with the class definition and usage in Java; understand and know how to use inheritance in java

Knowledge points that you should know:

Additional materials:

Java passes by value example (.zip)

Jave reference example(.zip)

Week 7 ( Ch.4, Ch.5, Ch.7, Java inheritance, continued; Java Polymorphism)

Main goal: This week, we will continue learning Java inheritance mechansim and get started to learn Java Polymorphism.

Knowledge points that you should know:

Additional materials:

Jave inheritance examples (.zip1, .zip2)

Jave access modifier (.zip)

Figure example (polymorphism) (.zip)

Private methods cannot be overridden in Java! (see this example and try to play with the access modifier of the print() function in the Base class)

Abstract class example (.zip)

In class exercise (Dog class)

Java extra exercis 2 (.docx)

Week 8 (Ch.8, Ch. 10, Jave File I/O)

Main goal: Understand the concept of Abstract class and interface and their usage. We will learn (or revisit in some sense) how to perform File I/O in java, especially text file processing. We will also have a quick review for Exam 2!

Knowledge points that you should know:

Additional materials:

lecture examples (Ex1, Ex2)

Challenge: Can you re-implement assignment 2 using Java?

Mid-term exam 2 on Mar. 11 (FRIDAY!!) from 9am-11am (location: MH 170)! The exam will cover all the knowledge points after mid-term exam1.

Spring break (Mar.14~Mar.20)

Week 9(Mid-term2 results, File I/O continued; Term projects)

Main goal: Continue file I/O in java, read/write binary files, object serialization;

Knowledge points that you should know:

Additional materials:

Binary file examples (zip)

Object serialization examples (zip)

In class project (docx)

Week 10 (Exception Handling; Interface (cont.) and Inner Classes)

Main goal: Exception handling in Java; revisit Java Interface and a number of useful interfaces that Java provides to the programmer; learn how to utilize the mechanism of inner class

Knowledge points that you should know:

Additional materials:

Exception handling examples (zip)

Inner class and anonymous class examples (zip)

Week 11 (Swing I)

Main goal: Understand the mechanism of GUI program, even-driven-programming, and the basic model of GUI programming using Swing.

Knowledge points that you should know:

Additional materials:

Many examples shown in the class are from the textbook (Absolute Java)!!

Extra example for the grid layout with borderlines (.java)

Animation example (.zip)

A good place to find other swing example [A java swing tutorial (http://zetcode.com/tutorials/javaswingtutorial/)]

Week 12 (Java Swing, continued)

Main goal: continue the introduction of other standard usage of swing package. If you master the basic steps of creating a hierarchical GUI program from the previous lectures, the following will be trivial.

Knowledge points that you should know:

Additional materials:

The examples of JTextField, JTexaArea, ImageIcon, and WindowListener are all from the textbook (Absolute Java)!

Example of Graphics (.zip). Please do not forget the above animation example!

Example of JOGL (.zip)

Examples of MouseListener (.zip1, .java, .zip2)

Week 13 (Final reviews and final projects)

Main goal: we will review what we have learned about Java and give you time to work on your final projects.

Week 14 (Term Porject Presentation)

Guidelines: We will do a final project presentation for each group. Each group will do a 8~10 minutes presentation with live demo of their developed systems. All students will participate to the grading of other groups' projects. Be fair and be critical. Let us choose our champion!

Final exam will be on May 6 (Friday!!) from 8:00am-11:00am (location: SEC 100)! The exam will cover all the material of Java (NO C++ content).


Links to valuable C++ programming resources:

Links to valuable Java programming resources: