Question
Optional: Write a CREATE TABLE MySQL statement that could be used to save the results of each round.
Show your thought process, knowledge of a programming language, and adherence to standards.
Solution Preview
This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.
public class Result extends HttpServlet{public void doGet(HttpServletRequest request,
HttpServletResponse response) throws IOException{
// set the response
response.setContentType("text/html");
// set the
PrintWriter out = response.getWriter();
// html
out.println("<html>");
out.println("<head>");
out.println("<title> tests all of thing </title>");
out.println("<body>");
out.println("<h1>Result</h1>");
// out.println("something");
// get passing data
Enumeration enums = request.getParameterNames();
// passing name
String pn = (String) enums.nextElement();
//paasing value
String[] pv = request.getParameterValues(pn);
// out.println("<b>" + pn + "<b>");
// out.print(pv[0]);
// player chosen
int player = Integer.parseInt(pv[0]);
// computer action
int result = decide(player);
// crate table
out.println("<table border=\"1\">\n" +
" <thead>\n" +...