Docsity

CS3 Fall 2005 Quiz 5 - JavaScript and Programming Concepts, Exercises of Computer Science

Toggle sidebar
bg1
Signature ____________________ Name _____________________
cs3f_____
Student ID ___________________ Score:
Quiz 5
CSE 3
Fall 2005
Circle the correct answer.
1. Local variables declared in a function:
A. can be used outside that function
B. cannot be changed within that function
C. can be used outside the function, but cannot be changed outside the function
D. can only be used in that function
2. Output directly onto a Web page from JavaScript (as if it was HTML code typed in directly onto a Web
page) is done with:
A. document.alert()
B. document.write()
C. document.print()
D. HTML tags like <form>
3. Inputs to a function (the identifiers in the parens of a function definition) are called/known as:
A. defaults
B. parameters
C. globals
D. input elements
4. In JavaScript, a line beginning with // is a(n):
A. assignment statement
B. double divide statement
C. double quoted string
D. comment
5. Which of the following iterates 10 times?
A.
for (i = 1; i <= 11; i = i + 1)
B. for (i = 0; i < 10; i = i + 1)
C. for (i = 10; i >= 0; i = i - 1)
D. all of the above
6. In JavaScript, the plus sign always means:
A. addition
B. add 1
C. concatenation
D. A or C
(Over)
pf2

Partial preview of the text

Download CS3 Fall 2005 Quiz 5 - JavaScript and Programming Concepts and more Exercises Computer Science in PDF only on Docsity!

Signature ____________________ Name _____________________

cs3f_____

Student ID ___________________ Score:

Quiz 5

CSE 3

Fall 2005

Circle the correct answer.

  1. Local variables declared in a function: A. can be used outside that function B. cannot be changed within that function C. can be used outside the function, but cannot be changed outside the function D. can only be used in that function
  2. Output directly onto a Web page from JavaScript (as if it was HTML code typed in directly onto a Web page) is done with: A. document.alert() B. document.write() C. document.print() D. HTML tags like
  3. Inputs to a function (the identifiers in the parens of a function definition) are called/known as: A. defaults B. parameters C. globals D. input elements
  4. In JavaScript, a line beginning with // is a(n): A. assignment statement B. double divide statement C. double quoted string D. comment
  5. Which of the following iterates 10 times? A. for (i = 1; i <= 11; i = i + 1) B. for (i = 0; i < 10; i = i + 1) C. for (i = 10; i >= 0; i = i - 1) D. all of the above
  6. In JavaScript, the plus sign always means: A. addition B. add 1 C. concatenation D. A or C

(Over)

  1. i++ in JavaScript means: A. add the value of i to itself and store the result in i B. add 1 to i and store the result in i C. check to see if i is positive D. string concatenate with the plus sign
  2. Converting sound from continuous to discrete format is done with a(n): A. CD-to-DVD converter B. digital-to-analog converter C. MP3-to-WAV converter D. analog-to-digital converter
  3. MPEG works by using JPEG compression on each frame and: A. tracking changes between frames (thus recording only these changes) B. completely eliminated every 3rd^ frame (thus the name MP3 as the most popular type of MPEG) C. converting all the bits to hexadecimal (since 4 bits can be represented as 1 hexadecimal digit) D. recording the audio in a separate file (thus reducing the size of the MPEG file)

Fill in the blanks.

  1. Variables declared outside a function are ____________ in scope.
  2. A random number generated by Math.random() in JavaScript is always between ______ and ______.
  3. The Internet friendly size/resolution of pictures we discussed in class is _________ x _________.
  4. Humans hear at roughly 20 KHz, so CD-quality sound is digitized at about ______ KHz.
  5. The program I used in class to perform a batch resizing of pictures and create an HTML file of thumbnails with links to the resized images is called _________________________.
  6. The question(s) you would most like to see on the Final Exam is: