PRJ301_-_FA_2024_-_PE_-_s_-_5_2879.webp
Văn Nam2

PRJ301_-_FA_2024_-_PE_-_s_-_5_2879.webp

Choose an option: Consonant characters
EXECUTE
Options:
Consonant characters.
Length of string.
(When the web page runs, if the interface is not the same as above, will not be considered for grading)
Assume users fill the value into the textfield (called str).
When users click "EXECUTE" button, the browser makes a request to /execute using Get method (The Servlet is configured in web.xml) (0.5 point):
a. Check validate input str: If users enter str string that is empty or spaces string, show the error text "Input string is invalid!" to servlet. (1.0 point)
b. Execute:
- If users choose "Length of string" option, count the number of characters of the string str, then output the result to servlet. (0.5 point)
(Example: str= "Hello world" output: 11).
- If users choose "Consonant characters" option, count the number of characters that are consonants in string str, then output the result to servlet. (Consonants are defined as any letter in the English alphabet that is not a vowel (a, e, i, o, u). The count should be case-insensitive and exclude any non-alphabetic characters) (0.5 point)
(Example: str= "Hello world" output: 7).

Close
+ 100%
Zoom
Chưa có bình luận nào.

Thông tin

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

Image metadata

Filename
PRJ301_-_FA_2024_-_PE_-_s_-_5_2879.webp
File size
203.8 KB
Dimensions
1920px x 803px

Share this media

Back
Bên trên Bottom