Question: Generating a Random Number Table a) Write a JSP page, which presents 75 random integer numbers from {0,1, ..., 10} in a table with 5

Generating a Random Number Table 

a) Write a JSP page, which presents 75 random integer numbers from {0,1, ..., 10} in a table with 5 columns and 28 rows as follows: the random numbers are listed in the first three columns, with the sum and the average of the random numbers of a particular row given in the last two columns. Headers for the five columns (“Trial 1”, “Trial 2”, “Trial 3”, “Horizontal Sum”, “Horizontal Average”) are printed in the upper row. Finally, the sum and average of the three columns are printed in the last two rows and the according headers (“Vertical Sum”, and “Vertical Average”) are given in fourth column.

Try to make the table easy to read by, for example, limiting the number of displayed digits, using bold fonts, choosing appropriate font and background colors.

b) Implement exercise 2a) as a Servlet.


c) Modify the Servlet created in exercise 2b) so that the random numbers only change on a new session HINT: on a new session, initialize Random() with the current time and save time; on an existing session, initialize Random() with time saved previously in the session scope.

Step by Step Solution

3.46 Rating (153 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To generate a Random Number Table using JSP and Servlets as described well break this task into three main steps Step 1 Create the JSP Page The first step is to create a JSP page that will display 75 ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Document Format (2 attachments)

PDF file Icon

606ad56864610_49162.pdf

180 KBs PDF File

Word file Icon

606ad56864610_49162.docx

120 KBs Word File

Students Have Also Explored These Related Programming Questions!