CS1301 Display the details LectEx03Q3.html LectEx03Q4.html"> CS1301 Display the details LectEx03Q3.html LectEx03Q4.html">

Presentation is loading. Please wait.

Presentation is loading. Please wait.

Page 1 Lecture Exercise ( Wk3) CS1301 Introduction To Computer Programming (11-12 Semester B) Question 1. Fill in the missing.

Similar presentations


Presentation on theme: "Page 1 Lecture Exercise ( Wk3) CS1301 Introduction To Computer Programming (11-12 Semester B) Question 1. Fill in the missing."— Presentation transcript:

1

2 Page 1 Lecture Exercise ( Wk3) CS1301 Introduction To Computer Programming (11-12 Semester B) www.cs.cityu.edu.hk/~helena Question 1. Fill in the missing code: -- In the application, the user can type a name and then click "Invitation", then the corresponding message is updated, with "Dear …" displayed in the span: " Demo <input type="button" value="Invitation" /> Please come to my birthday party on May 18, 2007. See you! Yours, Helena LectEx03Q1.html (i)var x, a, b; a = 4; b = 4*8; x = a+b; a = b; b = a; (ii)var a,b,x; a=1; b=2; x=3; 4=a; a+b=x; Question 2 Explain what are done (or error) by the code:

3 Page 2 Question 4 According to the following code, what will be shown in the page? Try calling functions function x1() {return 100; } function x2(value) {return value+5; } document.write(x1()); document.write(' '); document.write(x2(9)); document.write(' '); document.write(x2('9')); Question 3 There are 3 errors in the given code (one is not visible). Can you find some of them? Demo <body onload="alert('CS1301 Introduction to Computer Programming');"> CS1301 <a href="javascript: document.getElementById('info') = 'CS1301 ' + 'Introduction to Computer Programming ' … + ' - Computer programming is the craft of ' + 'writing useful, maintainable, and extensible instructions ' + 'which can be interpreted by a computing system ' + 'to perform a meaningful task. ' ; void(0);"> Display the details LectEx03Q3.html LectEx03Q4.html


Download ppt "Page 1 Lecture Exercise ( Wk3) CS1301 Introduction To Computer Programming (11-12 Semester B) Question 1. Fill in the missing."

Similar presentations


Ads by Google