Please add comments to my code. Thank youimport javax.swing.*;/* Outputs the table to a Dialog box */class multiplication {public static void main(String args[]) {String table = "";String sizeStr = "Input the size of the multiplication table:";int size;sizeStr = JOptionPane.showInputDialog(null, sizeStr);size = Integer.parseInt(sizeStr);if (size <= 0)="">=>JOptionPane.showMessageDialog(null, "No output for value <=>=>} else {// headertable += " ";for (int i = 0; i < size;="" i++)="">table += (i+1);table += " ";}table += "\n";// tablefor (int i = 1; i <= size;="" i++)="">=>for (int j = 1; j <= size;="" j++)="">=>table += (i * j);table += " ";}table += "\n";}JOptionPane.showMessageDialog(null, table);}System.exit(0);}// end main method}// end class
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here