Your tasks:
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 GCD
(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 GCD" button, the browser makes a request to /ged 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 greatest common divisor of 3 integers a, b, c, then output the result to servlet (Example: a=2, b=4, c=6 output: "2"). (1.0 point)
Hint: Function to find the greatest common divisor of 2 integers a, b
private int GCD(int a, int b) { while (a != b) { if (a > b) a = a - b;else b = b - a;}return a;}
+ 115%
Close