PRJ301_-_PE_-_SP_2024_-_Block_5_1912.webp
F

PRJ301_-_PE_-_SP_2024_-_Block_5_1912.webp

Enter an integer number n:
Execute
Sum even
(When the web page runs, if the interface is not the same as above, 0.5 points will be deducted)
Assume that users fill an integer into the textfield (called n).
When users click "Execute" button, the browser makes a request to /sum using Post method (TheServlet is configured in web.xml) (0.5 point):
a. Check validate input n:
- If users input a value is not an integer number > 5, show the error text "You must input an integer> 5" to servlet. (0.5 point)
- If users do not choose any option, show the error text "You must choose an option" to servlet.(0.5 point)
b.Execute:
- If users choose "Sum odd" option, sum the odd numbers from 1 to n, then output the result to
servlet (Example: n=6 output: 9). (0.5 point)- If users choose "Sum even" option, sum the even numbers from 1 to n, then output the result to servlet (Example: n=6→ output: 12). (0.5 point)
Question 2:(2.0 points)
You are given a NetBeans template project (read more detail in the first page).
Your tasks

+ 100%
Zoom

Close
Chưa có bình luận nào.

Thông tin

Category
PRJ301
Thêm bởi
Fuery2002
Ngày thêm
Lượt xem
3,737
Lượt bình luận
0
Rating
0.00 star(s) 0 đánh giá

Image metadata

Filename
PRJ301_-_PE_-_SP_2024_-_Block_5_1912.webp
File size
194.3 KB
Dimensions
1920px x 803px

Share this media

Back
Bên trên Bottom