Introduction to Computer Programming (CS 1302) - Spring 2015


    Instructor: Yang, QingXiong (qiyang AT; Office: Academic Building 1, Y6638, close to lift 4)
    Tutorial Assistant 1: Xu, Xiaobin (xiaobinxu2-c AT; Office: Mong Man Wai Building, 2485 #11, Tuesday 16:00 - 17:30)


0 - Piazza Class Link:
1 - Project 2 has been released, see Project section for details.

Key Info.

    Lecture:Tuesday 9:00 - 10:50 at AC1 P4704
    Tutorial 1:Tuesday 12:00 - 12:50 at AC2 4200
    Tutorial 2:Tuesday 15:00 - 15:50 at AC2 5506
    Office Hours: Tuesday afternoon in my office (AC1 Y6638, close to Lift 4).
    Random Student Picker: link

Online Resources

Online Tutorials

    HTML Tutorial:
    JavaScript Tutorial:

Programming environment/Debugging

    Visual Studio (see Lab 1 for details):
    Visual Studio Problem: Please contact Mr KO, Man Hong
    Debugging Script: 1. IE; 2. Firefox
    PASS (see Lab 2 for details):
    PASS Account Problem: Please contact Mr LEE, Sheung Hang Angus
    FTP Account Problem: Please contact Mr KO, Man Hong


    HOT Questions:

Class Schedule (subject to change)

    DataTopicReading/Lecture NotesLecture Exercise Exercise Solutions
    Week 1
    Introduction to Computer & Programming Slides:
    Course Info.,
    Overview of JavaScript
    Source Code: Code Samples
    (NULL) (NULL)
    Week 2
    Program Structure I Slides: 2ProgramStructureI.pdf,
    Source Code: Code Samples
    (NULL) (NULL)
    Week 3
    Questions: LectEx02.pdf Solutions:
    Source Code: Given Code
    Week 4 (NULL) (NULL)
    Week 5 Program Structure II Slides: Lec04_ProgramStructureII.pdf,
    Source Code: Code Samples
    Questions: LectEx03.pdf NULL. Solutions:
    Given Code.
    Week 6 Quiz 1. Analysis on Quiz 1 (NULL) (NULL)
    Week 7 Program Structure III Slides: 4ProgramStructureIII, 4ProgramStructureIII-cont
    Source Code: Code Samples
    Week 8 Program Structure IV Slides: ProgramStructureIV
    Source Code: Code Samples
    Questions: LectEx07.pdf Solutions:
    1. LectEx07_solution.pdf,
    2. Q1: FloatingPoint.
    Week 9 JavaScript Global Functions and Objects I Slides: FuncObjI.pdf
    Source Code: Code Samples
    Questions: LectEx08.pdf Solutions:
    Week 10
    Week 11 JavaScript Global Functions and Objects II Slides: FuncObjII.pdf
    Source Code: Code Samples
    Questions: LectEx11.pdf Solutions:
    Week 12 Questions: LectEx12.pdf Solutions:
    Week 13 (NULL) (NULL)


    Tutorial No.Tutorial Tasks Tutorial Solutions
    1: Get familiar with HTML, FTP server and PASS HTML: PDF.
    FTP server: Start Project 1 (a personal website)
    Guidelines for setting up personal homepage:
    1) Video demo;
    2) Example: please right click on the link and choose save as. Modify the downloaded file according to the instruction here and rename it index.html. Finally upload it to FTP (under the "www" folder) using WinSCP;
    3) Password problem;
    PASS: Video Demo.
    2: from HTML to Javascript Tasks: PDF
    Supplementary material: Tut02.html, CS1301.gif
    Solution to:
    Task 1, 2, 3
    3: innerHTML - parseInt, summation (+) and -, *, / create a form with textbox, functions Tasks: PDF
    Result: Video.
    Supplementary material: Tut02_MarkCalc.html,
    Solution to:
    Task 1
    Task 1, 2
    4: innerHTML, pseudo-URL, function, parseInt, numbers and arithmetic operators Tasks: PDF
    Supplementary material:
    5-6: Equality Operator (= =), Assignment Operator (=), AND (&), Global variable, if .. else statement, return statement, true/false Tasks: PDF
    Supplementary material:
    Template, tic-tac-toe (wiki explanation), Winning Strategies,
    7: Use of random numbers, Color codes, onkeyup and onload events Tasks: Tut07.pdf
    Supplementary material: Tut07_GuessBlue.html
    Solution to:
    Task 1, Task 2
    8: Change image source, setInterval Tasks: Clock Animation.pdf
    Supplementary material:
    Task 1
         a) Template: Tut07_Task1.html
         b) Images:
    Task 2
         a) Template: Tut07_Task2.html
         b) Images:
    Images for Optional Task
        Additional pictures for 60
    Solution to:
    1. Required Task 1,
    2. Required Task 2,
    3. Optional Task 1,
    4. Optional Task 2
    9: Repetition structure (while loop and for loop) Tasks: Picture_Gallery.pdf
    Supplementary material:
    1. Template to start with
    2. images
    Solution to:
    1. Required Task,
    2. Optional Task 1.
    10: Random number generation, Math object methods, dynamic movement of HTML elements Tasks: Tut09.pdf
    Supplementary material:
    1. Template and images
    Solution to:
    1. Required Task,
    2. Optional Task.
    11: Using the Date object Tasks: Tut10.pdf
    Supplementary material:
    1. Tut10_template.htm
    Solution to:
    1. Task 1,
    2. Task 2.
    12: Using the Date object 2 Tasks: Project 4: Date Difference Calculator

Two Quizzes (in the lecture)

    Quiz 1 (Week 6, Feb. 17, about 50 minutes, in the lecture)Previous quiz papers
    Quiz 2 (Week 13, April 21, 2 hours, during the lecture)

Four Projects

    Project 1: Personal Website Project 2: Taxi fare calculator
    (Due: Week 13, Sunday (April 26), 23:59)(Due: Sunday, March 1, 23:59)
    Taxi Fare Calculator
    Project 3: Computer GameProject 4: Date Difference Calculator
    Due: End of Week 11 (Sunday), April 12, 23:59Due: End of Week 13 (Sunday), April 26, 23:59

University requirement on academic honesty

Violations of academic honesty are regarded as serious offences in the University. Acts such as plagiarism and fabrication of research findings can lead to disciplinary action. Most commonly the penalty is failure in a course, but in the most serious cases expulsion from the University and debarment from re-admission may occur.