190 likes | 296 Views
Where we’ve been…. How many bits are required to store the number 256? a. 3 b. 8 c. 9 d. 10. In a balanced tree with 8 leaf nodes, how many steps will it take to reach a leaf? a. 1 b. 2 c. 3 d. 4. A URL specifies:
E N D
How many bits are required to store the number 256? a. 3 b. 8 c. 9 d. 10
In a balanced tree with 8 leaf nodes, how many steps will it take to reach a leaf? a. 1 b. 2 c. 3 d. 4
A URL specifies: • The protocol to be used to download the web page • The domain name of the web server that contains the web page • The path of the web page on the web server • All of the above • Both (b) and (c)
What does the following program compute? A = 0; B = 0; for R = firstRow to lastRow { For C = firstCol to lastCol { A = A + Sheet[R,C]; B = B+1; } } C = A/B; • Computes the sum of all the numbers in Sheet • Computes the average of all the numbers in Sheet • Computes the standard deviation of all the numbers in Sheet • Finds the maximum value of all the numbers in Sheet.
Suppose you have a continuous tone image of a cat, and you would like to digitize it. Which of the following would tend to improve the quality of the resulting digital image? a. increasing the resolution b. decreasing the number of samples taken for each pixel c. increasing the dynamic range d. all of the above e. a and b f. b and c g. a and c `
Which of the images is generated by the following HTML file? <html> <script> inWord = "the"; theWord = "In"; begWord = "beginning"; alert(theWord+begWord); </script> </html>
The following HTML file generates the example form. Suppose that the user was to click on the “Hello” check box (where the arrow is pointing). Which of the image choices below would be generated? <html> <script> function whenClicked() { document.aForm.msg.value="say "+ document.aForm.hello.checked; } </script> <h2>Try this</h2> <form name="aForm"> <input type="checkbox" name="hello">Hello <br><input type="checkbox" name="bye">Good-bye <br>Message <input type="text" name="msg"> </form> </html> Answer: Hello box becomes checked, nothing else happens
How many arguments does the function have? function doSomethingElse(value, num) { if (value < 5) { return num - 1; } else { return num + 1; } } Answer: 2
What is the value returned by the function? function doSomething(number, firstName, lastName) { var message; if (number == 1) { message = "Hello"; } else { message = "Goodbye"; } message = message + " " + firstName + " " + lastName; alert(message); return message;} doSomething(1,"Fred","Flintstone") ? Answer: “Hello Fred Flintstone”
Object representations of pictures are? a. easy to create but difficult to edit b. more difficult to edit than pixel representations of pictures c. easier to edit than pixel representations of pictures d. difficult to create and difficult to edit
Which of the following picture types uses indexed color? a. .gif b. .jpeg c. .png d. .bmp
Computer screens and televisions use an a. additive color model b. subtractive color model c. hue, saturation and brightness model d. none of the above
Inkjet and other printers use a a. additive color model b. subtractive color model c. hue, saturation and brightness model d. none of the above
Suppose you have an RGB color image, and for each pixel there are 256 possible values of red, 256 possible values of green, and 256 possible values of blue. How many bits are required to store the value of each pixel? a. 1 b. 3 c. 8 d. 24
The following HTML script can generate the image below it. What will happen after the user clicks on “Hide” (where the arrow is pointing)? <html> <h2>Click tag</h2> <form name="aForm"> <input type="checkbox" name="say">It <br><input type="checkbox" name="say">Not It <br><input type="checkbox" name="do">Run <br><input type="checkbox" name="do">Safe <br><input type="checkbox" name="do" onClick="document.aForm.say[1].checked=true;">Hide </form> </html> Answer: Hide becomes unchecked, Not It becomes checked
Suppose that you have an uncompressed 256x256 RGB color image in which each row of pixels is a different color (a total of 256 different colors). How many bytes would be required to store this image? • 512 • 65,536 • 131,072 • 196,608
Now suppose that you compress the file from the previous question using run-length encoding. How many bytes would be required to store the compressed image? • 512 • 768 • 1024 • 1280
This time take the (uncompressed) image and compress it using run-length encoding with indexed color. How many bytes would be required to store the compressed image? • 512 • 768 • 1024 • 1280