Deck 21: A Case Study in Algorithmic Problem Solving

Full screen (f)
exit full mode
Question
The Decomposition Principle can only be applied to the main task, not to any subtasks .
Use Space or
up arrow
down arrow
to flip the card.
Question
You must solve independent tasks before tackling tasks that depend on them .
Question
The Smooth Motion program uses 140 separate images to fill its 7 X 20 grid .
Question
When using images in HTML, it is recommended that they be placed in a separate folder .
Question
In the Smooth Motion application, when the user has not moved the mouse over any key image, the rightmost image is chosen at random .
Question
When the Smooth Motion web page first loads, before the JavaScript starts to run, the initial images for the grid animation are added to the page with twenty <img> tags typed into the document .
Question
The Smooth Motion application consists of five basic components .
Question
When building an application like the Smooth Motion application that is designed to work on the web, it is a good idea to build the basic web page first .
Question
When selecting which tasks to tackle first, if you have divided the subtasks well you will never have to worry about which to do first since they are all independent .
Question
A task dependency graph is a way to keep track of which tasks depend on other tasks .
Question
All images that will appear in a frame should be the same size .
Question
It is fine to mix type of image formats (for example, . gifs and . JPGs) when creating frame images for a JavaScript animation .
Question
Buttons are a type of control .
Question
A PERT chart

A) shows which tasks must be completed before which others
B) represents the structure of a JavaScript program
C) displays the layout of elements on an HTML page
D) gives a symbolic representation of the iterations of a loop
Question
When the Smooth Motion application animates the motion of the columns across the page, document . images[i] is replaced with

A) document . images[0]
B) document . images[i - 1]
C) document . images[2 * i]
D) document . images[i + 1]
Question
In the Smooth Motion program, the images move

A) from right to left
B) diagonally
C) from left to right
D) from top to bottom
Question
A mouseout event means

A) the mouse has moved onto an object on a web page
B) the mouse has moved away from an object on a web page
C) the mouse has moved away from the browser window
D) the user clicked on an object on a web page
Question
The build UI task

A) can be done at any time since it is completely independent of the other tasks
B) comes last, once you know what the page will try to do
C) comes after the animate grid but before the sense keys task
D) comes first so the JavaScript will have something to work with
Question
Which is the first thing you should do when applying the Decomposition Principle to creating a web application?

A) create a web page template
B) list the controls you need
C) list the tasks involved
D) put your images in a folder
Question
For the Smooth Motion application, the final JavaScript function, animate(), does two things . It updates the animation images and it

A) moves the key images to new locations on the web page
B) computes the exact amount of time since the mouse crossed any key image
C) recomputes the amount of time needed before the next call to animate
D) checks if the mouse is moving smoothly or not
Question
Some task solutions rely on the solution to another task . These are called

A) sequencing events
B) task dependencies
C) work orders
D) ordering requirements
Question
Another name for a PERT chart is a(n)

A) task dependency graph
B) ZIP display
C) iteration table
D) work influence program
Question
In the Smooth Motion application, the third key image is represented in HTML as:<img src="gifpix/OrangeBox . gif"onmouseover="here(2)" onmouseout="gone(2)">What is the purpose of the number 2 in this statement?

A) It specifies the number of key images .
B) It tells the event function which box was crossed by the mouse .
C) It gives the size of the key image .
D) It indicates the number of operations which the functions here()and gone()should perform .
Question
Select all that apply . Which of the following are the basic steps of animation?

A) prefetch the frames for updating the image
B) define and place the initial image
C) build the structural page
D) set a time and build a timer event handler
Question
Select all that apply . Which of the following are guidelines that must be followed when creating frame images for JavaScript animations?

A) ensure that all images which will overwrite other images have the same dimensions
B) define a grid to use
C) rename all image files with the . gifpix extension
D) ensure that all files are saved consistently and all overwriting files of one type is done with files of the same type (i . e . , overwrite a . gif with a . gif)
Question
Select all that apply . Which of the following are done by the timer event handler in the Smooth Motion application?

A) It moves all images except the first one position to the left .
B) It schedules itself for some time in the future .
C) It reloads the web page .
D) It assigns a new frame to image 19 .
Question
Select all that apply . Which of the following are subtasks required to complete the Sense Keys task in the Smooth Motion application?

A) prefetch the frames
B) build the event handlers
C) place the initial images and create the keys
D) define and organize the necessary frames
Question
Dividing a large task into smaller subtasks that can be solved separately is known as the ________ .
Question
When the mouse moves over an image, a(n) ________ event is recognized .
Question
When the mouse moves off an object, a(n) ________ event is recognized .
Question
________ charts were developed by the U . S . Navy in the 1950s .
Question
The ________ task gives the basic web page .
Question
To avoid delays in animation, ________ images is necessary .
Question
The event handler that moves each image on the grid one position to the ________ in the Smooth Motion application is called animate() .
Question
The browser, together with the operating system, keeps track of where the ________ is at any moment .
Question
The ________ task is to recognize when the user has "met the test . "
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/36
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 21: A Case Study in Algorithmic Problem Solving
1
The Decomposition Principle can only be applied to the main task, not to any subtasks .
False
2
You must solve independent tasks before tackling tasks that depend on them .
True
3
The Smooth Motion program uses 140 separate images to fill its 7 X 20 grid .
False
4
When using images in HTML, it is recommended that they be placed in a separate folder .
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
5
In the Smooth Motion application, when the user has not moved the mouse over any key image, the rightmost image is chosen at random .
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
6
When the Smooth Motion web page first loads, before the JavaScript starts to run, the initial images for the grid animation are added to the page with twenty <img> tags typed into the document .
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
7
The Smooth Motion application consists of five basic components .
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
8
When building an application like the Smooth Motion application that is designed to work on the web, it is a good idea to build the basic web page first .
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
9
When selecting which tasks to tackle first, if you have divided the subtasks well you will never have to worry about which to do first since they are all independent .
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
10
A task dependency graph is a way to keep track of which tasks depend on other tasks .
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
11
All images that will appear in a frame should be the same size .
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
12
It is fine to mix type of image formats (for example, . gifs and . JPGs) when creating frame images for a JavaScript animation .
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
13
Buttons are a type of control .
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
14
A PERT chart

A) shows which tasks must be completed before which others
B) represents the structure of a JavaScript program
C) displays the layout of elements on an HTML page
D) gives a symbolic representation of the iterations of a loop
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
15
When the Smooth Motion application animates the motion of the columns across the page, document . images[i] is replaced with

A) document . images[0]
B) document . images[i - 1]
C) document . images[2 * i]
D) document . images[i + 1]
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
16
In the Smooth Motion program, the images move

A) from right to left
B) diagonally
C) from left to right
D) from top to bottom
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
17
A mouseout event means

A) the mouse has moved onto an object on a web page
B) the mouse has moved away from an object on a web page
C) the mouse has moved away from the browser window
D) the user clicked on an object on a web page
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
18
The build UI task

A) can be done at any time since it is completely independent of the other tasks
B) comes last, once you know what the page will try to do
C) comes after the animate grid but before the sense keys task
D) comes first so the JavaScript will have something to work with
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
19
Which is the first thing you should do when applying the Decomposition Principle to creating a web application?

A) create a web page template
B) list the controls you need
C) list the tasks involved
D) put your images in a folder
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
20
For the Smooth Motion application, the final JavaScript function, animate(), does two things . It updates the animation images and it

A) moves the key images to new locations on the web page
B) computes the exact amount of time since the mouse crossed any key image
C) recomputes the amount of time needed before the next call to animate
D) checks if the mouse is moving smoothly or not
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
21
Some task solutions rely on the solution to another task . These are called

A) sequencing events
B) task dependencies
C) work orders
D) ordering requirements
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
22
Another name for a PERT chart is a(n)

A) task dependency graph
B) ZIP display
C) iteration table
D) work influence program
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
23
In the Smooth Motion application, the third key image is represented in HTML as:<img src="gifpix/OrangeBox . gif"onmouseover="here(2)" onmouseout="gone(2)">What is the purpose of the number 2 in this statement?

A) It specifies the number of key images .
B) It tells the event function which box was crossed by the mouse .
C) It gives the size of the key image .
D) It indicates the number of operations which the functions here()and gone()should perform .
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
24
Select all that apply . Which of the following are the basic steps of animation?

A) prefetch the frames for updating the image
B) define and place the initial image
C) build the structural page
D) set a time and build a timer event handler
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
25
Select all that apply . Which of the following are guidelines that must be followed when creating frame images for JavaScript animations?

A) ensure that all images which will overwrite other images have the same dimensions
B) define a grid to use
C) rename all image files with the . gifpix extension
D) ensure that all files are saved consistently and all overwriting files of one type is done with files of the same type (i . e . , overwrite a . gif with a . gif)
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
26
Select all that apply . Which of the following are done by the timer event handler in the Smooth Motion application?

A) It moves all images except the first one position to the left .
B) It schedules itself for some time in the future .
C) It reloads the web page .
D) It assigns a new frame to image 19 .
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
27
Select all that apply . Which of the following are subtasks required to complete the Sense Keys task in the Smooth Motion application?

A) prefetch the frames
B) build the event handlers
C) place the initial images and create the keys
D) define and organize the necessary frames
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
28
Dividing a large task into smaller subtasks that can be solved separately is known as the ________ .
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
29
When the mouse moves over an image, a(n) ________ event is recognized .
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
30
When the mouse moves off an object, a(n) ________ event is recognized .
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
31
________ charts were developed by the U . S . Navy in the 1950s .
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
32
The ________ task gives the basic web page .
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
33
To avoid delays in animation, ________ images is necessary .
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
34
The event handler that moves each image on the grid one position to the ________ in the Smooth Motion application is called animate() .
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
35
The browser, together with the operating system, keeps track of where the ________ is at any moment .
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
36
The ________ task is to recognize when the user has "met the test . "
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 36 flashcards in this deck.