Docsity

CSE 3 Quiz 5 - Winter 2007, Exercises of Computer Science

Toggle sidebar
bg1
Signature ____________________ Name _____________________
cs3wb_____
Student ID ___________________ Score:
Quiz 5
CSE 3
Winter 2007
Circle the correct answer.
1. If we want to cycle/loop through an array of 10 elements such that when we get to the end we start
indexing back at the beginning of the array again, we would use which expression to set the index
variable each time in the loop:
A. index = (index + 1);
B. index = 0;
C. index = (index + 1) % 10;
D. index = (index + 1) / 10;
2. In a
setTimeout( "spinWheel1()", duration);
call, the duration units is:
A. milliseconds
B. seconds
C. minutes
D. hours
3. What color is #424242:
A. universal
B. dark gray
C. light gray
D. translucent
4. Which of the following is true:
A. an example of analog is a wave form
B. an example of digital is a CD
C. an example of analog is the output of a stereo speaker
D. all the above
5. Which of the following iterates 10 times?
A.
for (i = 1; i < 10; 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. The index of the last element in an array that has n elements is:
A. (n + 1)
B. (n โ€“ 1)
C. n
D. (n % 1)
(Over)
pf2

Partial preview of the text

Download CSE 3 Quiz 5 - Winter 2007 and more Exercises Computer Science in PDF only on Docsity!

Signature ____________________ Name _____________________

cs3wb_____

Student ID ___________________ Score:

Quiz 5

CSE 3

Winter 2007

Circle the correct answer.

  1. If we want to cycle/loop through an array of 10 elements such that when we get to the end we start indexing back at the beginning of the array again, we would use which expression to set the index variable each time in the loop: A. index = (index + 1); B. index = 0; C. index = (index + 1) % 10; D. index = (index + 1) / 10;
  2. In a setTimeout( "spinWheel1()", duration); call, the duration units is: A. milliseconds B. seconds C. minutes D. hours
  3. What color is #424242: A. universal B. dark gray C. light gray D. translucent
  4. Which of the following is true: A. an example of analog is a wave form B. an example of digital is a CD C. an example of analog is the output of a stereo speaker D. all the above
  5. Which of the following iterates 10 times? A. for (i = 1; i < 10; 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. The index of the last element in an array that has n elements is: A. (n + 1) B. (n โ€“ 1) C. n D. (n % 1)

(Over)

  1. Which of the following correctly checks if image1, image2, and image3 are all the same image: A. if ((image1.src == image2.src) && (image2.src == image3.src)) B. if ((image1.src == image2.src == image3.src)) C. if ((image1.src = image2.src) || (image2.src = image3.src)) D. if ((image1.src = image2.src) && (image2.src = image3.src))
  2. Which of the following is a lossless type of compression: A. MPEG B. JPEG C. run length encoding D. MP
  3. MPEG works by using JPEG compression on each frame and: A. recording the audio in a separate file (thus reducing the size of the MPEG file) B. tracking changes between frames (thus recording only these changes) C. completely eliminated every 3rd^ frame (thus the name MP3 as the most popular type of MPEG) D. converting all the bits to hexadecimal (since 4 bits can be represented as 1 hexadecimal digit)

Fill in the blanks.

  1. Humans hear at roughly 20 KHz, so CD-quality sound is digitized at about ______ KHz. As discussed in class, a common full CD-quality audio file type is _________ (what file type/extension).
  2. The Internet friendly size/resolution of pictures we discussed in class is _________ x _________.
  3. A common audio compressed file type discussed in class is _________ (what file type/extension).
  4. The index of the first element in an array is always _________.
  5. The question(s) you would most like to see on the Final Exam is: