COSC 231-0 FALL 2013 FINAL Name:
1. Fix all syntax errors:
Little Mary had a lamb
as snow
And everywhere
that Mary
went
the was
sure
to
GO
2. Give an html file using internal CSS for the following. You MUST use CSS class as much as possible
this is text for paragraph 1
THIS is an h2 header #1
It followed her to school one day, which was against the rules.
It made the children laugh and shout, to see a lamb at school
THIS is an h2 header # 2
Black sheep, black sheep, have you any wool?
3. Consider this DOM (does not include all text nodes) that a browser has built.
What is the corresponding HTML?
4. Give Javascript code that would swap the first and last elements of the list
- element 1
- element 2
. . .
- element n
5. Give the Javascript code for an array of Image objects. Do not initialize the array.
6. How can you make a single word clickable? Show the HTML code using the following paragraph:
The word ÒduckÓ is the word of the day.
7. Suppose you have
Give Javascript code to remove the two images from the div Òdiv1Ó.
8. Suppose you have
Write the function fun1() that will display an alert box every 5 seconds.
9. Consider this regular expression: /[aeiou]/
How would you use that regular expression to obtain the value of the first vowel in Òhi momÓ? (i.e., give Javascript)
10. What is the regular expression good for? /\d{5}/
i.e., give English (Òit is good for É Ò), or
give an example where it matches and an example where it does not match.
11. What is the value of the following expression?
ÒaboootÓ.match(/o+t/)
12. Assuming a single (core) CPU, how many Java threads can be in the ÒRUNÓ state at any one moment of time?
a. 0 b. 1 c. 2 d. many
13. Give a Java statement that will force the executing thread into the ÒBLOCKEDÓ state for one second.
14. What LayoutManager is used to make a 3 X 2 grid of containers?
15. Suppose you use a Swing timer. What kind of listener will respond to timer events?
a. ButtonListener
b. TimerListener
c. ActionListener
d. EventListener
e. Other
16. A JPanel can contain a JPanel.
TRUE FALSE