CS 102A Introduction to Computer Programming

Spring 2021 -- Fengwei Zhang

  • Instructor: Fengwei Zhang
  • Class Time: Monday 04:20PM - 06:10PM
  • Class Location: Room 102, Lychee Hill #1
  • Office Address: Innovation Park, Building 10, Room 501
  • Office hour: Monday 06:10pm - 06:50pm or 08:50pm - 09:50pm
  • Homepage: http://cse.sustech.edu.cn/faculty/~zhangfw
  • Email: zhangfw (at) sustech (dot) edu (dot) cn

Course Description

The course aims to cultivate students who have no programming experience before their university study. In this course, we will introduce the fundamentals of object-oriented programming language and programming techniques. The students will be familiar with the popular programming language Java and be able to construct programs for solving general problems.

Course Objectives

Upon successful completion of this class, the student will gain experience in:

Prerequisites

N/A.

Recommended Book

Java: How to Program (8th Edition), P. Deitel, H. Deitel (Java大学教程第八版,2012年出版,图书馆有借)
Book

Lab Sessions

Grading Policy

The grades for the course will be based upon the tables given below

Academic Dishonesty

Please read and fill the Undergraduate Students Assignment Delcaration Form in Chinese and English.

Student Disabilities Services

If you have a documented disability that requires accommodations, you will need to register with the University for coordination of your academic accommodations, or let me know.

Class Schedule

Date Topic Assignments & Announcements (tentative) Slides & Labs
Week 1, 01/11 Introduction to Computers and Java
  • Course Overview
[CourseOverview]
[Slides]
[Lab1]
Week 2, 01/18 Introduction to Java Applications, Data Types
  • First Glance of Java Programs
  • Java’s Primitive Types
  • Arithmetic Computation
  • Evaluation Order & Decision-making Statements
[Slides]
[Lab2]
Week 3, 03/01 Control Statements I (including structured programming) Welcome Back!

Assignment 1 was out on Blackboard [Assignment1]
Please submit the assignment via Online Judge (OJ) [OJ Tutorial Site]
  • Control Statment Introduction
  • If Else Selection Statement
  • While Statement
  • Counter-Controlled and Sentinel-Controlled Repetition
  • Type Cast and Scope
  • Operators
[Slides]
[Lab3]
Week 4, 03/08 Control Statements II (including structured programming)
  • For Statement
  • Do While Switch Break Continue Statements
  • Logical Operators
  • Structured Programming
[Slides]
[Lab4]
Week 5, 03/15 Array Assignment 2 was out on Blackboard [Assignment2]
  • Array Declaration and Creation
  • Array Initialization Rolling Dice Example
  • Enhanced For Statement
  • Two and Multi Dimensional Arrays
[Slides]
[Lab5]
Week 6, 03/22 Procedural programming (static methods, APIs)
  • Why Use Methods
  • Program Modules and Static Methods
  • Details of Methods
  • Method-call Stack and Argument Passing
  • Method Overloading and Command-line Args
[Slides]
[Lab6]
Week 7, 03/29 Introduction to OO (Classes, Objects, Methods) Assignment 3 was out on Blackboard [Assignment3, LocalJudge.java]
  • Introduction to Object-Oriented via Car Story
  • Class and Method Declaration
  • Object Creation & Method Calling & Instance Variables & Getter and Setter
  • Constructors
  • Case Study Ⅰ Pet Show
  • Case Study Ⅱ Account Balances
[Slides]
[Lab7]
Week 8, 04/05 No Class
  • No Class Due to Qingming Holiday (清明节)
Week 9, 04/12 Strings and Wrapper Classes Assignment 4 was out on Blackboard [Assignment4]
Project description was out on Blackboard [Project Description]
  • String Class
  • String Methods
  • StringBuilder and Wrapper Classes
[Slides]
[Lab8]
Week 10, 04/19 Classes, Objects and Methods: A Deeper Look
  • Designing Classes & Controlling Access to Class Members
  • Data Hiding and This Reference
  • Overloaded Constructors & Setter Getter Methods
  • Composition
  • Static Variables and Methods
  • final Instance Variables and Garbage and PackagesCollection
  • Java Heap Stack Memory
[Slides-part1]
[Slides-part2]
[Slides-Self-Study]
[Lab9]
Week 10, 04/25 Object-Oriented Programming: Inheritance
  • Inheritance Introduction
  • Superclass and Subclass
  • A Payroll Application & Overriding
  • Subclass Constructor & Accessing Fields of Superclass
  • Super Keyword and Inheritance Summary
[Slides]
[Lab10]
Week 11, 04/26 Object-Oriented Programming: Polymorphism
  • Polymorphism in OOP
  • Polymorphic Behavior
  • Abstract Classes
  • 1 Case Study A Payroll System Using Polymorphism
  • 2 Case Study A Payroll System Using Polymorphism
  • final Methods and Static Binding and Java Interface
  • Interface Example - Developing a Payable Hierarchy
[Slides]
[Lab11]
Week 12, 05/03 No Class Assignment 5 was out on Blackboard [Assignment5]
  • No Class Due to Labor Day Holiday (劳动节)
Week 13, 05/10 Generic Classes and Methods,Generic Collections (ArrayList)
  • Motivation of generic methods
  • Declaring and using generic methods
  • Bounded Type Parameter and ArrayList
  • Generic classes
  • The “hardest” question about generics
  • Generic Collections

  • GUI Programming (brief overview, self-study)
[Slides]
[GUI Slides]
[Lab12-GUI]
Week 14, 05/17 Exception Handling: A Deeper Look
  • What exceptions are & How exception handling works
  • Exception class hierarchy & Checked unchecked exceptions
  • Stack traces and chained exceptions
[Slides]
[Lab13]
Week 15, 05/24 Course Review & Project Demo
  • Review and Demo
  • Invited Lunch/Dinner if your final score is 96% or more
[Slides]
[Final Exam Topics]

Acknowledgement: This course includes material from Dr. Yepang Liu and Dr. James Yu at SUSTech