Study Guides (390,000)
US (220,000)
Purdue (3,000)
CS (100)
All (10)
Final

CS 17700 Study Guide - Final Guide: Alpha CompositingExam


Department
Computer Sciences
Course Code
CS 17700
Professor
All
Study Guide
Final

This preview shows half of the first page. to view the full 3 pages of the document.
Q1. What is the name of the function that will display the names of variables in your program?
A) showVars()
B) showNames()
C) showFiles()
D) showObjects()
Key: A
Q2. The following function will result in a JES error. Why?
A) In line 1 the “:” is missing
B) The commands are not properly indented
C) Parentheses must be removed from line 1
D) A function name can not begin with a capital letter
Key: A
Q3. Which of the following commands will play the sound of the file "music.wav" ?
A) play(makeSound("music.wav"))
B) makeSound (play("music.wav"))
C) makeSound ("music.wav")
D) play ("music.wav")
Key: A
Q4.The following function is written to change the color of the pixels that have
a white colored bottom neighbor to black. There is something wrong with this function.
What should be the correction?
1 def changeColor(picture):
2 for x in range(0, getWidth(picture)):
3 for y in range(0, getHeight(picture)):
4 pixel = getPixel(picture, x, y)
5 testPixel = getPixel(picture, x, y+1)
6 if(testPixel == white):
7 setColor(pixel, black)
8 show(picture)
A) change line 3 to: for y in range(0, getHeight(picture)-1):
B) change line 2 to: for x in range(0, getWidth(picture)-1):
C) change line 5 to: testPixel = getPixel(picture, x+1, y)
D) swap white with black in the function
Key: A
You're Reading a Preview

Unlock to view full version