reset password
Author Message
Bsobpi
Posts: 9
Posted 15:42 Dec 02, 2016 |

Hi, I was wondering for HW11P01, when we list each roll/column could we display the results starting with 1 to make it easier to read or should we start at 0?

For example, instead of display row 0 = 14, row 1 = 6, row 2 = 12 could we do  row 1 = 14, row 2 = 6, row 3 = 12? 

Thank You

boxxydog
Posts: 11
Posted 18:54 Dec 02, 2016 |

Don't you just fix this with a simple print statement and counter + 1 within the print statement?

Bsobpi
Posts: 9
Posted 19:46 Dec 02, 2016 |

Yeah you do, but I was just wondering if he wanted us to do counter or counter + 1 or it doesn't matter which one we use.

I just decided to turn it in using counter + 1

dvictor4
Posts: 34
Posted 19:54 Dec 02, 2016 |

Yeah I am wondering about that to. But I am almost certain he wants you to start from 1 because if you look at problem 3 he counts the rows and columns from 1.

ifiguer
Posts: 27
Posted 12:50 Dec 03, 2016 |

Oh! I should start answering some of these forum questions. I know this is late, but you can use this for future reference. Just add 1 to the row index and you'll have the proper order when printing.

say:

int row = 0;

System.out.print("Row " + (row + 1) + ".");

prints: Row 1.