subject

The exercises listed below are intended to provide an instructive way to get used to servlets and jsp. complete all three exercises. exercise 1 – getting used to jsp
a) write a simple jsp page that prints out a series of consecutive numbers by using a java loop construction. the output could be for example: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10b) modify your first jsp page (1a) such that it prints out the series of numbers given below using a java loop: 1, 4, 9, 16, 25, 36, 49, 64, 81, 100c) modify the jsp page further such that it prints in each line the sum of the squared numbers iterated through so far, as shown below: 12 = 1
12 + 22 = 1 + 4 = 5
12 + 22 + 32 = 1 + 4 + 9 = 14 and so ond) in order to make the list printed out by the previous jsp page easier to read, change the font color every other line. exercise 2 – generating a random number tablea) 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 sessionhint: 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. exercise 3 – responding to a user requestwrite a jsp application comprising of two parts. the page "collectuserinput. jsp" provides three fields which enable the user to specify input for a random number experiment: the number of trials ntrial, the minimum random number nmin, and the maximum random number nmax. by clicking the "submit" button, the ".jsp" page is requested. this jsp presents these numbers, performs an experiment where ntrial random numbers between nmin and nmax are drawn and lists the relative frequencies (how often this number was drawn in percent) for all the numbers between nmin and nmax.

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 06:50, phillipfruge3
Match the personality traits with their description
Answers: 1
image
Computers and Technology, 22.06.2019 08:00, razielcornils04
What is the algorithm for building a binary tree program
Answers: 2
image
Computers and Technology, 22.06.2019 10:00, QueenKy9576
Wich technology can a website use to allow you to listen to a concert live over the internet?
Answers: 3
image
Computers and Technology, 23.06.2019 16:00, ginaaa20
Which analyst position analyzes information using mathematical models to business managers make decisions?
Answers: 1
You know the right answer?
The exercises listed below are intended to provide an instructive way to get used to servlets and js...

Questions in other subjects:

Konu
Mathematics, 10.12.2021 22:00