Computer Science 104 - Programming Fundamentals and Methodology

Computer Science 104

Programming Fundamentals and Methodology

Lecture Session 4, Fall 2001

10:00-10:50, MWF, LTB

[http://www.cs.ust.hk/~cktang/cs104/index.html]
General information
Course outline
Schedule
Grade
What's new

What's new

General information

Instructor

Dr. Chi-Keung TANG
Office : Room 3561, Computer Science Department (via lift 27-28)
Office hours: to be announced
Phone : 2358-8775 (x8775)
Email : cktang@cs.ust.hk
I shall be at your laboratory sessions regularly to answer your questions.
You can also make appointment by email or call.

Teaching Assistants

Laboratory/Tutorial 4A 4B 4C
TAs Jiaya JIA
[Suk Yee AU, Chi Yung WANG]
Kong Hong PUN
[Feng Wang, Rui GAN]
Chi Yung WANG
[Kong Hong PUN, Jun MIAO]
Email leojia@cs.ust.hk konghong@cs.ust.hk wcyung@cs.ust.hk

Lab 4A Tue 09:00-10:50 4221 (CS Lab 1)
Lab 4B Tue 11:00-12:50 4221 (CS Lab 1)
Lab 4C Tue 13:00-14:50 4221 (CS Lab 1)
Tutl 4A Thur 12:00-12:50 3412
Tutl 4B Thur 13:00-13:50 3412
Tutl 4C Thur 14:00-14:50 3412

Text

Problem Solving with C++ (3rd ed), Walter Savitch, Addison-Wesley, 1998.

Prerequisite

This is the very first fundamental programming class for first year CE/EE students. A small portion of the class quota is available as free electives.

Exclusions

COMP102, COMP 103, or COMP 105 (prior to 98-99)

Course objective

This class covers important, fundamental topics in structured programming, and introduces object-oriented programming concepts. After this class, you should be able to analyze a given description of a resonably-sized problem, which may be informal, or in plain English, and translate it into working computer coding.

Through this class, we hope you can develop (1) the right mentality to solve a computation problem, and also (2) excel at the right programming tool, such as C++. We help you to achieve this goal by encouraging you to attend lectures and to complete laboratory assignments.

If you copy laboratory assignments from others, the above objectives will be defeated. Also, you and your friend who provide you the solution are subject to be penalized equally (e.g. F, expulsion), under the departmental guidelines on cheating.

Though, we encourage discussion among classmates, which forms an integral part of learning and improvement. If you have doubt on what is allowed and what is not, please contact Dr. Tang.

The pertinent topics we intend to cover are as follows: problem solving, program design, procedural abstraction, debugging and testing, recursive programming, class and objects, abstract data types, linked list, searching and sorting.

Web page

The Web page for this course is http://www.cs.ust.hk/~cktang/cs104/index.html. Announcements can be found at course newsgroup. Please read it regularly to find important information regarding the class.

Course requirement

Grades will be evaluated by one mid-term exam, one final exam, and 11 lab exercies. Tentative (due) dates and their weights are as follows:
Mid-Term Exam 30% Wed, 10/23/2001 LT A
Final Exam 40% Dec 19 (Wed), 4:30 - 7:30 pm @ indoor sports hall
11 lab assignments 30% 5pm, every Mon (except labs 1 and 2)
Optional, Difficult Project!! up to 2 sub-grades last day of class

Laboratory and Tutorial Schedule

        Sat Next lab assignment posted on the class website.
        Tue [lab]   Lab session - you are encouraged to demo your program by the end of the lab
        5pm, Mon   Deadline for turning in lab assignment by email (except labs 1 and 2)
        Tue The followings are posted on the web:
(a) model answer
(b) your grade at here
        Thur [tutorial] (a) go over model answer to last week's lab
(b) discussion, questions, and quiz

Please note that your final letter grades will be computed based on your performance among all students of COMP104.
Failure to show up in exams without prior approval will result in an F in this class. Medical proof after the exam may be considered unacceptable. If there is any emergency you should call the the computer science department at 2358-7000.

Academic integrity

The
UST Academic Integrity and Discipline prohibits plagiarism. All UST students are responsible for reading section 12 of Academic Regulations, which appears on pp. 21-24 of the 2001-2002 Academic Calendar. In this course we encourage students to study together. This includes discussing general strategies to be used on individual laboratory assignments. However, all work submitted for the class is to be done individually, unless an assignment is specified otherwise.

Some examples of what is not allowed by the conduct code: copying all or part of someone else's work, and submitting it as your own; giving another student in the class a copy of your assignment solution; consulting with another student during an exam. If you have questions about what is allowed, please discuss it with the instructor.

Programming facilities

You will find it convenient to use the on-campus PCs at computer barns and the computer science UG labs for the laboratory assignments. All of them are installed with Microsoft Visual C++ 6.0. For your own convenience, you may consider purchasing a desktop or laptop of your own, if you have not got one. For instance, the HKUST Notebook/Desktop Ownership Program sells IBM ThinkPad Notebook and Aptiva at a discounted price. (Here we are only stating one option, not endorsing it anyway. For details, you may watch out the booths in the Academic Concourse at the beginning of the semester.)

back to top


Course Outline

  1. Introduction (2 weeks)
    Background, problem solving using C++, basic datatypes

  2. Structured programming constructs (2 weeks)
    if, while, do-while, for-loops, nested loops, structured breaks

  3. Procedural abstraction (2 weeks)
    Functions, pass by value, pass by reference

  4. Recursion (1 week)
    Recursive datatypes and functions

  5. Aggregate datatypes (1 week)
    Array, strings, function arrays

  6. Dynamic datatypes (1 week)
    Pointers, dynamic arrays, linked lists, binary trees

  7. Abstract datatypes (object-oriented programming) (2 weeks)
    Classes, data encapsulation, objects, dynamic objects

  8. Simple algorithms (2 weeks)
    Array searching and sorting
back to top

Tentative Schedule

You may print four slides per physical page to save paper and save print quota. To do this, after selecting "Print" from the "File" menu, hit the "Properties" button. Scroll down until you see "Pages per Sheet: <1 (Portrait)". Then, you choose "4 (Landscape)", hit "OK".
Tentative Course Schedule
WK.
Lect.
Date
Topic/Notes
Book
  Quiz 
Lab
Extra 
Practice
1
1
2
3
3 Sept
5 Sept
7 Sept
Introduction
Hardware & Software
Problem solving (updated: 09/08/2001)
1.1
1.2
1.3
 
Lab 1
2
4
5
6
10 Sept
12 Sept
14 Sept
Problem solving
C++ basics (updated: 09/08/2001)
C++ basics
1.4
2.1
2.3
Q1
Q2
Lab 2
lab2.cpp
extra2
solution
3
7
8
9
17 Sept
19 Sept
21 Sept
If statements (Updated: 09/16/2001)
Switch and nested if
While loops (Updated: 09/20/2001)
2.4
7.2
7.3
Q3
Lab 3
lab3.cpp
extra3
solution
4
10
11
12
24 Sept
26 Sept
28 Sept
For loops, Do-while loops & break
Nested loops
Arrays[updated]
7.3
7.4
9.1
Q4
Lab 4
lab4.cpp
extra4
solution
5
 
13
14
1 Oct
3 Oct
5 Oct
[ Public Holiday ]
Functions
Functions
   
3.1-2
3.3
 
(no lab)
extra5
solution
6
15
16
17
8 Oct
10 Oct
12 Oct
Pass by value
Pass by reference, Pass array as parameters
Local vs. global scope
3.4
4.2
3.5
Q5
Q6
Lab 5
lab5.cpp
extra6
solution
7
18
19
20
15 Oct
 17 Oct 
19 Oct
File i/o
Character i/o & strings, ascii.cpp
Review ,(old midterm) Solution to old midterm
5.1
5.3
    
Q7
Lab 6
lab6.cpp
extra7
solution
8

 

21

22 Oct
23 Oct
24 Oct
26 Oct
(no class)
Midterm 2001 [solution] (7-9PM LTD; no class in day)
(no class)
Go over midterm
 
 
(no lab)
 
9
22
23
24
29 Oct
31 Oct
2 Nov
Array searching
Array sorting
Classes(.cpp)
9.2
9.3
6.2
Q8
Lab 7
lab7.cpp
extra9
solution
10
25
26
27
5 Nov
7 Nov
9 Nov
Classes
Classes
Abstract data types  (.cpp)
6.3
6.3
8.1
Q9
Q10
Lab 8
lab8.cpp
extra10
solution
11
28
29
30
12 Nov
14 Nov
16 Nov
Abstract data types
Abstract data types
Dynamic objects I
8.1
8.1
11.1
Q11
Lab 9
lab9.cpp
extra11
solution
12
31
32
33
19 Nov
21 Nov
23 Nov
Pointers 
Dynamic objects II, (.cpp), dynamic objects as function parameters (.cpp)
Linked lists  (.cpp)
11.2
11.3
14.1
Q12
Q13
Lab 10
lab10.cpp
extra12
solution
13
34
35
36
26 Nov
28 Nov
30 Nov
Linked lists
Linked lists
Recursion
14.1
14.2
12.1
Q14
Q15
Lab 11
lab11.cpp
extra13
solution
14
37
38
39
 
3 Dec
5 Dec
7 Dec
19 Dec
Recursion examples
(make-up class)
Review (old final)
Final  Dec 19 (Wed), 4:30 - 7:30 pm @ indoor sports hall
12.2
Q16
(no Lab)
extra14
solution
back to top
Maintained and updated by Chi Keung Tang Fri Aug 31 03:03:06 CST 2001.