PRJ301_-_FA_2024_-_Block_5_-_PE_3256.webp
H

PRJ301_-_FA_2024_-_Block_5_-_PE_3256.webp

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%
Chưa có bình luận nào.

Thông tin

Category
PRJ301
Thêm bởi
Hữu Đức1
Ngày thêm
Lượt xem
6,423
Lượt bình luận
0
Rating
0.00 star(s) 0 đánh giá

Image metadata

Filename
PRJ301_-_FA_2024_-_Block_5_-_PE_3256.webp
File size
185.5 KB
Dimensions
1920px x 803px

Share this media

Back
Bên trên Bottom