Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

CSCI 2910 JavaScript Syntax Quiz - Spring 2007 - Prof. David L. Tarnoff, Quizzes of Computer Science

A javascript syntax quiz from a university course, csci 2910, held in spring 2007. The quiz covers various topics such as the location of javascript code, termination characters, conditional execution, and escape characters. It also includes a brief discussion on the benefits and drawbacks of interpreted languages.

Typology: Quizzes

Pre 2010

Uploaded on 08/18/2009

koofers-user-4c8-2
koofers-user-4c8-2 🇺🇸

5

(2)

10 documents

1 / 2

Toggle sidebar

Related documents


Partial preview of the text

Download CSCI 2910 JavaScript Syntax Quiz - Spring 2007 - Prof. David L. Tarnoff and more Quizzes Computer Science in PDF only on Docsity! Name: ________________________________ CSCI 2910 JavaScript Syntax Quiz Spring 2007 1. In which of the following locations can JavaScript code be placed? Circle all that apply. a.) In the head of an XHTML file b.) In a separate text file c.) In the body of an XHTML file d.) As an attribute of an XHTML tag e.) After the </body> tag of an XHTML file 2. Each line of a JavaScript program must be terminated with the character _______. a.) / b.) > c.) # d.) < e.) ~ f.) . g.) ; h.) : 3. Modify the code below so that browsers that do not support JavaScript will ignore the code. <script language="javascript" type="text/javascript"> <!-- document.writeln("<h1>Hello, World!</h1>"); //--> </script> 4. How many times will the code inside the following for-loop be executed? __4 times____ for (i = 0; i < 10; i = i +3) document.writeln("i = " + i + "\n"); If inserted into an XHTML file, the above code will output the following text: i = 0 i = 3 i = 6 i = 9 5. The \n in the previous question represents an escape character that outputs a carriage return. Give another example of an escape character along with the expected output. Escape character: ______________ Expected output: ____________ The following is from the PowerPoint lecture slides from last Thursday: \n newline \t tab \r carriage return \\ backslash \" double quote \' single quote 6. True or false: JavaScript is case sensitive. 7. Name one of the benefits discussed in class of an interpreted language. • Interpreted programming language can run on any platform or O/S as long as there is an interpreter that runs on that particular setup. • Server processing time is saved by not having to run scripts • May be faster in cases where communication with server is eliminated
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved