Comp 401 – Foundations of Programming

Course Overview

This course is intended for people who have learned to program.  Its goal is to teach you how to program well.  The common programming strategy of beginners is to write the first solution they can think of without carefully identifying and weighing different alternatives. For all but the simplest problems, this approach of writing ‘’quick and dirty’’ programs will take you to the debugging stage very quickly, but will make debugging slow. For large, complex programs, you need to identify multiple alternative solutions to the problem, choose an alternative that most directly solves the problem, and think carefully what your solution does, and how it works.  The claim is that, although “quick and dirty’’ programming may produce a program faster, the concepts we teach will help you produce a correct program faster. Moreover, they will lead to programs that are easy to change and reuse.

We assume you have learned the following basic programming concepts: primitive types (integers, real numbers, Booleans), variables, constants, assignments, comments, expressions, arrays, loops, arrays, and procedures/functions/methods. These concepts are taught in most if not all introductory programming courses regardless of whether they teach conventional or object-oriented programming. This course will teach you the next-level programming concepts.  These include objects, classes, interfaces, packages, inheritance, delegation, design patterns, exceptions, assertions, pointers, and formal correctness. These concepts will not help you solve new problems; rather, they will help you solve problems in new ways. The skills that will enable you to use these concepts will form a large part of the challenge you face in this course. After this course, you will have a much deeper understanding of the programming and learn some of the ideas that can make programming a science.  We will be using Java as a vehicle for learning these concepts.

More Detailed Course Overview

Instructor

Prasun Dewan (Lectures)

Office: FB 150

Phone: 919-962-1823

Email: dewan@cs.unc.edu

Office Hours: MW 3:30-4:45

Teaching Assistants

John Hansen

Office: SN 044

Phone:  962-1960

Email: jbhansen@cs.unc.edu

Office Hours: Friday, 12:30-2:30pm

Robert Mills

Office: SN044

Phone: 962-1761

Email: rgmills@cs.unc.edu

Office Hours: TR, 10-11am

 

Lectures

Room: FB 009

Time: MW– 11-12:15pm

 

 

Unit ( Start Date)

Slides

Chapters

Assignments

1

Intro and Conventional Programming in Java (8/25, 8/30)

PowerPoint 2007

 

Word List Processor

WordAndNumberListProcessor

2

Objects (9/1)

PowerPoint 2007

Objects Chapter

4

State  (9/8, 9/13)

PowerPoint 2007

State Chapter

Objects

5

Interfaces (9/13, 9/15)

PowerPoint 2007

Interfaces Chapter

Tokens

7

Graphics  (9/15, 9/20)

PowerPoint 2007

Graphics Chapter

Graphics

8

Pointers (9/20)

PowerPoint 2007

Pointer Chapter

 

14

Variable-Sized Collections (Sep 20, 29)

PowerPoint 2007

Collections Chapter

Collections

17

Inheritance (Oct 4, 6, 13)

PowerPoint 2007

Inheritance Chapter

Inheritance

Midterm 1 Grade Distribution (Oct 20)

PowerPoint  2007

 

21

More Inheritance (Oct 13, 20, 27)

PowerPoint  2007

More Inheritance Chapter

Parsing

 Visiting Avatar

23

Generics and Adapters (Nov 1, 3)

PowerPoint 2007

Generics chapter

Generics and Delegation

15

MVC (Nov 8, 10, 15)

PowerPoint 2007

MVC Chapter

Observers

24

Command Objects (Nov 15, 17, 22)

PowerPoint  2007

Commands Chapter

Command Objects

18

Iterators (Nov 22, 29)

PowerPoint 2007

Iterator Chapter

Iterators, Exceptions, Assertions

                      Midterm 2 Grade Distribution (Dec 6)

PowerPoint 2007

 

19

Exceptions (Nov 29, Dec 6, 8)

PowerPoint 2007

Exceptions Chapter

 

20

Assertions  (Dec 8)

PowerPoint 2007

Assertions Chapter

 

 

Recitations

FB 009

Friday 11am-12:15pm

NOTE: Bring your laptops every Friday. You will use them for programming exercises.

Recitation material: Recitations

Downloads

ObjectEditor Version 3

oeall3

ObjectEditor Version 8

oeall8

ObjectEditor Version 11

oeall13

ObjectEditor Version 15

oeall15

ObjectEditor Version 16

oeall16

ObjectEditor Beta

oeall17

Final Grades

Background Material

 

Unit

Notes

1

Theater Analogy

Theater Chapter

3

Functions

Functions Chapter

6

Types

Types Chapter

10

Main and Console

Main Chapter

11

More Types

More Types Chapter

12

Conditionals

Conditionals Chapter

13

Loops

Loops Chapter

25

Recursion

Recursion Chapter