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!

Spring 2014


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):

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

Recommended Reading:

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

Detailed syllabus is available in the blackboard learn.


Schedule and Materials

Come and visit often as the materials will be updated 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, UML intro

Main goal: understand the mechanism and benefits of inheritance of OOP, and know how to implement it in C++. Basic knowledge on UML (will get familiar with it through subsequent exercises)

Knowledge points that you should know:

Additional materials:

Answers to quizzs or In-class projects:

Week 3 (Ch.14) Review of Inheritance, Intro to UML

Main goal: review of the inheritance mechanism of OOP, a very brief introduction on UML (will get familiar with it through subsequent exercises), introduction to Polymorphism.

Knowledge points that you should know:

Answers to quizzs or In-class projects: In class project (01/30): questions, answers

Week 4 (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 5 (Ch.18, Ch.16) Exception Handling and Template

Main goal: Get familiar with the exception handling in C++ and the template mechanism.

Knowledge points that you should know:

Addition materials:

Lecture slides (exception handling pptx, C++ templates pptx)

Exception handling examples (cpp1, cpp2)

Template function examples (cpp1, cpp2)

class templates (ch 7.3 the std::vector example!)

Week 6 (Mid-term exam 1 and Java introduction)

Mid-term exam 1 on Feb. 18 at CEMO 100 D from 9:50am-11:20am! The exam will cover all the above knowledge points except UML!

Week 7 ( Ch.4, Ch.5, Ch.7, Java class and inheritance)

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:

Lecture slides (pptx)

group project (.docx) due on Wednesday (02/26) midnight. (one solution for your reference)

Can you use Java to re-implement what we have done using C++ above?

Week 8 (Ch.7, Ch.8, Java inheritance (continued) and Polymorphism, File I/O)

Main goal: Review what polymorphism is and why it is useful, learn how to achieve that in Java and how it is different from C++. Understand the concept of Abstract class and interface and their usage. Revisit the File I/O in java.

Knowledge points that you should know:

Additional materials:

Lecture slides (polymorphism pptx) (File_IO pptx)

lecture examples (ex1.zip, ex2.zip, figure_ex.zip)

In class quiz (.zip)

Spring break (Mar.10~Mar.16)

Week 9(Review and the second Mid-term)

Come to the Tuesday (Mar.18) lecture for a review. There will be reviews provided by the TAs before the exams. Please pay attentions to the announcement in the blackboard learn and in the class.

Mid-term exam 2 review slides (pptx).

Mid-term exam 2 review examples (ex1, ex2, ex3, ex4, file_ex).

Mid-term exam 2 on Mar. 20 at the same location of Mid-term1 (at CEMO 100 D from 9:50am-11:20am)! The exam will cover the Java programming from Week 5 to Week 8!

Week 10 (File I/O continued, Exception Handling)

Main goal: Review the File I/O in java, read/write text files, read/write binary files; exception handling in java.

Knowledge points that you should know:

Additional materials:

Lecture slides (File_I/O_2.pptx, Exception_Handling.pptx)

Class examples (binary_file_exs, object_serialization_exs, exception_handling_exs)

Week 11 (Term Project Review, UML, Interface and Inner class)

Main goal: Term project review, UML recap, interface and multiple inheritance in java, inner class.

Knowledge points that you should know:

Additional materials:

Term project rules (Important dates: deadline for term project proposal 9am April 8, 2014; deadline for submission of your term project 9am April 22, 2014)

UML_review_slides (ppt)

Week 12 (Java Swing)

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:

slides (pptx)

all examples shown in the class are from textbook

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

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

Week 13 (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.

Additional materials:

slides (pptx)

Week 14 (Term project presentations!)

Champion (earn 20% boost): Group 7 (Benito Martinez, Madison Morris) Sudoku

Second place (earn 15% boost): Group 5 (Carlos Puerta, Joey Lin, Paul Pham) ATM

Third place (earn 10% boost): Group 9 (Jairo Hernandez, Nikhil Baby) library

Congratulations!

April 29, make up class. (Final review pptx, example)

The final exam is on May 8th from 11:00 am - 2:00 pm at the room CEMO 100D. It covers everything about Java!


Links to valuable C++ programming resources:

Links to valuable Java programming resources: