SWT301_-_SU_2024_-_B5PE1_2676.webp
K

SWT301_-_SU_2024_-_B5PE1_2676.webp

3.
4. class Checkstringsymmetry {
public static void main(String[] args) {
6.System.out.print("Please enter the character string you want to check:");
7.Scanner in-new Scanner(System.in);
8.
9.
String inputString in.nextLine();
int length inputString.length();
10.Stack stack= new Stack();
11.for (int i=0; i < inputString.length()1; i++) {
12.stack.push(inputString.charAt(i));
13.}
14.
15.
String reverseString = "";
16.while (Istack.isEmpty()) {
17.
reverseString = stack.pop();
18.}
19.
if (inputString.equals(reverseString))
20.System.out.println("This is a symmetric character string.")
21.else
22.
System.out.println("This is not a symmetric character string.");
23.}
24. }
Question 2 (3 points): Assuming you are assigned to conduct the component test for the method below, please design and create the minimum component test cases (Unit Test case) needed to achieve 100% statement covergage and 100% decision coverage. (Use question 2 template)
Zoom

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

Thông tin

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

Image metadata

Filename
SWT301_-_SU_2024_-_B5PE1_2676.webp
File size
147.1 KB
Dimensions
916px x 638px

Share this media

Back
Bên trên Bottom