Intructions:
You need to know at least one programming language to perform reasonably well on certain exam questions.
Students are not allowed to use IDEs such as NetBeans, IntelliJ IDEA, or similar software to do the test.
All the answers must be written in the provided template file, in Enghlish and reflect this exam paper. If your answers to the questions in this exam paper have any keywords not related to this electronic exam paper, the answers to the questions will get ZERO. If you do not use the provided template file to answer the exam you take today, your exam will get ZERO.
Question 1 (3 points): Review the following class and find (at least) 6 issues in the code (i.e,coding practice, compile errors, potential logical issue, etc.) (Use question 1 template)
1. import java.lang.*;
2. import java.io.*;
3.
4.class Checkstringsymmetry {
5.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.String reverseString = "";
15.
16.while (!stack.isEmpty()) {
17.reverseString = stack.pop();
18.
}
19.if (inputString.equals(reverseString))
20.
21.
System.out.println("This is a symmetric character string.")
else
Zoom FUD
22.System.out.println("This is not a symmetric character string.");
+ 100%
Close