Web Technology Questions: 2008 Pearson Education Java Script Ans Css Questions
Web Technology Questions: 2008 Pearson Education Java Script Ans Css Questions
http://www.javascriptkit.com/script/
www.yaldex.com
www.w3schools.com
2008 Pearson Education
JAVA SCRIPT ANS CSS QUESTIONS
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
87.
88.
Write a script that uses relational and equality operators to compare two Strings input by
the user through an XHTML form. Output in an XHTML textarea whether the first string
is less than, equal to or greater than the second.
128.
Write a script that uses random number generation to create sentences. Use four arrays of
strings called article, noun, verb and preposition. Create a sentence by selecting a word at random
from each array in the following order: article, noun, verb, preposition, article and noun. As each
word is picked, concatenate it to the previous words in the sentence. The words should be
separated by spaces. When the final sentence is output, it should start with a capital letter and end
with a period. The arrays should be filled as follows: the article array should contain the articles
"the", "a", "one", "some" and "any"; the noun array should contain the nouns "boy", "girl", "dog",
"town" and "car"; the verb array should contain the verbs "drove", "jumped", "ran", "walked" and
"skipped"; the preposition array should contain the prepositions "to", "from", "over", "under" and
"on". The program should generate 20 sentences to form a short story and output the result to an
XHTML textarea. The story should begin with a line reading "Once upon a time..." and end with
a line reading "THE END".
129.
Write a script that inputs a telephone number as a string in the form (555) 555-5555. The
script should use String method split to extract the area code as a token, the first three digits of
the phone number as a token and the last four digits of the phone number as a token. Display the
area code in one text field and the seven-digit phone number in another text field.
130.
Write a script that inputs a line of text, tokenizes it with String method split and outputs
the tokens in reverse order.
131.
Write a script that inputs several lines of text and a search character and uses String
method indexOf to determine the number of occurrences of the character in the text.
132.
Write a script that reads a series of strings and outputs in an XHTML textarea only those
strings beginning with the character b.
133.
Write a script that reads a series of strings and outputs in an XHTML textarea only those
strings ending with the characters ed.
134.
Write your own version of the String method lastIndexOf and use it in a script.
135.
Write a program that reads a five-letter word from the user and produces all possible
three letter
136.
words that can be derived from the letters of the five-letter word. For example, the threeletter words produced from the word bathe include the commonly used words ate, bat,
bet, tab, hat, the and tea. Output the results in an XHTML textarea.