Zoom
Edit index.html to create a web page and user can access your page via url /index.html (0.5 point)
Enter integer number 1:
Enter integer number 2:
Enter integer number 3:
EXECUTE LCM
(When the web page runs, if the interface is not the same as above, will not be considered for grading)
Assume users fill the values for the textfields (called as a, b, c).
When users click "EXECUTE LCM" button, the browser makes a request to /benn using GET method (The Servlet is configured in web.xml) (0.5 point):
a. Check validate input the integer numbers for a, b, c: If users enter the value of n not satisfied,show the error text "You must input an integer for a, b, c" to servlet. (1.0 point)
b. Execute: Find the least common multiple of 3 integers a, b, c, then output the result to servlet (Example: a=2, b=4, c=6 output: "12"). (1.0 point)
Hint: Function to find the least common multiple of 2 integers a, b
private int LCM(int a, int b) { int al-a, b1=b;while (a != b) { if (ab) b=b+bl;else a = a + al;}
Close
+ 95%