Stanley Mooo

Stanley Mooo

  • NA
  • 5
  • 388

accessing table data

Feb 16 2017 2:15 AM
I'm busy with a school assignment. I have to create a table, then enter numbers into all the cells of the table. Then i have to get the lowest value in each row, then deduct the value from each of the values in that row. Then i have to get the lowest value in each column of the table and then deduct that value from each value in that column. Then I will have three lines of two or more zeros in a line, for a table that has 3 column and rows.

e.g.

Table 1, this is the table I will get after creating it dynamically and entering values in each cell.
c1 c2 c3
r1 [11] [14] [6]
r2 [8] [10] [11]
r3 [9] [12] [7]

(we have to deduct the lowest value in each row value)

Table 2 (this is the table i get after deducting the lowest value from each row cell)

c1 c2 c3
r1 [5] [8] [0]
r2 [0] [2] [3]
r3 [2] [5] [0]

(we have to deduct the lowest value in each column value)

Table 3 (this is the table i get after deducting the lowest value from each column cell)

c1 c2 c3
r1 [5] [6] [0]
r2 [0] [0] [3]
r3 [2] [3] [0]

Then we start looking for the three(3) lines of two or more zeros. Cause we have 3 columns and rows


c1 c2 | c3
r1 [5] [6] [| (0)]
r2 [-(0)] [- (0)] [| (3)]--
r3 [2] [3] [| (0)]
|

cause we are only getting two lines of two or more zeros. we have to get the lowest value in the whole table that does not have 2 or more zeros. Then deduct it from all the cell values of the table that are not zero and add it to the number where the lines intersect. Which is two in this case and the number where the two lines intersect is 3.

Table 4

Two is the lowest in this case:

c1 c2 c3
|
r1 [3] [4] [|0]
r2 [0-] [-0] [-|5]--
r3 [0-] [-1] [-|0]--
|

Now that we have three lines in a table of 3 columns and 3 rows we are done. we can print the final table.

Answers (1)