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

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 10:30
Aconstruction company is creating a powerpoint presentation describing how they calculate costs during each construction step. they plan to email this presentation to clients. the individual clients will be watching the presentation slide show on their own personal computers. what is the most important formatting step the company should take to make the text readable and pleasing to the eye?
Answers: 2
question
Computers and Technology, 23.06.2019 03:50
Q-1 which of the following can exist as cloud-based it resources? a. physical serverb. virtual serverc. software programd. network device
Answers: 1
question
Computers and Technology, 23.06.2019 09:30
You have been supporting csm tech publishing's windows server 2016 server network for over a year. the office has two windows server 2016 servers running active directory and a number of other roles. management has informed you that a small sales office is opening in the same building three floors up. the sales manager wants to install a sales application on a server located in the sales office. this server will have limited physical security because there's no special room dedicated for it, which means it will be accessible to non-it personnel and visitors. you're considering installing windows server 2016 server core on the new server because accessing its console regularly probably won't be necessary, and this server will be managed from one of the other csm tech publishing servers. what are the benefits and drawbacks of using server core for this branch office? what are some things you should do to set up this server management environment?
Answers: 1
question
Computers and Technology, 23.06.2019 09:30
[java] create an application called registrar that has the following classes: a. a student class that minimally stores the following data fields for a student: - name - student id number - number of credits - total grade points earned and this class should also be provides the following methods: - a constructor that initializes the name and id fields - a method that returns the student name field - a method that returns the student id field - methods to set and retrieve the total number of credits - methods to set and retrieve the total number of grade points earned. - a method that returns the gpa (grade points divided by credits) b. an instructor class that minimally stores the following data fields for an instructor: - name - faculty id number - department the following methods should be provided: - a constructor that initializes the name and id fields - methods to set and retrieve the instructor’s department. c. a course class that minimally stores the following data for a course: - name of the course- course registration code- maximum number of 35 students- instructor- number of students- students registered in the course (an array)the following methods should also be provided: - a constructor that initializes the name, registration code, and maximum number of students- methods to set and retrieve the instructor- a method to search for a student in the course; the search should be based on an id number.- a method to add a student to the course. if the course is hill, then an exception with an appropriate message should be raised (try creating your own exception class for this). also, be sure that the student is not already registered in the course. the list of students should be in the order that they registered.- a method to remove a student from the course. if the student is not found, then an exception with an appropriate message should be raised (use the same exception class mentioned a method that will allow course objects to be output to a file using object serialization- a method that will allow course objects to be read in from a file created with object serializationyou will note that the student and instructor classes described above have some commonality. create aperson class that captures this commonality and uses it as a base class for student and instructor. this class should be responsible for the name and id fields and also provide atostring method that returns a string of the form name, id. this will be the inheritedtostring method for the student and instructor classes.1. draw a uml diagram for diss application.2. implement the previous classes in java. write a main program that can serve as a test class that tests all of the methods created and demonstrates that they are working
Answers: 2
You know the right answer?
The exercises listed below are intended to provide an instructive way to get used to servlets and js...
Questions
question
Mathematics, 13.02.2022 14:00
question
Physics, 13.02.2022 14:00
Questions on the website: 13722361