Java Reference
In-Depth Information
(a)
(b)
F IGURE 33.27
The JSF page computes the tax.
*33.8
( Guess capitals ) Write a JSF that prompts the user to enter a capital for a state,
as shown in Figure 33.31a. Upon receiving the user input, the program reports
whether the answer is correct, as shown in Figure  33.31b. You can click the
Next button to display another question. You can use a two-dimensional array
to store the states and capitals, as proposed in Exercise 8.37. Create a list from
the array and apply the shuffle method to reorder the list so the questions will
appear in random order.
*33.9
( Access and update a Staff table ) Write a JSF program that views, inserts, and
updates staff information stored in a database, as shown in Figure 33.32. The
view button displays a record with a specified ID. The Staff table is created as
follows:
create table Staff (
id char ( 9 ) not null ,
lastName varchar ( 15 ),
firstName varchar ( 15 ),
mi char ( 1 ),
address varchar ( 20 ),
city varchar ( 20 ),
 
Search WWH ::




Custom Search