Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Assignment 5 - Times

 
Waria Ahmed
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,

Just picked up the nerve to attempt this assignment and i am completely baffled. How do i attack this assignment lol?

Any advice would be greatly appreciated.

Thanks
[ July 15, 2008: Message edited by: Waria Ahmed ]
 
Marilyn de Queiroz
Sheriff
Posts: 9066
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you read the links in the assignment?
 
Daniel Loranz
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I haven't been "OK-ed" on this one yet. So take the following comments with a grain of salt.

- Are you stuck with the formatting issue, meaning getting the results to line up in neat columns? If so, the "format text" link on the assignment page pretty much walks you through how to do that.

- Are you stuck on generating values for the table? If so, you can create the table using a nested loop. For example ...

for (int i = .... ) // fill in as needed
{
for (int j = ... ) // again fill in as needed
{
// now "ij" can identify individual elements in your table
// for example, the "j-th" column in the "i-th" row.

} // next j
}//next i

Hope this helps.
 
Waria Ahmed
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Daniel Loranz:
I haven't been "OK-ed" on this one yet. So take the following comments with a grain of salt.

- Are you stuck with the formatting issue, meaning getting the results to line up in neat columns? If so, the "format text" link on the assignment page pretty much walks you through how to do that.

- Are you stuck on generating values for the table? If so, you can create the table using a nested loop. For example ...

for (int i = .... ) // fill in as needed
{
for (int j = ... ) // again fill in as needed
{
// now "ij" can identify individual elements in your table
// for example, the "j-th" column in the "i-th" row.

} // next j
}//next i

Hope this helps.



I wasnt sure how to attempt this assignment. Although, thanks for the advice, I will attempt this again tonight and report back if i have any troubles.

Any more advice would be helpful though
 
fred rosenberger
lowercase baba
Bartender
Posts: 12181
34
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well, since you're on 5, I assume you know how to write, compile and run a program.

attack this problem like any other. do the minimum each time, then go through a testing process. perhaps start by doing nothing more than printing the header:
<blockquote>code:
<pre name="code" class="core"> 0 1 2 3 4 5 6 7 8 9</pre>
</blockquote>

once you have that working, see if you can print the first line of each row, so you end up with this:

<blockquote>code:
<pre name="code" class="core">
0 1 2 3 4 5 6 7 8 9
0
1
2
3
4
5
6
7
8
9
</pre>
</blockquote>
keep working a little bit at at time, constantly compiling and running after just about every single new line of code you write or change.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic