Contigency table
<p>I am struggling to find the Java code for this problem. Firstly, I am in a beginner level and this question were hard for me to answer. I know that this used a 2D array right? But I having problem to write the Java code for this question. </p>

<p>Here is the question:</p>

<blockquote>
  <p>Write a Java program that</p>
  
  <ol>
  <li>queries a user for the number of rows and columns of a contingency table,</li>
  <li>read the data, row by row and</li>
  <li>displays the data in tabular form along with the row totals, column totals and grand
  total.</li>
  </ol>
  
  <p>For example if the six data of 2x3 table are</p>
  
  <p>1,3,6,7,9, and 8.  the program displays these six numbers together
  with the appropriate totals as</p>

<pre><code>1 3 6   | 10  
7 9 8   | 24  
8 12 14 | 34  
</code></pre>
  
  <p>The character '|' is used to separate the data from the row totals</p>
</blockquote>
