I'm having trouble adjusting the output.. here's the code
how do you make it:Code:class TwoDimensionalRequirement { public static void main(String[] args) { String[][] truthTable = new String [4][4]; String [] header= {"ConditionA", "ConditionB", "And", "Or"}; truthTable[0][0] = "False"; truthTable[0][1] = "False"; truthTable[0][2] = "False"; truthTable[0][3] = "False"; truthTable[1][0] = "False"; truthTable[1][1] = "True"; truthTable[1][2] = "False"; truthTable[1][3] = "True"; truthTable[2][0] = "True"; truthTable[2][1] = "False"; truthTable[2][2] = "False"; truthTable[2][3] = "True"; truthTable[3][0] = "True"; truthTable[3][1] = "True"; truthTable[3][2] = "True"; truthTable[3][3] = "True"; System.out.println(header[0]+"\t"+header[1]+"\t"+header[2]+"\t"+header[3]); for (int row=0; row<truthTable.length; row++) for (int column=0; column<truthTable[row].length; column++) { System.out.print(truthTable[row][column]+"\t\t"); } } }
there's an excess 5th column.. i want it be limited to 4 columns only..




Reply With Quote

Bookmarks