Introduction to Computer Programming (CS 1302) - Spring 2015

People


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

Announcements


0 - Piazza Class Link: https://piazza.com/cityu.edu.hk/spring2015/cs1302/home
1 - Project 2 has been released, see Project section for details.

Key Info.


    Syllabus:https://eportal.cityu.edu.hk/bbcswebdav/institution/APPL/Course/20122013/CS1302.htm
    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: http://www.w3schools.com/html/html_intro.asp
    JavaScript Tutorial: http://www.w3schools.com/js/js_intro.asp

Programming environment/Debugging

    Visual Studio (see Lab 1 for details): http://msdnaa.cs.cityu.edu.hk/
    Visual Studio Problem: Please contact Mr KO, Man Hong
    Debugging Script: 1. IE; 2. Firefox
    PASS (see Lab 2 for details): https://pass3.cs.cityu.edu.hk/
    PASS Account Problem: Please contact Mr LEE, Sheung Hang Angus
    FTP Account Problem: Please contact Mr KO, Man Hong

Others

    HOT Questions: http://www.cs.cityu.edu.hk/~qiyang/courses/cs1302/hotq.html
    Wiki: http://zh.wikipedia.org/wiki/JavaScript

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:
    LectEx02_solution.pdf,
    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:
    LectEx03_solution.pdf,
    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
    (NULL)
    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:
    LectEx08_solution.pdf,
    Week 10
    Week 11 JavaScript Global Functions and Objects II Slides: FuncObjII.pdf
    Source Code: Code Samples
    Questions: LectEx11.pdf Solutions:
    Lec11_solution.pdf
    Week 12 Questions: LectEx12.pdf Solutions:
    Lec12_solution.pdf
    Week 13 (NULL) (NULL)

Tutorials


    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.
    (NULL)
    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:
    Template
    Solution:
    Tut05_ClickableCalculator_Solution.html
    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,
    Solution:
    Tut04_TicTacToe_Solution.html
    7: Use of random numbers, Color codes, onkeyup and onload events Tasks: Tut07.pdf
    Supplementary material: Tut07_GuessBlue.html
    Tut07_RGB_Combination.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: 12LongArms.zip
    Task 2
         a) Template: Tut07_Task2.html
         b) Images: 12ShortArms.zip
    Images for Optional Task
        Additional pictures for 60 minsec.zip
    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
    2. CHIMES.WAV
    Solution to:
    1. Task 1,
    2. Task 2.
    12: Using the Date object 2 Tasks: Project 4: Date Difference Calculator
    (NULL)


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.