PRO192_-_PE_-_SU_2023_-_1_HCM_ca_14h_275.webp
H

PRO192_-_PE_-_SU_2023_-_1_HCM_ca_14h_275.webp

2 marks) Your task is to write a class called String Processor with this UML:(
String Processor
Where:
match_student_id(String s): static boolean A static function
+match student id(String): static
boolean
+ format camel(String): static
String
OUTPUT:
false
which verifies whether a student ID is correct. The student ID must start with se,he, or qe(ignore case) followed by exactly 4 to 6 digits.
For example: SE1234 is a correct ID but SE1234$ is not. Or hE1111 is a correct ID but hhE1111 is not.
format_camel(String): static String A static function which converts a string from "underscore" format to "camel" format. For example: format_camel will be transformed into formatCamel using this function
A main program is provided in binary form. You can test with following testcases to check your code:
The program outputs might look something like:
1.Test match_pattern().
1.Test match_pattern().
1.Test match_pattern().
2.Test format_camel().
2.Test format_camel().
2.Test format camel().
Enter your choice(1 or 2):1
Enter your choice (1 or 2):1
Enter your choice(1 or 2):1
Enter a student id:xse12345
Enter a student id:HE1111114
Enter a student id:QE12345#
OUTPUT:
false
1.Test match_pattern().
1.Test match_pattern().
1.Test match_pattern().
2.Test format camel().
2.Test format_camel().
2. Test format_camel().
Enter your choice(1 or 2):1
Enter a student id:sE1111
Enter your choice (1 or 2):1
Enter your choice(1 or 2):1
Enter a student id:HE00000
OUTPUT:
false
Enter a student id:qe33333
Zoom
+ 80%
Close
Chưa có bình luận nào.

Thông tin

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

Image metadata

Filename
PRO192_-_PE_-_SU_2023_-_1_HCM_ca_14h_275.webp
File size
69.2 KB
Dimensions
1536px x 793px

Share this media

Back
Bên trên Bottom