-
Question 1 (20 marks)
-
List the advantages and disadvantages of using locales to label cultural information.
-
Question 2 (20 marks)
-
A locale is usually represented by a string "ll_CC" where the first two characters
in lower-case represent a language and the last two characters in upper-case
represent a country. Write a method in Java
boolean isISO(String locale)
which will return true if both the language and the
country codes are ISO codes, and false otherwise.
-
Question 3 (20 marks)
-
Write a method in Java
Font[] canShowString(String s)
which, for the given string s, will return all of the fonts that can display
all of the characters in the string s.
-
Question 4 (20 marks)
-
Write an input method in Java that will only accept digit characters and discard any others.
Only write the code for the method
dispatchEvent(). If your code uses methods
unchanged that have been given in the lecture notes, there is no need to repeat those methods.
-
Question 5 (20 marks)
-
A URI normally consists of ASCII characters. However, it may also contain
escape sequences "%HH" where "HH" is a pair of characters representing
hexadecimal digits. Write a method in Java
String normaliseURI(String s)
which will take the string s for a URI and return a new URI where all escape
sequences have been replaced by their ASCII equivalent.